CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   icoUncoupledKinematicParcel particle diameter change each time step (evaporation) (https://www.cfd-online.com/Forums/openfoam-solving/232854-icouncoupledkinematicparcel-particle-diameter-change-each-time-step-evaporation.html)

IC01 January 3, 2021 00:36

icoUncoupledKinematicParcel particle diameter change each time step (evaporation)
 
Hello, Foamers

I'm using icoUncoupledKinematicParcelFoam for agriculture spray evaluation. I need to have a simple age dependant liquid evaporation (basically diameter (mass) change over the age of the particle). Can anyone suggest a solution? I know that there is liquidEvaporationBoil function that can be used with sprayFoam that is compressible. With my velocities (10 m/s air and 10 m/s water) I won't have any compressibility

Any advice would be appreciated

I'm using openFoam for a long time but I'm not familial with coding in C++

Thank you
Regards
IC01

oswald January 4, 2021 03:55

Hi,


unfortunately, I think there is no way to achieve this using kinematicCloud without any programming. On the other hand it is not that much of programming - one simple line should do the trick. But you would have to recompile the updated lagrangian/intermediate-library and a new solver including that library.


Another solution would be to use sprayCloud- (as you mentioned) or reactingCloud-solvers. Droplets can evaporate there. But that would imply to include lots of other things you might not be interested in like compressibility, thermodynamics, phase fractions, ... which makes the whole setup a lot more complex.

IC01 January 5, 2021 00:27

Quote:

Originally Posted by oswald (Post 792327)
Hi,


unfortunately, I think there is no way to achieve this using kinematicCloud without any programming. On the other hand it is not that much of programming - one simple line should do the trick. But you would have to recompile the updated lagrangian/intermediate-library and a new solver including that library.


Another solution would be to use sprayCloud- (as you mentioned) or reactingCloud-solvers. Droplets can evaporate there. But that would imply to include lots of other things you might not be interested in like compressibility, thermodynamics, phase fractions, ... which makes the whole setup a lot more complex.


Hi, Oswald

Thank you for your reply
I can compile intermediate lagrangian solver but stuck on the part where I have to add the line of the code. By chance, do you know what file I should edit and what line of code should I add? I assume it should be either liquidEvaporationBoil function or something like d(age)=custom function

Thanks again for your reply
Regards
IC01

oswald January 5, 2021 13:34

A very simple but also very crude method would be to directly put this in KinematicParcel.C. You could insert something after p.age()...:
Code:

p.age() += dt; // in my code this is at line 350


p.d() = INSERT FUNCTION HERE;


IC01 January 6, 2021 02:27

Quote:

Originally Posted by oswald (Post 792502)
A very simple but also very crude method would be to directly put this in KinematicParcel.C. You could insert something after p.age()...:
Code:

p.age() += dt; // in my code this is at line 350


p.d() = INSERT FUNCTION HERE;


Simple but works. You are a life saver. I will publish the steps once I finish it, might be good advice for someone like myself

Regards
IC01

IC01 January 14, 2021 00:48

Hello, everyone

Someone might have the same problem as this question appeared on this forum before but no one solved the problem
Problem: I need the spray evaporation over the time i.e change of diameter over the time in kinematic largangian openfoam solver
Here are the steps that I've done to solve it:
1) Comply your own lagrangian solver:
a) create the folder in openFoam 7 folder (I called it solver)
b) Copy icoUncoupledKinematicParcelFoam from applications/solvers/lagrangian to the folder you created
c) Copy lagrangian folder from src/ folder. After I deleted all of the files except the intermediate folder but you can keep them
d) in the icoUncoupledKinematicParticleFoam folder rename icoUncoupledKinematicParticleFoam.C file (I called it my_icoUncoupledKinematicParticleFoam)
e) in icoUncoupledKinematicParticleFoam/Make open files and change the first and third line to your file name (for me was icoUncoupledKinematicParcelFoam.C become my_icoUncoupledKinematicParcelFoam.C)
f) Open file option in the icoUncoupledKinematicParticleFoam/Make folder and delete line that includes intermidiate folder
g) put the following line to the end of exe_inc
-I/opt/openfoam7/solver/lagrangian/icoUncoupledKinematicParcelFoam/lagrangian/intermediate/lnInclude$

copy the following line from the top to the bottom of the file

-llagrangianIntermediate

You should get something like this

Code:

EXE_INC = \
    -I$(LIB_SRC)/lagrangian/basic/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
    -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
    -I$(LIB_SRC)/dynamicFvMesh/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I/opt/openfoam7/solver/lagrangian/icoUncoupledKinematicParcelFoam/lagrangian/intermediate/lnInclude$ 

EXE_LIBS = \
    -llagrangian \
    -llagrangianTurbulence \
    -lturbulenceModels \
    -lincompressibleTurbulenceModels \
    -lincompressibleTransportModels \
    -lfiniteVolume \
    -lregionModels \
    -lsurfaceFilmModels \
    -ldynamicFvMesh \
    -ltopoChangerFvMesh \
    -lmeshTools \
    -llagrangianIntermediate

h) open terminal in icoUncoupledKinematicParcelFoam
wmake
to clean what you have created wclean

Now you should have my_icoUncoupledKinematicParcelFoam as a solver

2) Search for KinematicParcel.C file in your solver folder and add line after line 350

This is my case
Code:


        p.age() += dt;
       
        //p.d()=cbrt(pow(p.d(),3)-dt*1e-10);///added!!!!!!!!!!
        if (cbrt(p.d()*p.d()*p.d()-1.209e-9*p.d()*dt)>0)
        {
        p.d()=cbrt(p.d()*p.d()*p.d()-1.209e-9*p.d()*dt);
        }
        else p.d()=1e-10;
       
        if (p.active() && p.onFace())

after comply the solver
wclean
wmake

This should be it. I've done it without programming knowledge and with very rudimental ubuntu knowledge so everyone can do it

Please let me know if anything is unclear

Good Luck

IC01

IC01 January 14, 2021 00:50

Quote:

Originally Posted by oswald (Post 792502)
A very simple but also very crude method would be to directly put this in KinematicParcel.C. You could insert something after p.age()...:
Code:

p.age() += dt; // in my code this is at line 350


p.d() = INSERT FUNCTION HERE;


And Huge thanks to Oswald for the support

IC01


All times are GMT -4. The time now is 02:49.