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

Modify kEpsilon model

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 30, 2008, 19:05
Default Hi, I want to modify the ex
  #1
Member
 
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 7
harly is on a distinguished road
Hi,

I want to modify the existing k - epsilon model in OpenFoam.
My first question would be has anyone of experience with something like that?

Basically I need to add a line that is computed in every iteration. The main problem is, that I can't find the proper files.

I can do almost everything in kEpsilon.H/.C but a few things. For example: Is there an array where all the k_ and epsilon_ values are stored ? I have a formula in which I need to apply the current k_ (iteration) and a k0_ (timestep) to calculate a new variable.

Maybe someone can give me a lead where I could look for that or how I could create such an array. Especially where I can find the loops for timesteps and iterations. (I want to use turbFoam)

I would appreciate your help - this is my first bigger modification in OpenFoam and I feel a bit lost in all those files.

your
harly
harly is offline   Reply With Quote

Old   December 1, 2008, 06:19
Default Daniel, - new turbulence mo
  #2
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Braunschweig, Niedersachsen, Germany
Posts: 272
Rep Power: 8
henrik is on a distinguished road
Daniel,

- new turbulence model: Have a look here http://openfoamwiki.net/index.php/Si...ry_/_Tutorials

- arrays: k_ and epsilon_ are volScalarField and contain the arrays you are looking for.

Info << k_[cellI] << endl;

Prints the value of k in cell cellI.

- Loops: Have a look at the source of turbFoam and you will surely find them.

Henrik
henrik is offline   Reply With Quote

Old   December 1, 2008, 13:55
Default Hi, thanks a lot especially
  #3
Member
 
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 7
harly is on a distinguished road
Hi,

thanks a lot especially for the link - I have one small questions - how can I access the k_ value of a previous timestep/iteration? Because in your example I get the current k_ or not?

or is there a easy explanation how a volScalarField is structured I couldn't find a proper description.

Daniel
harly is offline   Reply With Quote

Old   December 1, 2008, 18:06
Default Try: k_.oldTime() You ge
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,728
Rep Power: 20
hjasak will become famous soon enough
Try:

k_.oldTime()

You get the complete field for the old time. Also, things like

k.oldTime().oldTime().oldTime() (as many as you like!)

will work fine. Beware: this kind of game costs memory

Enjoy,

Hrv
__________________
Hrvoje Jasak
hjasak is offline   Reply With Quote

Old   December 2, 2008, 18:36
Default thanks that is perfect So n
  #5
Member
 
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 7
harly is on a distinguished road
thanks that is perfect

So now that I can access all the fields data I have another question:

I need to Implement an equation like this:

C1_new = C1_*(1+Ct_*k_/epsilon_*1/(Q+k_)*abs(d(Q+k_)/dt) )

with Q = 0.5(u^2 + v^2) (for 2D)

and Ct_ will become a Constant

So here is the thing how can I implement Q ? I am not sure how to call the components from U_

also

I wonder what would be the best solution for the part in the abs(), because I would have done (Q_+k_)-(Q_old+k_.oldTime())/deltaT

maybe someone can give me a hint
harly is offline   Reply With Quote

Old   December 3, 2008, 17:43
Default Hi, I think I figured it o
  #6
Member
 
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 7
harly is on a distinguished road
Hi,

I think I figured it out but one small issue:
I have now the following for my
C1_star:
C1_*(0.38*k_/epsilon_*1.0/(0.5*magSqr(U_)+k_)*mag((0.5*magSqr(U_)+k_-0.5*magSqr( U_.oldTime())+k_.oldTime())/1.0));

The problem is in front of the 0.38 there should be a vector full of ones the same size like k_ and epsilon_ but I don't know how to create it.

Basically I want to make:

1+k_

Has someone an idea?

Yours
Daniel
harly 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
KEpsilon model k_oldTime not working harly OpenFOAM Running, Solving & CFD 2 December 10, 2008 13:13
About kEpsilon turbulence model osimonsimon OpenFOAM Running, Solving & CFD 10 April 24, 2008 02:52
NACA0012 Study kepsilon Model pda OpenFOAM Running, Solving & CFD 1 March 11, 2008 04:12
msha ADD A NEW RELATION TO kepsilon MODEL msha OpenFOAM 0 December 30, 2007 09:30
Adjusting kepsilon model braennstroem OpenFOAM Running, Solving & CFD 2 April 12, 2005 09:52


All times are GMT -4. The time now is 04:36.