CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   problem while defining a new volScalarField in a new turbulence model (http://www.cfd-online.com/Forums/openfoam-programming-development/112224-problem-while-defining-new-volscalarfield-new-turbulence-model.html)

nikesh January 24, 2013 03:44

problem while defining a new volScalarField in a new turbulence model
 
Hii Foamers,
I am working on a new turbulence model which utilizes the basic Governing Equations of LaunderSharmaKE model. I need to modify the expression for nut. While doing so, I make use of a new term, k2e (it is a name i have given to this new variable, where k2e = sqr(k_)/epsilonTilda_ ) and in one part of the code it requires me to solve for div(phi_,k2e). I could implement all the equations and expressions in the new source code and I could also compile it successfully.
But when I try to run a case using that scheme, I get an error message::
--> FOAM FATAL IO ERROR:
[4] [8] keyword div(phi,(sqr(k)|epsilon)) is undefined in dictionary "/home/users/nikesh/Work/mvg/2-3Dflatplate-test/processor8/../system/fvSchemes::divSchemes"

I get the idea that this error is asking me to define the div(phi,k2e) term in the system/fvScheme file. I did that too.
Under the
divSchemes
I included
div(phi,k2e) Gauss upwind

And I still get the same error!
Any help is highly appreciated.
Thanks!!
nikesh

blacksquirrel January 24, 2013 12:25

Hi Nikesh,
Include the exact keyword in your fvSchemes, so:

div(phi,(sqr(k)|epsilon)) Gauss upwind;

That should do it.

nikesh January 24, 2013 21:35

Thnx blacksquirrel!
I had tried that option too but still wouldn't work. However good news that I managed to sort it out in another way.
I constructed and defined the function k2e_ in the source code.C file as::

k2e_
(
IOobject
(
"k2e",
runtime_.timeName(),
mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
sqr(k_)/epsilonTilda_
),

I also declared it in the header (source_code.H) file as::

volScalarField k2e_;

The expressions were then implemented and used in the part where viscosity is calculated.

And hence in the system/fvSchemes file, I could use::

divSchemes
div(phi,k2e) Gauss upwind;

I appreciate your reply though!!
Cheers!!


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