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

Using (own) variable from turbulence model within solver

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

Like Tree1Likes
  • 1 Post By Arnoldinho

Reply
 
LinkBack Thread Tools Display Modes
Old   August 7, 2012, 11:57
Default Using (own) variable from turbulence model within solver
  #1
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
Hi all,

I have a modified turbulence model where I calculate (lets say) values stored in a IOobject xObj. How can I make this xObj now available to a modified interFoam solver?
I know that I can use e.g. the nut in interFoam via turbulence->nut(), but how can I achieve this behavior for my xObj? I think it must be registered somewhere, but I don't know how to do this...
(Writing the variable onto disc every single time step and reading it in again is not an option as its too slow.)

Thanks for any hints,
Arne
Arnoldinho is offline   Reply With Quote

Old   August 7, 2012, 19:04
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Arne,

Maybe this can help: http://openfoamwiki.net/index.php/Snip_objectRegistry

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   August 11, 2012, 07:14
Default
  #3
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Hello Arne,

I think you need to include the library header for your object in the custom solver. Then you can define a similar "nut" function in your turbulence model that returns a copy (or the address) of the object. Then you can declare an object in the solver and it would go something like (in solver):

Code:
object myObject;
myObject = turbulence->myObjectFromTurModel;
Where in the turbulence model you have:
Code:
object kOmegaBlaBla::myObjectFromTurModel()
{
    return myObjectFromTurModel;
}
If the object is large you can make the function "int" and return a pointer to the object (tricky!)

Regards
Hisham
Hisham is offline   Reply With Quote

Old   September 3, 2012, 12:18
Default
  #4
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
Hi all,

I indeed had to make an object registry, as "simply" making a new entry in the turbulence model did not work, as the RASModel class is fixed to the given variables and cannot be expanded.
The (so far) working solution is given here: http://www.cfd-online.com/Forums/ope...tml#post380045

Greetings,
Arne
wyldckat likes this.
Arnoldinho 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
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
How to implement turbulence in one Solver??? vahid.najafi OpenFOAM Programming & Development 0 July 29, 2012 05:46
Turning interDymFoam into a turbulence solver Saśl Balsa OpenFOAM Running, Solving & CFD 3 June 30, 2010 16:09
Fan heater model: what turbulence source to use? andy20 Main CFD Forum 0 March 2, 2008 13:46


All times are GMT -4. The time now is 15:37.