CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

write a field in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

write a field in OpenFOAM

Posted October 30, 2017 at 04:01 by kindle

This is a good thread on writing an object


Quote:
Originally Posted by sven82 View Post
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
Posted in Uncategorized
Views 3044 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

All times are GMT -4. The time now is 17:19.