|
[Sponsors] |
May 2, 2006, 20:38 |
Hi:
I am running icoFoam
|
#1 |
Member
Join Date: Mar 2009
Posts: 43
Rep Power: 17 |
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 |
|
May 3, 2006, 03:22 |
Why mesh().V() instead of mesh
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
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 |
|
May 3, 2006, 11:58 |
Hello Hrv:
I tried to imple
|
#3 |
Member
Join Date: Mar 2009
Posts: 43
Rep Power: 17 |
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 |
|
May 3, 2006, 12:20 |
Split it up and try bits of th
|
#4 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
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 |
|
May 3, 2006, 15:45 |
I tried to compute mesh.V(), m
|
#5 |
Member
Join Date: Mar 2009
Posts: 43
Rep Power: 17 |
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 |
|
May 3, 2006, 17:33 |
Actually, now that I look at t
|
#6 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
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
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
|
|
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 15:33 |
Mixed CPU/GPU computing | Joe | Main CFD Forum | 4 | September 20, 2006 13:04 |
LES computing times | philt | OpenFOAM Running, Solving & CFD | 4 | June 2, 2006 18:46 |