- **OpenFOAM Running, Solving & CFD**
(*http://www.cfd-online.com/Forums/openfoam-solving/*)

- - **Computing LES variable**
(*http://www.cfd-online.com/Forums/openfoam-solving/60235-computing-les-variable.html*)

Hi:
I am running icoFoamHi:
I am running icoFoam. However, wanted to compute the turbulent variable 'nuSGS' without using the turbulence model. I tried to compute the following way: surfaceScalarField nusgs = sqrt(mesh().V()/thickness)*symm(grad(U)); computing the thickness variable as given in LESdeltas, but was not able to work it out. some errors include: error: no match for call to (Foam :: fvMesh) () error: grad was not declared in this scope.. Can someone elaborate on how to obtain this quantity? further, in the incompressible code, Can i Add this computed field to constant "nu" to make it an effective nueff = nu+nusgs. Thanks, Vatant |

Why mesh().V() instead of meshWhy mesh().V() instead of mesh.V()? I would also say Foam::sqrt and the rest looks OK.
Hrv |

Hello Hrv:
I tried to impleHello Hrv:
I tried to implement your suggestions. on Compiling, I received following errors: error: no match for 'operator*' in 'Foam::operator*(const Foam::scalar&, const Foam::tmp<foam::field<type> >&) [with Ty pe = double](((const Foam::tmp<foam::field<double> >&)((const Foam::tmp<foam::field<double> >*)(& Foam::sqrt(const Foam::UList<double> &)())))) * Foam::symm(const Foam::GeometricField<foam::tensor<double>, PatchField, GeoMesh>&) [with PatchField = Foam::fvPatchField, G eoMesh = Foam::volMesh]()' I am not able to access mesh volume for some reason. Please let me know your thoughts on this. Thanks Vatant |

Split it up and try bits of thSplit it up and try bits of the expression - not obvious like his...
Hrv |

I tried to compute mesh.V(), mI tried to compute mesh.V(), mesh().V(),I keep getting the same error Foam::fvMesh problem.
Is there any other way to access the cell structure? Regards, Vatant |

Actually, now that I look at tActually, now that I look at this, it is so full of rubbish that I should not have bothered to answer in the first place. Let's just go slowly through it.
1) so, U is a volVectorField, right. Thank makes fvc::grad(U) a volTensor field. You forgot the fvc:: bit in the grad; I will discuss the type of result further 2) symm(fvc::grad(U)) is still a volTensorField (well, a symmetric tensor, but we've still haven't got that one). Fine. 3) mesh.V(), according to fvMesh.H returns a scalar field: //- Return cell volumes const scalarField& V() const; Note that V() gives you cell volumes, so it does not have any boundary conditions. 4) I sincerely hope that thickness is also a scalarField. If so, Foam::sqrt(mesh.V()/thickness) will give you a scalar field. Not clear if you've tried that. 5) So, now we've got: Foam::sqrt(mesh.V()/thickness)*symm(fvc::grad(U)) which would be a scalarField times a volTensorField. How do you imagine I will deal with the boundary conditions: the gradient is defined on the boundary, but the scale is not. In other words, this is a completely wrong operation - the best I can do for you is to multiply the internal field of the gradient with the scalar field and let you deal with the boundary conditions yourself. Thus: Info<< "Reading field U\n" << endl; volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); scalarField thickness(mesh.V().size(), 3.73); volTensorField a = fvc::grad(U); scalarField t = Foam::sqrt(mesh.V()/thickness); volTensorField b = fvc::grad(U); b.internalField() *= t; 6) and finally, the best one of all: surfaceScalarField nusgs = all this lot! How did you imagine that a surfaceScalarField (one scalar for all faces) can be initiated from a product of a scalar field and a tensor field? scalar = tensor??? Hmm. What happened to interpolation: how do I get face value from celll values? I think some serious thought is required before continuing :-) Enjoy (and sorry about the tone), Hrv |

All times are GMT -4. The time now is 03:36. |