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

How to implement new thermotype?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 22, 2021, 12:36
Default How to implement new thermotype?
  #1
New Member
 
Join Date: Aug 2021
Posts: 3
Rep Power: 5
foxcfd is on a distinguished road
Hey everyone,



do you happen to know how to add a thermotype to the possible list of combinations? I have created the type thermo: hSolidLiquidPolynomial which is a copy of hPolynomial for testing. There are already a few threads on this topic e.g. Adding of a new thermotype but not for openfoam 9.



An existing possible combination of thermotypes is:



type heRhoThermo

mixture pureMixture

transport polynomial

thermo hPolynomial

equationOfState icoPolynomial

specie specie

energy sensibleEnthalpy



When i change hPolynomial to my hSolidLiquidPolynomial I get the following error message. See attached screenshot. Does anyone know a solution to this, how to add custom thermotypes to the possible combination list?


Thanks in advance.
Attached Images
File Type: png Screenshot.png (95.9 KB, 32 views)
foxcfd is offline   Reply With Quote

Old   April 13, 2023, 12:31
Default
  #2
New Member
 
Join Date: Apr 2023
Posts: 12
Rep Power: 3
elBombastico is on a distinguished road
Hi,


Sorry to resucitate this relatively old post.

I am also working on the validation of the stefan problem with ice/water, and your post was the most similar I could find.

I have managed to validate solidificationMeltingSource for the case in which the thermal properties are the same at both sides of the phase transition temperature. Nevertheless, I have come to the conclusion that the only way to use this source term with different material properties is to have them be a function of temperature. This is a bit cumbersome because of the sharp jump at 273.15 K, specially for the specific heat. I tried with hTabulated, but I get strange errors, in function of how the table is written in (OF8). Something similar to this bug (??) reported here.



Do you happen to know if it is possible to configure solidificationMeltingSource to have different properties for the solid and the liquid? I have seen that, in the documentation, there is a rhoRef, defined as "density of the solid", and a CpRef, but as far as I understand, they should only work on lookup, and not thermo modes ?


Thanks in advance
elBombastico is offline   Reply With Quote

Old   June 2, 2023, 03:30
Default Using therno to calculate rho with customized Teqn
  #3
New Member
 
Snigdha
Join Date: Jun 2021
Posts: 5
Rep Power: 0
sniggy is on a distinguished road
I am trying to develop a customized solver to solve some counter current packed bed and reaction problems. I am using rhosimpleFoam as the base solver on which I am trying to modify. I am interested to solve my own TEqn than the Eeqn . Can I still use thermo library to update rho?
sniggy is offline   Reply With Quote

Old   June 7, 2023, 09:58
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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
Probably yes, but you need to create a new thermo-library because we commonly (and this is the physical correct behavior) an energy equation such as the enthalpy or energy equation. Based on h or e we derive the temperature. If you don´t want to solve any energy equation, you need to built your own thermo-librarry and avoid calculating T based on h.

To the others:

- Starting point of building a new thermo-library is to copy an existing one (rhoThermo or psiThermo) and change the Typename as well as the class name.
- Compile the new code and run a tutorial case with the new library
- The results should be identically to the former version
- Now you can start modifying what ever you want
sniggy likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   June 12, 2023, 06:36
Default
  #5
New Member
 
Join Date: Apr 2023
Posts: 12
Rep Power: 3
elBombastico is on a distinguished road
Hi Tobi,


Thanks for your reply
I tried to implement a new thermo type around a couple months ago. I did proceed as you suggest, and I managed to copy and recompile a thermo library without any modifications.
Then, I taylored a specific heat capacity, equation of state and transport models to my needs and recompiled. Success again, they showed as a possible combination in the thermo types list.
Unfortunately, it was not possible to run a case using any of those models. The solver crashes right at the start, complaining about something was missing. Deciphering the error message with c++ filt, showed that something necessary was left out of the compilation process. I did not manage to find out how to fix this problem by addition and removal of lines in the make files.
All this was done in OF8, so I decided to downgrade to OF7, where I did manage to get it done at first try


I can post the entire problem with the error messages and the like, but I do not expect anybody to have the time to look at them.



Would you happen to have an example where you have implemented those models (Cp, rho, kappa and mu) in a new thermo library for OF8? I am particularly interested in an example of the make and option files, as well as how the typedef files have to be modified.


Thanks anyway
elBombastico 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
How to implement Regression Testing for CFD codes? aerosayan Main CFD Forum 7 July 5, 2021 11:08
How to change thermoType in reactingFoam (need to compile?) KTG OpenFOAM Programming & Development 5 September 3, 2020 09:25
slip & noslip boundary condition for dynamic mesh, how to implement? oschi OpenFOAM Programming & Development 6 May 21, 2019 05:33
Adding of a new thermotype FlyingCat OpenFOAM Programming & Development 12 February 18, 2019 08:39
How to implement a rigid lid aproximation for a 2d flow? Jaydi_21 Main CFD Forum 0 August 1, 2018 14:40


All times are GMT -4. The time now is 16:36.