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

Custom Lagrangian Phase Change Model

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 9, 2019, 11:49
Default Custom Lagrangian Phase Change Model
  #1
New Member
 
Brent Craven
Join Date: Oct 2015
Posts: 7
Rep Power: 7
craven.brent is on a distinguished road
Hi All,

I am trying to implement a custom/modified PhaseChangeModel for Reacting parcels/clouds in OpenFOAM. Essentially, I want to customize the LiquidEvaporation submodel. But, I am having problems creating a cloned version of LiquidEvaporation and getting it compiled and running.

Here is what I have done (following https://www.cfd-online.com/Forums/openfoam-programming-development/131448-sprayfoam-water-spraying-into-steam-air-environment.html#post480698):
  1. Copied $FOAM_SRC/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation and renamed to NonIdealLiquidEvaporation
  2. Create a makeCustomReactingParcelPhaseChangeModels.C file with the following:
    Code:
    #include "basicReactingCloud.H"
    #include "NonIdealLiquidEvaporation.H"
    
    namespace Foam
    {
        makePhaseChangeModelType(NonIdealLiquidEvaporation, basicReactingCloud);
    }
  3. Create corresponding Make directory and files
  4. Compile
  5. Run with test case with the following in system/controlDict:
    Code:
    libs ("libCustomReactingParcelPhaseChangeModels.so");
Here is my code with a corresponding test case: https://drive.google.com/open?id=1fBjiv2qaOlYPWu_Jhu9n8KLJgFeGoeqk


The custom model/code compiles with no issues. However, when I try using it in the test case I get:
Code:
--> FOAM FATAL ERROR: 
Unknown phaseChangeModel type nonIdealLiquidEvaporation

Valid phaseChangeModel types :

3
(
liquidEvaporation
liquidEvaporationBoil
none
 )
So, for some reason the new phase change model is not added to the run time selection for phaseChangeModel. The makePhaseChangeModelType macro in $FOAM_SRC/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H seems like it should add the new model to the list of available options.


Has anyone had this issue? Or, has anyone successfully created a custom Lagrangian phase change model?


Note that I have also tried copying the entire $FOAM_SRC/lagrangian/intermediate library, adding my custom phase change model, and recompiling (as recommended in section 1.4 here: http://www.tfd.chalmers.se/~hani/kur...man-Arshad.pdf) with no success.


Thanks for your thoughts.

Brent
craven.brent is offline   Reply With Quote

Old   July 10, 2019, 08:33
Default
  #2
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 118
Rep Power: 8
zhangyan is on a distinguished road
Hi
If you are using OF-6, then you should remove the "namespace Foam" in the makeCustomReactingParcelPhaseChangeModels.C file.
__________________
https://openfoam.top
zhangyan is offline   Reply With Quote

Old   July 11, 2019, 11:50
Default
  #3
New Member
 
Brent Craven
Join Date: Oct 2015
Posts: 7
Rep Power: 7
craven.brent is on a distinguished road
Hi Yan,


Thanks for the advice. I have tried this in both OpenFOAM-v1806 and OpenFOAM-v1812 with the same result:


Code:
Unknown phaseChangeModel type nonIdealLiquidEvaporation
Is the Lagrangian library in OpenFOAM version 6 (now 7) significantly different?


If so, it might be worth a shot.


Thanks,
Brent
craven.brent 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
Thermal phase change model Piti CFX 1 January 14, 2021 10:03
Transient Phase Change Model: Explodes at low vapor quality evcelica CFX 0 August 28, 2018 10:55
How difficult is it to model a parrafin wax phase change? jmckenzie OpenFOAM 3 August 29, 2016 02:37
Error in Two phase (condensation) modeling adilsyyed CFX 15 June 24, 2015 19:42
Statistical Approach for Lagrangian Two Phase Model Hesham El-Batsh Main CFD Forum 0 November 20, 1998 09:20


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