CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Adding graviational acc. to turbulence model

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 18, 2012, 13:46
Default Adding graviational acc. to turbulence model
  #1
New Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 20
Rep Power: 6
fertinaz is on a distinguished road
Hi,

I am trying to modify the standard kEps model to attain the influence of the buoyancy related turbulence.

I followed a few different methods however all seemed to fail.

1- Using readGravitationalAcceleration.H :
--> FOAM FATAL ERROR:
request for dictionary gravitationalProperties from objectRegistry region0 failed
available objects of type dictionary are
4
(
RASProperties
fvSchemes
fvSolution
transportProperties
)

2 - Reading from transportProperties:
--> FOAM FATAL ERROR:
LHS and RHS of + have different dimensions

The solver works fine with the standard kEps so I don't think that I have to change the solver or B.C's.

3- Creating a file called "g" and reading via lookupObject<uniformDimensionedVectorField>("g") :
Unknow type uniformDimensionedVectorField

4- Linking as a field by lookupObject<volVectorField>("g") :
gives an error during the runTime since g is a uniformDimensionedVectorField

I guess one other way would be to use a hard-coded vector but I don't want to do that. Any help is appreciated.

OF version: 1.6.x
OS: CentOS 5

Thanks a lot,
Fatih.
fertinaz is offline   Reply With Quote

Old   March 13, 2015, 06:08
Default
  #2
New Member
 
F.F.
Join Date: Dec 2011
Posts: 8
Rep Power: 5
Fabf is on a distinguished road
Facing the same problem. Did you find a solution?

I prefer to add

Code:
#include "UniformDimensionedField.H"
in the Header-file and call "g" by

Code:
 const uniformDimensionedVectorField& g_ = db().lookupObject<uniformDimensionedVectorField>("g");
But I get an Error that uniformDimensionedVectorField is not a type. I use OF 2.3.
Fabf is offline   Reply With Quote

Old   March 13, 2015, 06:26
Default
  #3
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,109
Rep Power: 19
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

You should include another file

Code:
#include "UniformDimensionedFields.H"
to have uniformDimensionedVectorField. Or declate your g_ as

Code:
UniformDimensionedField<vector>
if you insist on including just UniformDimensionedField.H.

And if you are adding gravitation to turbulence model:

buoyancy production term in turbulence model
http://openfoamwiki.net/index.php/Co...EpsilonViollet
alexeym is offline   Reply With Quote

Old   March 13, 2015, 06:49
Default
  #4
New Member
 
F.F.
Join Date: Dec 2011
Posts: 8
Rep Power: 5
Fabf is on a distinguished road
Hi Alexey,

thanks for your quick response.

I guess you meant
Code:
#include "uniformDimensionedFields.H"
This works fine fine for including the lib. However, I get for
Code:
const uniformDimensionedVectorField& g_ = db().lookupObject<uniformDimensionedVectorField>("g");
the following error:
Code:
kEpsilonBuoyant/kEpsilonBuoyant.C: In Elementfunktion »virtual void Foam::compressible::RASModels::kEpsilonBuoyant::correct()«:
kEpsilonBuoyant/kEpsilonBuoyant.C:324:47: Fehler: Referenz auf »db« ist mehrdeutig
/opt/openfoam230/src/OpenFOAM/lnInclude/IOobject.H:250:35: Fehler: Kandidaten sind: const Foam::objectRegistry& Foam::IOobject::db() const
/opt/openfoam230/src/OpenFOAM/lnInclude/IOobject.H:250:35: Fehler:                  const Foam::objectRegistry& Foam::IOobject::db() const
kEpsilonBuoyant/kEpsilonBuoyant.C:324:94: Fehler: expected primary-expression before »>« token
Means db is ambiguous. I copied that formulation from the mentioned kEpsilonViolett.
Fabf is offline   Reply With Quote

Old   March 13, 2015, 07:02
Default
  #5
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,109
Rep Power: 19
alexeym will become famous soon enoughalexeym will become famous soon enough
Yes, you are right about header name.

Well, kEpsilonViollet was developed for 1.7, guess that time RASModel was a little bit simpler. Right now it is a child of turbulenceModel and IOobject. Each of parents has db method.

So you can either create g_ property of your class and initialize it in constructor with something like:

Code:
    g_
    (
        IOobject
        (
            "g",
            runTime_.constant(),
            mesh_,
            IOobject::MUST_READ_IF_MODIFIED,
            IOobject::NO_WRITE
        )
    )
or use constant reference to fvMesh from turbulenceModel (there db ambiguity was resolved):

Code:
const uniformDimensionedVectorField& g_ = mesh_.thisDb().lookupObject<uniformDimensionedVectorField>("g");
alexeym is offline   Reply With Quote

Old   March 13, 2015, 07:26
Default
  #6
New Member
 
F.F.
Join Date: Dec 2011
Posts: 8
Rep Power: 5
Fabf is on a distinguished road
Model runs. Thank you a lot!

To sum it up: Inculding gravity acceleration in turbulence models by adding in the .H-file:

Code:
#include "uniformDimensionedFields.H"
and in the .C-File:
Code:
const uniformDimensionedVectorField& g_ = mesh_.thisDb().lookupObject<uniformDimensionedVectorField>("g");
Fabf 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
Use of k-epsilon and k-omega Models Jade M Main CFD Forum 12 June 2, 2015 13:16
SimpleFoam case with SpalartAllmaras turbulence model implemented nedved OpenFOAM Running, Solving & CFD 2 November 30, 2014 23:43
Fluent :- turbulence Model prince_pahariaa FLUENT 6 November 25, 2014 13:22
Low Reynolds k-epsilon model YJZ ANSYS 1 August 20, 2010 13:57
KOmega Turbulence model from wwwopenFOAMWikinet philippose OpenFOAM Running, Solving & CFD 30 August 4, 2010 10:26


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