CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How to compile a new drag force in Lagrangian model (https://www.cfd-online.com/Forums/openfoam-programming-development/172443-how-compile-new-drag-force-lagrangian-model.html)

lilinmin May 31, 2016 08:05

How to compile a new drag force in Lagrangian model
 
Dear Foamers,
I am now working with the gas-particle simulation. I have added a new drag model in the Drag file as the same way as other drag forces. But a don't know how to compile it. Can anyone help me ?
Thank you very much in advance.
Linmin

elmo555 May 31, 2016 08:56

Hey,

can you be a bit more specific? Which solver are you using, and how did you add the new drag model?

lilinmin May 31, 2016 09:40

Quote:

Originally Posted by elmo555 (Post 602641)
Hey,

can you be a bit more specific? Which solver are you using, and how did you add the new drag model?

Thank you very much for reply and I am sorry for that. I copied a file of the existed drag model in the file "src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Drag" and changed the code. Can it been compiled?

elmo555 May 31, 2016 10:07

Well, you need to re-compile the solver you're using, and you shouldn't modify the original OF solver. There are many tutorials out there explaining how to create a new solver based on an exisiting one, e.g. here.

Basically: copy the original code to your working folder, adjust the name and EXE path, and add your drag model (using #include) where all the other drag models are included. Then compile the solver and you should be able to use your drag model.

a.weber June 9, 2016 04:15

BTW: The force model list is found in intermediate/parcels/include/MakeParcelForces.C
This is where you have to add it.

regards
Andreas


All times are GMT -4. The time now is 21:47.