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

New thermophysical model - OF8+

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By elBombastico

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 25, 2023, 05:38
Default New thermophysical model - OF8+
  #1
New Member
 
Join Date: Apr 2023
Posts: 11
Rep Power: 3
elBombastico is on a distinguished road
Dear all,


I am stuck implementing a new thermodynamic model that includes a transport model (mu, kappa), an EOS and a thermodynamic model (Cp) from rhoThermo (OF8). On top of that, I am replacing the Newton-Raphson routine that calculates the temperature from the enthalpy by another method. My problem is, I am not able to figure out how to modify the files (and which ones) that tell OF by which sub-models the new model is conformed. I also have some doubts about how I should compile it.


So far, I am doing the following:
  1. I copy src/thermophysicalModels/specie and basic to my user folder respecting the folder structure.
  2. I copy the content of src/thermophysicalModels/basic/rhoThermo to a folder with the name of my model and rename all the rhoThermo and heRhoThermo instances to the model name e.g. myRhoThermo and myHeRhoThermo. In the new folder, I also delete liquidThermo.C and .H.
  3. I place, in species/transport, species/equationOfState and species/thermo, the files that include the calculations of kappa, mu, rho and Cp.
  4. I place, in species/thermo/thermo, the files that do the temperature calculation as I want to (one thermo.C, one thermo.H and one thermoI.H).
Now I have to tell OF that my new thermo model is consituted by the transport, EOS, and thermo sub-models that I have implemented, and this is also where my problems start. Up to OF7, this was done via files called "thermoPhysicsTypes.H", and "rhoThermos.C". "thermoPhysicsTypes.H" contained all the possible thermophysical model combinations (including the pre-defined ones), and was removed from OF8. It seems to have been replaced by "typedefThermo.H". "rhoThermos.C" is very different from the one in previous versions. On top of that, the specie/include folder contains, together with "typedefThermo.H", a fair amount of files called forAbsoluteGases.H, forLiquids.H.... plus forThermo.H, and makeThermo.H.



Finally, I compile the specie and basic folders. Compilation of the latter does not go through. Rather than posting the error message, I have these questions:

  1. Are typedefThermo.H and myRhoThermos.C where I have to do these modifications?
  2. Do I actually need all the forLiquids.H, forAbsoluteGases.H etc ? I suspect I do not .
  3. Do you have an example of how I should modify these files and/or can you give me a clue about how to do it?
  4. Am I allowed to include in the basic/make/files only the .C files of the new model?
All the information/tutorials I found (e.g. this and this) belong to OF7 latest, where the file structure was different, or do not give the amount of detail that would help me.

I found some thermo models in gitHub, but either they are for older versions, or do not include the specie folder. If I succeed, I am willing to write a tutorial and post it in the wiki, or in the place of your suggestion.


I have attached rhoThermos.C (OF8), rhoThermos.C (OF7), plus the content of specie/include folder.


I am sorry if this kind of modification is very basic. I am not very familiar with either OF directory structure or C++.


Thanks in advance for your help
Attached Files
File Type: zip include.zip (10.1 KB, 6 views)
File Type: c rhoThermos.C (1.8 KB, 5 views)
File Type: c rhoThermosOF7.C (7.0 KB, 4 views)
Kaiqi likes this.

Last edited by elBombastico; April 25, 2023 at 05:47. Reason: Missing a couple links
elBombastico is offline   Reply With Quote

Reply

Tags
openfoam 8, thermo library, thermophysical model


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
Table bounds warnings at: END OF TIME STEP CFXer CFX 4 July 17, 2020 00:44
interFoam wave propagation and explosion of Courant number and residuals ChiaraViola OpenFOAM Running, Solving & CFD 1 June 26, 2019 06:36
compressible thermophysical model for water skuznet OpenFOAM Running, Solving & CFD 2 January 8, 2014 10:11
adding thermophysical model to conjugateHeatFoam helmut OpenFOAM Programming & Development 1 December 8, 2011 11:22
adding IAPWS thermophysical model undefined reference error abcdef123 OpenFOAM Programming & Development 1 October 23, 2011 11:07


All times are GMT -4. The time now is 04:07.