|
[Sponsors] |
November 28, 2020, 18:25 |
IOobject returns constant value
|
#1 |
Senior Member
Join Date: Dec 2019
Posts: 215
Rep Power: 7 |
Hi,
I am trying to create a new IOobject (Reynoldsnumber). Therefore I have added the following lines in my createFields.H and compiled it without errors. Unfortunately only a const value is returned (for Re and nu): Code:
volScalarField nu ( IOobject ( "nu", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), thermo.mu()/rho ); volScalarField L ( IOobject ( "L", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh,dimensionedScalar("L", dimensionSet(0,1,0,0,0,0,0),1 ) ); volScalarField Re ( IOobject ( "Re", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mag(U)*0.00095*L/nu ); Any idea what I am doing wrong? |
|
November 29, 2020, 02:54 |
|
#2 |
New Member
Wenyuan Fan
Join Date: Mar 2017
Posts: 27
Rep Power: 9 |
Hi,
You need to update such volScalarFields in the time loop. Otherwise, they will always take the initial values defined in createFields.H. |
|
November 29, 2020, 05:58 |
|
#3 |
Senior Member
Join Date: Dec 2019
Posts: 215
Rep Power: 7 |
Thank you very much, it seems to work now!
As you said, I have added the lines in the time loop of my solver: Code:
nu = thermo.mu()/rho; L = dimensionedScalar("L", dimensionSet(0,1,0,0,0,0,0),1 ); Re = mag(U)*0.00095*L/nu; |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Warning message C4133 while compiling | Arminius | Fluent UDF and Scheme Programming | 0 | October 2, 2017 11:44 |
LESModel returns constant field | syavash | OpenFOAM Programming & Development | 2 | December 19, 2016 06:20 |
Constant Volume Combustion with reactingFoam | Alish1984 | OpenFOAM Running, Solving & CFD | 2 | May 8, 2011 08:51 |
Fluent RPvar list for molar-weight | pilou | FLUENT | 6 | February 21, 2011 03:08 |
Really big problems when creating own materials da | Jop | FLUENT | 0 | June 28, 2007 11:15 |