|
[Sponsors] |
August 10, 2015, 14:00 |
solver for evaporation/condensation modeling
|
#1 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Hi Foamers,
I created solver for evaporation/condensation modeling based on interPhaseChangeFoam. My solver is called interEvapCondPhaseChangeFoam and is a result of information I read from similar threads on cfd online. Unfortunately solver does not work well. I run my solver on damBreak case and compared with interFoam but results are different. In attachement there are figures for 0.15 s for both solvers. I implemented Ganapathy model for mass transfer according to http://www.sciencedirect.com/science...7931013004341# I think that something is wrong in my MULES implementation. Here are all the necessary files http://fluid.itcmp.pwr.wroc.pl/~pblasiak/download.html Here are the commands to type in terminal to compile my solver and run damBreak test case for OpenFOAM 2.3.0.: unzip interEvapCondPhaseChangeFoam_allfiles.zip tar xzvf incompressible.tar.gz tar xzvf interEvapCondPhaseChangeFoam.tar.gz tar xzvf damBreak_interEvapCondPhaseChangeFoam.tar.gz cp -r incompressible $WM_PROJECT_USER_DIR/src/transportModels/ cp -r interEvapCondPhaseChangeFoam $WM_PROJECT_USER_DIR/applications/solvers/multiphase/ cp -r damBreak $FOAM_RUN/tutorials/multiphase/ cd $WM_PROJECT_USER_DIR/src/transportModels/incompressible wclean wmake libso cd $WM_PROJECT_USER_DIR/applications/solvers/multiphase/interEvapCondPhaseChangeFoam ./Allwclean ./Allwmake cd $FOAM_RUN/tutorials/multiphase/interEvapCondPhaseChangeFoam/damBreak ./Allrun As I said the solver is a result of available knowledge on cfd online but it still does not give correct results. I have also test case for one dimensional Stefan problem and results are close to analitycal but error is too large. If anybody interested I can upload this test case too. Can anybody help to fix this solver?
__________________
best regards pblasiak |
|
August 12, 2015, 11:15 |
|
#2 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Hi
I found that differences between interFoam and interEvapCondPhaseChangeFoam on damBreak case stem from bad system katalogue. Here is the correct version of damBreak case http://fluid.itcmp.pwr.wroc.pl/~pblasiak/download.html I compared it with interFoam and slight differences still exist but now it is much better. I think that differences are caused by me because I probably badly implemented MULES in interEvapCondPhaseChangeFoam. Is there any MULES-expert who can advice how to properly implement this in interEvapCondPhaseChangeFoam? interEvapCondPhaseChangeFoam are available in previous post with explanation how to compile it on OF2.3.0
__________________
best regards pblasiak |
|
August 12, 2015, 11:35 |
|
#3 | |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Quote:
However something is for sure wrong because when I changed mesh from 400 to 4000 alpha increases over 1. How to fix it? MULES-expert needed.
__________________
best regards pblasiak |
||
August 14, 2015, 09:52 |
|
#4 | |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Quote:
I know that Sp is implicit and Su explicit term in Source term for alpha equation: Source = Sp*alpha1 + Su I read the source code of MULES and in my case I set up Sp = 0 and Su = div*alpha1 + vDotAlphavpc (similarly as in interPhaseChangeFoam in MULES::explicitSolve) where vDotAlphavpc = mDot*(1/rho1 - alpha1*(1/rho1 - 1/rho2) mDot is equal (so far) only evaporation mass flux. So in my opinion MULES is implemented well. Can anybody verify this?
__________________
best regards pblasiak |
||
August 25, 2015, 07:50 |
|
#5 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
Hi gaza,
I try to compile it with OF 2.3.1 but seems like header file "#include "twoPhaseMixture.H"" is missing PHP Code:
thanks! Kanarya |
|
August 25, 2015, 08:27 |
|
#6 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Hi Kanarya,
please do this: 1) download interEvapCondPhaseChangeFoam from http://fluid.itcmp.pwr.wroc.pl/~pblasiak/download.html for example to Desktop 2) unzip interEvapCondPhaseChangeFoam_allfiles.zip 3) cd interEvapCondPhaseChangeFoam_allfiles 4) tar xzvf incompressible.tar.gz 5) tar xzvf interEvapCondPhaseChangeFoam.tar.gz 6) tar xzvf damBreak_interEvapCondPhaseChangeFoam.tar.gz 7) cp -r $WM_PROJECT_DIR/src $WM_PROJECT_USER_DIR/ 8) cp -r incompressible $WM_PROJECT_USER_DIR/src/transportModels/ 9) cp -r $WM_PROJECT_DIR/applications $WM_PROJECT_USER_DIR/ 10) cp -r interEvapCondPhaseChangeFoam $WM_PROJECT_USER_DIR/applications/solvers/multiphase/ 11) mkdir $WM_PROJECT_USER_DIR/run 12) cp -r $WM_PROJECT_DIR/tutorials $WM_PROJECT_USER_DIR/run 13) mkdir $FOAM_RUN/tutorials/multiphase/interEvapCondPhaseChangeFoam 14) cp -r damBreak $FOAM_RUN/tutorials/multiphase/interEvapCondPhaseChangeFoam 15) cd $WM_PROJECT_USER_DIR/src/transportModels/incompressible 16) wclean 17) wmake libso 18) cd $WM_PROJECT_USER_DIR/applications/solvers/multiphase/interEvapCondPhaseChangeFoam 19) ./Allwclean 20) ./Allwmake 21) cd $FOAM_RUN/tutorials/multiphase/interEvapCondPhaseChangeFoam/damBreak 22) ./Allrun please compare results damBreak case with interFoam damBreak case. They are very similar but not the same. Why? I do not know. You can also try Stefan problem test case. In the StefanProblem catalogue there are interfacePosStefProbl_analSol.dat (analytical solution for this case) and ps file (comparison between analytical and interEvapCondPhaseChangeFoam results). However something is for sure wrong because when I changed mesh from 400 to 4000 alpha increases over 1. What is wrong with the solver? I implemented everything according to Ganapathy article http://www.sciencedirect.com/science...7931013004341# I hope this help you to compile the solver. Please let me know if you succeeded.
__________________
best regards pblasiak |
|
August 25, 2015, 11:49 |
|
#7 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
Hi,
I manage to complie it with OF 2.3.1 but it gives the error: HTML Code:
Making dependency list for source file interEvapCondPhaseChangeFoam.C SOURCE=interEvapCondPhaseChangeFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -ggdb3 -I/usr/local/OpenFOAM//OpenFOAM-2.3.1/src/transportModels/twoPhaseMixture/lnInclude -I/usr/local/OpenFOAM//OpenFOAM-2.3.1/src/transportModels -I/home/links/rek209/OpenFOAM/rek209-2.3.1/src/transportModels/incompressible/lnInclude -I/usr/local/OpenFOAM//OpenFOAM-2.3.1/src/transportModels/interfaceProperties/lnInclude -I/usr/local/OpenFOAM//OpenFOAM-2.3.1/src/turbulenceModels/incompressible/turbulenceModel -IphaseChangeTwoPhaseMixtures/lnInclude -I/usr/local/OpenFOAM//OpenFOAM-2.3.1/src/finiteVolume/lnInclude -I/usr/local/OpenFOAM//OpenFOAM-2.3.1/src/meshTools/lnInclude -I/usr/local/OpenFOAM//OpenFOAM-2.3.1/src/fvOptions/lnInclude -I/usr/local/OpenFOAM//OpenFOAM-2.3.1/src/sampling/lnInclude -IlnInclude -I. -I/usr/local/OpenFOAM//OpenFOAM-2.3.1/src/OpenFOAM/lnInclude -I/usr/local/OpenFOAM//OpenFOAM-2.3.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/interEvapCondPhaseChangeFoam.o interEvapCondPhaseChangeFoam.C: In function ‘int main(int, char**)’: interEvapCondPhaseChangeFoam.C:90:39: error: ‘alphaOuterCorrectors’ was not declared in this scope if (pimple.firstIter() || alphaOuterCorrectors) ^ In file included from interEvapCondPhaseChangeFoam.C:85:0: /usr/local/OpenFOAM//OpenFOAM-2.3.1/src/finiteVolume/lnInclude/alphaControls.H:12:6: warning: unused variable ‘alphaApplyPrevCorr’ [-Wunused-variable] bool alphaApplyPrevCorr ^ /usr/local/OpenFOAM//OpenFOAM-2.3.1/src/finiteVolume/lnInclude/alphaControls.H:18:8: warning: unused variable ‘icAlpha’ [-Wunused-variable] scalar icAlpha ^ In file included from interEvapCondPhaseChangeFoam.C:59:0: /usr/local/OpenFOAM//OpenFOAM-2.3.1/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable] scalar maxDeltaT = ^ make: *** [Make/linux64GccDPOpt/interEvapCondPhaseChangeFoam.o] Error 1 did you try to compile it in OF 2.3.1? thanks in advance! Best! Kanarya |
|
August 25, 2015, 12:49 |
|
#8 | |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Quote:
Error is because alphaOuterCorrectors was not declared. In OF2.3.1 alphaOuterCorrectors was removed so you should delete this variable from files where it is used. Probably it helps. Here is explanation: https://github.com/phicau/IHFOAM/issues/3
__________________
best regards pblasiak |
||
August 26, 2015, 04:30 |
|
#9 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Hi Kanarya,
Did you manage to compile interEvapCondPhaseChangeFoam?
__________________
best regards pblasiak |
|
August 27, 2015, 07:04 |
|
#10 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
Hi gaza,
did not understand the source term Code:
vDotvpcAlphal Code:
fvm::Sp(vDotvmcAlphal, alpha1) + vDotcAlphal I am trying to understand the code now, Could you tell me what did you change?I saw that you change the TEqn and why did not you use enthalpy instead of T? it seems like condensation doesn't work at all mCond is always Zero! do have any idea? Thanks n advance! Best! |
|
August 27, 2015, 08:03 |
|
#11 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Hi Kanarya,
For now mCond is set up always set to zero. In future it will be changed but firstly I want to get accurate results for evaporation Stefan problem (test case in files which I uploaded in previous posts). I don't use the enthalpy because using T seems to be easier (for me). I just do not need this because the interEvapCondPhaseChangeFoam solver is based on incompressible interPhaseChangeFoam. vDotvpcAlphal = (mVap + mCond)*(1/rho1 + alpha1*(1/rho1 - 1/rho2)) // source term in alpha eqn. this term you can see in eqn. 2.26 in Jibran Heider thesis http://www.cimne.com/cvdata/cntr2/sp...branHaider.pdf It appears when you are solving alpha equation with source term on right hand side (after some algebra). In Ganapathy model m = mVap + mCond = kappaEff*(gradT.gradAlpha)/hEvap so m is not multiplied by alpha1 and I couldn't use fvm::Sp(vDotvpcAlphal, alpha1) because it would multiply vDotvpcAlphal by alpha1 (in case for Ganapathy model; for egzample for Lee model alpha1 exists in m and fvm::Sp can be used for this model). Summing up I am solving source term in alpha eqn. explicitly. Did you compile interEvapCondPhaseChangeFoam? Did you try Stefan problem? There is also analytical solution so you can observe the results are slightly different from analytical. Also if you change mesh from 400 to 4000 cells alpha is unbounded and I do not know why?
__________________
best regards pblasiak |
|
August 27, 2015, 08:13 |
|
#12 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
I think, if you want to have proper evaporation you need to have heat transfer between phases. It should happen in the in the interphase where liquid becoming gas...somehow you should force it...
I did not see any interphase heat transfer model in Ganapathy model?may be I am wrong? And I think you shuld couple the Psat with T? I did not see where you set the mCond to zero? I think, the solver is not completed but good progress! thanks! |
|
August 27, 2015, 08:48 |
|
#13 | |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Quote:
As you can see mDotc (mCond) is initialized to zero and nothing else so it stays equal to zero. In Ganapathy model phase change mass flux exists at interface because of gradAlpha term which is non zero only at interface.
__________________
best regards pblasiak |
||
August 27, 2015, 09:02 |
|
#14 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
what about heat transfer between phases?
how you can get evaporation without heat transfer?Am I missing something? sorry but I could not find initialisation of the mCond...is it in Ganapathy.C file? thanks |
|
August 27, 2015, 09:12 |
|
#15 | |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Quote:
97 Foam::Pair<Foam::tmp<Foam::volScalarField> > 98 Foam:haseChangeTwoPhaseMixtures::Ganapathy::mDot () const 99 { 100 volScalarField mDotc 101 ( 102 IOobject 103 ( 104 "mDotc", 105 U_.time().timeName(), 106 U_.db(), 107 IOobject::NO_READ, 108 IOobject::NO_WRITE 109 ), 110 U_.mesh(), 111 dimensionedScalar("mDotc", dimensionSet(1, -3, -1, 0, 0, 0, 0), 0) // set to zero mDotc = mCond 112 ); 2) there is heat transfer between phases modelled with Ganapathy model. See the Ganapathy article and equations.
__________________
best regards pblasiak |
||
August 27, 2015, 09:23 |
|
#16 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
yes I saw the initialisation for mDotc and vDotv but I did not see calculation of mDotv:
Code:
mDotv = kappaEff*(fvc::grad(T) & gradAlpha)/hEvap_; |
|
August 30, 2015, 16:09 |
|
#17 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Hi Foamers,
Who can explain these lines of code from alphaEqn.H file from interPhaseChangeFoam solver: 70 MULES::correct 71 ( 72 geometricOneField(), 73 alpha1, 74 tphiAlpha(), 75 tphiAlphaCorr(), 76 vDotvmcAlphal, 77 ( 78 divU*(alpha10 - alpha100) 79 - vDotvmcAlphal*alpha10 80 )(), 81 1, 82 0 83 ); I do not understand 78 and 79. Why Su term is defined as divU*(alpha10 - alpha100) - vDotvmcAlphal*alpha10 ??
__________________
best regards pblasiak |
|
September 17, 2015, 08:02 |
|
#18 | |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
Quote:
I think, the alpha100 and alpha10 are global and local values which is needed for MULES...I might be wrong...did you find the answer? |
||
September 17, 2015, 13:48 |
|
#19 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Hi Kanarya
No I didn't find how to properly set up MULES for evaporation case, ie. for alpha equation with source term on the RHS. I think it generates some errors and it is why numerical solution is a bit different from analytical. I see that only Henry Weller knows the answer.
__________________
best regards pblasiak |
|
October 5, 2015, 07:04 |
|
#20 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
hi,
do you have any idea what kind of source term, do you need in alpha equation? do you have any progress? thanks! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Creating New Solver: For particle-laden compressible jets | sankarv | OpenFOAM Running, Solving & CFD | 17 | December 3, 2014 20:41 |
Quarter Burner mesh with periosic condition | SamCanuck | FLUENT | 2 | August 31, 2011 12:34 |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
Creating New Solver: For particle-laden compressible jets | sankarv | OpenFOAM | 0 | April 4, 2010 19:06 |
why the solver reject it? Anyone with experience? | bearcat | CFX | 6 | April 28, 2008 15:08 |