|
[Sponsors] |
November 30, 2008, 20:05 |
Hi,
I want to modify the ex
|
#1 |
Member
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 17 |
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 |
|
December 1, 2008, 07:19 |
Daniel,
- new turbulence mo
|
#2 |
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18 |
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 |
|
December 1, 2008, 14:55 |
Hi,
thanks a lot especially
|
#3 |
Member
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 17 |
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 |
|
December 1, 2008, 19:06 |
Try:
k_.oldTime()
You ge
|
#4 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
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 Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
December 2, 2008, 19:36 |
thanks that is perfect
So n
|
#5 |
Member
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 17 |
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 |
|
December 3, 2008, 18:43 |
Hi,
I think I figured it o
|
#6 |
Member
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 17 |
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 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
KEpsilon model k_oldTime not working | harly | OpenFOAM Running, Solving & CFD | 2 | December 10, 2008 14:13 |
About kEpsilon turbulence model | osimonsimon | OpenFOAM Running, Solving & CFD | 10 | April 24, 2008 03: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 10:30 |
Adjusting kepsilon model | braennstroem | OpenFOAM Running, Solving & CFD | 2 | April 12, 2005 10:52 |