|
[Sponsors] |
Howto create runtime variable for internal field |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 26, 2016, 20:28 |
Howto create runtime variable for internal field
|
#1 |
Member
Hasan Celik
Join Date: Sep 2016
Posts: 64
Rep Power: 10 |
Hello everyone. Assume that I have a variable like this:
And I want to change DT respect to T after every iteration and it should be like this, I need to get the value of that cell and evaluate DT equation, use it for iterations and write it to time folder and update it at next iteration step. So I define it like this: Code:
dimensionedScalar a (laminarTransport.lookup("a")); dimensionedScalar b (laminarTransport.lookup("b")); volScalarField DT = a*T+b The way I am trying to calculate DT is not appropriate way? If not, call you tell me how can I define this kind of variable, please? I hope you can help me to find my mistake! Regards |
|
January 5, 2017, 07:33 |
|
#2 |
Member
Ben Jankauskas
Join Date: Jun 2013
Location: Exeter
Posts: 34
Rep Power: 13 |
Hi,
You have to initialise your volScalarField with IOobject as follows: Code:
volScalarField DT ( IOobject ( "DT", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), a*T + b ); Cheers, Ben |
|
Tags |
openfoam, runtime modifiable, variable definition |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
OpenFOAM floating point Error | upuli | OpenFOAM Programming & Development | 5 | June 20, 2016 04:19 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Variable Operating Pressure (field) | Arturo | FLUENT | 0 | April 30, 2008 16:22 |
Dynamic Gradient Adaption: Mulitple Field Variable | Steve | FLUENT | 0 | July 12, 2005 18:36 |