CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to modify oodles to print epsilon (https://www.cfd-online.com/Forums/openfoam-solving/58225-how-modify-oodles-print-epsilon.html)

villet December 9, 2008 12:37

Hi Gijs, check that "create
 
Hi Gijs,

check that "createMyFields.H" is included after "createFields.H". Also check the equation for dissipation rate. It doesn't look like the right one...

Anyway, I have another solution. You can call "sgsModel->epsilon()" that computes TKE dissipation estimation (ce*ksgs*sqrt(ksgs)/delta for eddy viscosity models).

Hope this helps!
Ville

gwierink December 9, 2008 13:30

Hi Ville, How are things? T
 
Hi Ville,

How are things? Thanks for your reaction. I did put "#include createMyFields.H" after createFields.H. The equation is just a guess, because I also tried:



Info<< "Calculating the dissipation.\n" << endl;
volScalarField dissipation
(
IOobject
(
"dissipation",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
sgsModel->epsilon()
);



and that didn't work. Well, it does write out a file called "dissipation" every timestep, but it only contains the same info as the initial conditions (i.e. zerGradient for most things and some fixed values for the two inlets). Any idea how to fix that?

Thanks, Gijs

villet December 9, 2008 14:54

Uups, you need to update epsil
 
Uups, you need to update epsilon somewhere in the code:

dissipation = sgsModel->epsilon();

gwierink December 10, 2008 01:36

So you mean I should put "diss
 
So you mean I should put "dissipation = sgsModel->epsilon();" in myoodles.C and have it also in createMyFields.H ?

gwierink December 10, 2008 04:13

Hi Ville, Thanks for your h
 
Hi Ville,

Thanks for your hint. To recap for others, this is what worked (at least for a few time steps, still need to test it for longer times):

Put in myoodles.C the lines "#include createMyFields.H" and "dissipation = sgsModel->epsilon()". Then, create a file called "createMyFields.H" (or whatever you like of course) with the code:

Info<< "Calculating the dissipation.\n" << endl;
volScalarField dissipation
(
IOobject
(
"dissipation",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

Now every writing step a file called "dissipation" is written that contains a field of subgrid epsilon.

Many thanks for your help Ville ( and also many thanks to Ville Vuorinen for helping me out)!

Cheers,

Gijs

villet December 10, 2008 08:02

That's good to hear you got it
 
That's good to hear you got it working!


All times are GMT -4. The time now is 21:22.