Export the eddy viscosity of smagorinsky LES model

Hi everyone,

I’m using smagorinskyBGKdynamics, as the kinematic viscosity of this model is consisted of the physical kinematic viscosity and the eddy viscosity computed by smagorinsky constant and strain rate, I want to export the total viscosity to VTK files.

I tried computeKinematicViscosity(lattice), but it seems that it exported the physical kinematic viscosity which is a constant.
I also tried computeOmega(lattice), and it also seemed export the omega determined by physical kinematic viscosity excluding the eddy viscosity.

Is there any method that I can export the total viscosity or the eddy viscosity of smagorinsky.

with best wishes
steed188

Hello,

I think you will need to create a processing functional. There is no built in function to do that (I will add it to my to-do list i guess). For a quick hack you can replace the line in the “process” method of the class BoxKinematicViscosityFunctional3D :

T omega = lattice.get(iX,iY,iZ).getDynamics().getOmega();

by

T omega = lattice.get(iX,iY,iZ).getDynamicParameter(dynamicParams::dynamicOmega, lattice.get(iX,iY,iZ));

I hope it works (haven’t tested it).

Best regards,
Orestis

Mr, Orestis,
Thank you for your focus. I searched the original code of BoxKinematicViscosityFunctional3D, but I haven’ t found the code

T omega = lattice.get(iX,iY,iZ).getDynamics().getOmega();

I just found it in the StaticSmagorinskyFunctional3D.

Did I do something wrong? Because I’m not familiar with C++, especially about the class, would you mind provide a detail information?
Thank you again.

best wishes,
steed188

You should find the class in the file src/dataProcessors/dataAnalysisFunctional3D.hh

Best regards,
Orestis

Mr Orestis,
Thank you for your patient.
I modified the omega as you told. But the Compiler made error like below

[code=“xml”]
/home1/Application/Palabos/palabos-v2.0r0/src/dataProcessors/dataAnalysisFunctional3D.hh:2555:107: error: ‘class plb::Cell<double, plb::descriptors::D3Q19Descriptor>’ has no member named ‘getDynamicParameter’
T omega = lattice.get(iX,iY,iZ).getDynamicParameter(dynamicParams::dynamicOmega, lattice.get(iX,iY,iZ));


 
I'm using d3q19 scheme, seems did not work.

best wishes, 
steed188

My bad. the line should be:

 T omega = lattice.get(iX,iY,iZ).getDynamics().getDynamicParameter(dynamicParams::dynamicOmega, lattice.get(iX,iY,iZ));

Does it work now?

The Compiler was succesful.
But I’ve no idea how to use the analysis function , I wrote it like below, but it made segmentation fault.

[code=“cpp”]
MultiScalarField3D nu(parameters.getNx(), parameters.getNy(), parameters.getNz());
integrateProcessingFunctional(new BoxKinematicViscosityFunctional3D<T,DESCRIPTOR>, lattice.getBoundingBox(), lattice, nu, 0);
vtkOut.writeData(*nu, “nu”, util::sqr(dx)/dt);



Is it right to use integrateProcessingFunctional here?
By the way, according to your modified code, the new nu that calculated is the total nu, including both the molecule and eddy viscosity right?

best wishes,
steed188

Try

std::auto_ptr<MultiScalarField3D > nu = computeKinematicViscosity(lattice, lattice.getBoundingBox());
vtkOut.writeData(*nu, “nu”, util::sqr(dx)/dt);

Mr Orestis,
Thanks a lot! It works!

 By the way, do this method output the nut or (nu0+nut)?

 Thank you again. You really did me a big favor.

best wishes,
steed188

You are welcome.

It should be nu0+nut.

Best regards,
Orestis