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

Sharing a scalar Solver -> Boundary

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 21, 2012, 12:20
Default Sharing a scalar Solver -> Boundary
  #1
Senior Member
 
Aurelien Thinat
Join Date: Jul 2010
Posts: 165
Rep Power: 15
Aurelien Thinat is on a distinguished road
Hello everyone,

It's maybe a simple question. I'd like to share a value (integer, float, table or whatever...) store in the main solver with a boundary condition.

Is it possible to have an access to this value from the BC code ?

Thank you all.
Aurelien Thinat is offline   Reply With Quote

Old   March 1, 2012, 08:38
Default
  #2
Member
 
Laurens Van Dyck
Join Date: Jul 2011
Location: Netherlands/Germany
Posts: 34
Rep Power: 14
laurensvd is on a distinguished road
const volScalarField& someScalar = this->db().objectRegistry::lookupObject<volScalarFiel d> ("someScalar");

where you change someScalar with the name of what you are looking for, and in case its a vector,tensor,... just change volScalarField& to the appropriate type.
laurensvd is offline   Reply With Quote

Old   March 1, 2012, 13:15
Default
  #3
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
marupio is on a distinguished road
single element types can't be registered in the objectRegistry. You could use an IOlist, or the IOreferencer (just google it). Also, an objectRegistry lookup returns a const reference, so you can't change it.
__________________
~~~
Follow me on twitter @DavidGaden
marupio is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
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
CFX13 Post Periodic interface EtaEta CFX 7 December 8, 2011 18:15
natural convection mehrdadeng CFX 10 February 25, 2011 06:25
Calculated gradient boundary condition similar to gammaContactAngle adona058 OpenFOAM Running, Solving & CFD 0 September 26, 2007 16:23
Scalar boundary condition inside the fluid domain Ethan Siemens 3 May 2, 2007 17:02


All times are GMT -4. The time now is 21:03.