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 Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By jairoandres

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 9, 2019, 12:49
Default Custom Lagrangian Phase Change Model
  #1
New Member
 
Brent Craven
Join Date: Oct 2015
Posts: 7
Rep Power: 11
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, 09:33
Default
  #2
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12
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, 12:50
Default
  #3
New Member
 
Brent Craven
Join Date: Oct 2015
Posts: 7
Rep Power: 11
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

Old   December 25, 2022, 17:38
Default
  #4
Member
 
Jairo A. Gutiérrez S
Join Date: Nov 2014
Posts: 60
Rep Power: 12
jairoandres is on a distinguished road
Hi, did you finally solve it?


Quote:
Originally Posted by craven.brent View Post
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
jairoandres is offline   Reply With Quote

Old   December 25, 2022, 20:22
Default
  #5
Member
 
Jairo A. Gutiérrez S
Join Date: Nov 2014
Posts: 60
Rep Power: 12
jairoandres is on a distinguished road
In my case, following the Chalmers guide did not work well ( http://www.tfd.chalmers.se/~hani/kur...man-Arshad.pdf)).

What I had to do to compile a test phase change model was the following: (OpenFOAM 2012).

1. Local compilation (Chalmers) did not work in any case.
2. Therefore I used the Chalmers procedure but in the root ($FOAM_SRC/lagrangian/intermediate/, etc).
3. Naturally, the intermediate/Make file is not modified in the root (LIB = $(FOAM_USER_LIBBIN)/libmylagrangianIntermediate is not included) as the compilation is not local.
4. If compiled from lagrangian/intermediate/ -->sudo bash --> wclean --> wmake libso, the compilation is successful but still the phase change model is not available in the list.
5. Compilation was successful and phase change model is available if compiled from $FOAM_SRC/lagrangian (--> sudo bash --> wclean --> ./Allwmake).

Please let me know if anybody can perform the local compilation in recent versions of OpenFOAM.

Best regards,

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


All times are GMT -4. The time now is 14:43.