CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   icoLagrangianFoam Drag Force Model (https://www.cfd-online.com/Forums/openfoam/82390-icolagrangianfoam-drag-force-model.html)

preichl November 24, 2010 21:22

icoLagrangianFoam Drag Force Model
 
Hi All,

I am interested in changing the drag force model used in icoLagrangianFoam. After looking at the source code, and I should state that I am not that familiar with C++ (but I have programmed in C and Fortran), it would appear that all I need to change is the HardBallParticle::updateProperties routine in HardBallParticle.C.
Is this correct? or do I need to make additional changes elsewhere?

Also, what do I need to include in IncompressibleCloud.C so that I have access to the timestep, dt, inside this routine?

Thanks in advance for any advice,

Paul

gschaider November 25, 2010 08:00

Quote:

Originally Posted by preichl (Post 284705)
Hi All,

I am interested in changing the drag force model used in icoLagrangianFoam. After looking at the source code, and I should state that I am not that familiar with C++ (but I have programmed in C and Fortran), it would appear that all I need to change is the HardBallParticle::updateProperties routine in HardBallParticle.C.
Is this correct? or do I need to make additional changes elsewhere?

Also, what do I need to include in IncompressibleCloud.C so that I have access to the timestep, dt, inside this routine?

Thanks in advance for any advice,

Paul

At first: use of that solver is discouraged as the new Kinematic-classes provide a much more elegant framework for Lagrangian particles. Have a look at https://openfoam-extend.svn.sourcefo...agrangianFoam/ for using them in incompressible cases (this works with 1.5 too and with minor modifications should work in 1.6 and 1.6.1 äh 1.7 too)
That way you don't have to modify the existing solver but you just write a new DragModel and link it to your solver (same for injection)

As for the locations of your modifications: you're right. Just there

Which time-step do you mean: the fluid time-step or the particle time-step

preichl November 25, 2010 17:36

Thanks Bernhard,

I will try out the channelParticles example. It looks like it may have much of what I want in it already.

I was after both the fluid time step and the particle time step.

After implementing an alternative drag law (most likely via the approach you suggested (i.e. by linking it in)) I would like to add the ability to store/write where the particles hit the walls. I guess I could do this by setting the elasticity of the collision to 0.

Thanks again (for this and for many of your highly practical additions like groovyBC and simpleFunctionObjects).

Paul.


All times are GMT -4. The time now is 09:48.