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

Adding graviational acc. to turbulence model

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Fabf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 18, 2012, 14:46
Default Adding graviational acc. to turbulence model
  #1
Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15
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: 14
Rep Power: 15
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,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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:

http://www.cfd-online.com/Forums/ope...nce-model.html
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: 14
Rep Power: 15
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,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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: 14
Rep Power: 15
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");
yuhan1991 likes this.
Fabf is offline   Reply With Quote

Old   December 12, 2020, 01:04
Default
  #7
New Member
 
Join Date: Nov 2020
Posts: 2
Rep Power: 0
Bogha is on a distinguished road
what is uniformdimensioned vector field and why is it used in terms of g?
Bogha is offline   Reply With Quote

Reply


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 Off
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 40 January 27, 2023 08:18
Fluent :- turbulence Model prince_pahariaa FLUENT 9 May 20, 2016 04:41
SimpleFoam case with SpalartAllmaras turbulence model implemented nedved OpenFOAM Running, Solving & CFD 2 November 30, 2014 23:43
Low Reynolds k-epsilon model YJZ ANSYS 1 August 20, 2010 14:57
KOmega Turbulence model from wwwopenFOAMWikinet philippose OpenFOAM Running, Solving & CFD 30 August 4, 2010 11:26


All times are GMT -4. The time now is 17:11.