|
[Sponsors] |
Using (own) variable from turbulence model within solver |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 7, 2012, 11:57 |
Using (own) variable from turbulence model within solver
|
#1 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
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 |
|
August 7, 2012, 19:04 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Arne,
Maybe this can help: http://openfoamwiki.net/index.php/Snip_objectRegistry Best regards, Bruno
__________________
|
|
August 11, 2012, 07:14 |
|
#3 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
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; Code:
object kOmegaBlaBla::myObjectFromTurModel() { return myObjectFromTurModel; } Regards Hisham |
|
September 3, 2012, 12:18 |
|
#4 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 03: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 12:46 |