CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Writing out LES coefficients (https://www.cfd-online.com/Forums/openfoam/88538-writing-out-les-coefficients.html)

Tarak May 19, 2011 11:52

Writing out LES coefficients
 
Hii,

In the LES models k is declared as : volScalarField k, and can be read/written by

volScalarField k
(
IOobject
(
"k",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
I would like to have a look at the distribution of the constant ck which is declared as:

volScalarField ck
(
const volSymmTensorField&,
const volScalarField&
) const;

throughout the domain at different time steps.

Can someone please advice me how to get this printed in files alongwith k, omega etc? If I write in a similar manner as k, i.e

volScalarField ce
(
IOobject
(
"ce",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
it doesn't work, as there is a conflict in declaration.


Thanks,
Tarak

gregor May 20, 2011 03:32

you could use something like this:

if (runTime.outputTime()){
ck.write();
}

gregor

morard June 17, 2011 05:19

Hi Tarak,

Have you found out how to write coefficients?
I am trying somthing like:

if (runTime.outputTime())
{
volScalarField ck_
(
IOobject
(
"ck_",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sgsModel->coeffDict().lookup("ck")

);

runTime.write();
}

but, of course, this doesn't work


All times are GMT -4. The time now is 07:58.