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

How to implement turbulence in one Solver???

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2012, 06:46
Default How to implement turbulence in one Solver???
  #1
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 13
vahid.najafi is an unknown quantity at this point
Hi Dear Foamers.
I have a big problem!!!!please help me about this!!

my solver is in Appendix.I want to added kinetic turbulence energy in Directory:
OpenFOAM/vahid 2.0.1/run/myinterPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.c
in file:SchnerrSauer.c

I have add (turbulence kinetic Energy or k ) in a part of this solver.
first:
added:
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \

in option.


and then:
added
//.................................................. .....changed
// Construct incompressible turbulence model
autoPtr<incompressible::RASModel> turbulence
(
incompressible::RASModel::New(U, phi, twoPhaseProperties())
);
//.................................................. .....changed


in creatField.

and then:
added

#include "RASModel.H"
and:

//.................................................. .............
volScalarField turbKinEnergy = turbulence().k(); //turbKinEnergy = turbulence().k();
volScalarField turbDisEnergy = turbulence().epsilon();
in this and turbkinEnergy=k
//.................................................. .............


in myinterPhaseChangeFoam.c

and wmake is ok!!!



but
I want in this solver in directory:
/run/myinterPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.c




I added
#include "RASModel.H"

in it and:


Foam::tmp<Foam::volScalarField>
Foam:haseChangeTwoPhaseMixtures::SchnerrSauer: Coeff
(
const volScalarField& p
) const
{
volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1)));
volScalarField rho
(
limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2()
);

return
//......I want to change it( <<k>> turbulence multiple in it):
(3*rho1()*rho2())*sqrt(2/(3*rho1()))*k()
*rRb(limitedAlpha1)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat()));
//.................................................. ......
}


dont successful wmake, and seen(was not declared ):

I/opt/openfoam201/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/SchnerrSauer.o
phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C: In member function â€کFoam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam:haseChangeTwoPhaseMixtures::SchnerrSauer: Coeff(const Foam::volScalarField&) const’:
phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C:113: error: k() was not declared in this scope
make: *** [Make/linux64GccDPOpt/SchnerrSauer.o] Error 1


please help me.

another way that I worked:


Foam::tmp<Foam::volScalarField>
Foam:haseChangeTwoPhaseMixtures::SchnerrSauer: Coeff
(
const volScalarField& p
) const
{
volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1)));
volScalarField rho
(
limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2()
);

return
const volScalarField &k=U_.db().lookupObject<volScalarField>("k");

(3*rho1()*rho2())*sqrt(2/(3*rho1()))*k()
*rRb(limitedAlpha1)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat()));


and wmake was Successfully .

but How can I Understand that this k is the same with k(kinetic turbulence energy)???Is it true???
Because I replase another world in this :
const volScalarField &M=U_.db().lookupObject<volScalarField>("M")
but not error occured!!!!!!??????


please help me more about this problem????Thanks.
Attached Files
File Type: zip myinterPhaseChangeFoam.zip (13.1 KB, 9 views)
vahid.najafi 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
thobois class engineTopoChangerMesh error Peter_600 OpenFOAM 4 August 2, 2014 10:52
Two equation turbulence models solver settings truffaldino FLUENT 0 March 5, 2011 21:49
Using a user-defined solver in OF ozzythewise OpenFOAM Running, Solving & CFD 3 February 8, 2011 16:28
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
turbulence modeling questions llowen Main CFD Forum 3 September 11, 1998 05:24


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