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

Getting access to DB() inside perfectGas class

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By olesen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 3, 2021, 17:10
Default Getting access to DB() inside perfectGas class
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hey everybody,


does anyone know how I could get access to the db() registry inside the perfectGas class? Out of the box I guess it is not possible as this class and all inherited classes don't have any reference to the mesh object nor any other related classes. Probably it is not possible here.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   July 6, 2021, 09:49
Default
  #2
New Member
 
Omair
Join Date: May 2017
Posts: 9
Rep Power: 9
m.omair is on a distinguished road
I have a similar question. Can we access density inside the perfectGas class?.
m.omair is offline   Reply With Quote

Old   July 8, 2021, 08:07
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,695
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Tobi View Post
Hey everybody,
does anyone know how I could get access to the db() registry inside the perfectGas class? Out of the box I guess it is not possible as this class and all inherited classes don't have any reference to the mesh object nor any other related classes. Probably it is not possible here.

Not sure how/why it would be reasonable. If we simply view perfect-gas like any function such as sin(), cos() - we wouldn't really have any database connection for them either.
Tobi likes this.
olesen is offline   Reply With Quote

Old   July 8, 2021, 09:03
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hey Mark,


yes I was checking the implementation and as you state, it is just a «stupid» function. The reason why I wanted to have access to the db() was the following:
  • I developed a new humidity library (see my repository: https://github.com/shor-ty/humidityRhoThermo)
  • However it is a complete new thermodynamic database and we just manipulate the density of air
  • Therefore, I was thinking to implement these calculation inside an EOF
The benefit would be:
  • Run-Time accessible for any solver - no need to create new solvers
  • Easier maintenance of the code
  • More logical implementation
However, this EOS would not be a simple function as we have to solve a transport equation for the specific humidity and do other calculations.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Reply


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
Transport models in reactingFoam kuria OpenFOAM Running, Solving & CFD 1 January 22, 2021 04:50
Read from dictionary inside new smoother class TommyGun OpenFOAM Programming & Development 3 May 22, 2020 18:08
Type mismatch: Assigning a scalar to a Field<Type> inside templated BC code karlli OpenFOAM Programming & Development 2 August 28, 2017 01:25
Thermophysical properties for bouyantpimplefoam/chtmultiRegionfoam --water (any liq) manuc OpenFOAM Running, Solving & CFD 10 November 16, 2016 07:44
Read a dictionary inside the intermediate library Sören Sander OpenFOAM Programming & Development 4 July 1, 2016 08:16


All times are GMT -4. The time now is 09:44.