CFD Online Logo CFD Online URL
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

LinkBack Thread Tools Search this Thread Display Modes
Old   July 9, 2019, 11:49
Default Custom Lagrangian Phase Change Model
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
  1. Copied $FOAM_SRC/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation and renamed to NonIdealLiquidEvaporation
  2. Create a makeCustomReactingParcelPhaseChangeModels.C file with the following:
    #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:
    libs ("");
Here is my code with a corresponding test case:

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

Valid phaseChangeModel types :

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: with no success.

Thanks for your thoughts.

craven.brent is offline   Reply With Quote

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

Old   July 11, 2019, 11:50
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:

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

If so, it might be worth a shot.

craven.brent is offline   Reply With Quote


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.