write a field in OpenFOAM
Posted October 30, 2017 at 04:01 by kindle
This is a good thread on writing an object
Quote:
hi,
I will write out a variable of my own turb. model,
but its doesn't work.
First of all I define a ScalarField in my Header,
volScalarField hybrid_;
for the next step I edit the code file with a new Object
hybrid_
(
IOobject
(
"hybrid_",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh_,
dimensionedScalar("hybrid", dimless, 0.0)
),
and follow of the definition in the memberfunction
hybrid_ = tanh ( pow( max( scalar(0) , ( I_ / X_ ) - 1/2 ) , 3) );
// function = tanh( ( max( 0 , l/x - 1/2 ) )³ )
the compile shows now errors and the case run fine for me,
except !!
the code cant write out the values of my defined variable (hybrid_).
When I add the line hybrid_.write() its works,
but for every timestep and not for the defined writecontrol!
Hope everyone got a idea !
Thanks
Sven
I will write out a variable of my own turb. model,
but its doesn't work.
First of all I define a ScalarField in my Header,
volScalarField hybrid_;
for the next step I edit the code file with a new Object
hybrid_
(
IOobject
(
"hybrid_",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh_,
dimensionedScalar("hybrid", dimless, 0.0)
),
and follow of the definition in the memberfunction
hybrid_ = tanh ( pow( max( scalar(0) , ( I_ / X_ ) - 1/2 ) , 3) );
// function = tanh( ( max( 0 , l/x - 1/2 ) )³ )
the compile shows now errors and the case run fine for me,
except !!
the code cant write out the values of my defined variable (hybrid_).
When I add the line hybrid_.write() its works,
but for every timestep and not for the defined writecontrol!
Hope everyone got a idea !
Thanks
Sven
Total Comments 0