CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Computing LES variable

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By hjasak

Reply
 
LinkBack Thread Tools Display Modes
Old   May 2, 2006, 19:38
Default Hi: I am running icoFoam
  #1
Member
 
Join Date: Mar 2009
Posts: 43
Rep Power: 8
vatant is on a distinguished road
Hi:

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
vatant is offline   Reply With Quote

Old   May 3, 2006, 02:22
Default Why mesh().V() instead of mesh
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,762
Rep Power: 21
hjasak will become famous soon enough
Why mesh().V() instead of mesh.V()? I would also say Foam::sqrt and the rest looks OK.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   May 3, 2006, 10:58
Default Hello Hrv: I tried to imple
  #3
Member
 
Join Date: Mar 2009
Posts: 43
Rep Power: 8
vatant is on a distinguished road
Hello 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
vatant is offline   Reply With Quote

Old   May 3, 2006, 11:20
Default Split it up and try bits of th
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,762
Rep Power: 21
hjasak will become famous soon enough
Split it up and try bits of the expression - not obvious like his...

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   May 3, 2006, 14:45
Default I tried to compute mesh.V(), m
  #5
Member
 
Join Date: Mar 2009
Posts: 43
Rep Power: 8
vatant is on a distinguished road
I 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
vatant is offline   Reply With Quote

Old   May 3, 2006, 16:33
Default Actually, now that I look at t
  #6
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,762
Rep Power: 21
hjasak will become famous soon enough
Actually, 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
Pascal_doran likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RP_Set_Real("variable-name", variable name) bohis FLUENT 1 March 9, 2009 08:44
UDF in parallel computing Shamoon FLUENT 4 May 25, 2008 14:33
Mixed CPU/GPU computing Joe Main CFD Forum 4 September 20, 2006 12:04
LES computing times philt OpenFOAM Running, Solving & CFD 4 June 2, 2006 17:46


All times are GMT -4. The time now is 05:06.