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 is space conservation law implemented in OpenFoam? (https://www.cfd-online.com/Forums/openfoam-programming-development/170290-how-space-conservation-law-implemented-openfoam.html)

ajitkumar22 April 28, 2016 07:26

How is space conservation law implemented in OpenFoam?
 
Hi,

If we read any article on dynamicMesh handling on OpenFoam, we come across space conservation law. For example: see Eq. 2 in http://www.enu.kz/repository/2009/AIAA-2009-341.pdf.

I understand how Space Conservation Law can be theoretically incorporated in the momentum equations. I just can't find where in OpenFoam this law has been implemented.

The furthest I have reached to that space conservation law has something to do with makeRelative(phi, U) and makeAbsolute(phi,U).

I am looking for how makeRelative(phi,U) incorporates mesh motion.

Any help will be appreciated.

Ajit

kmooney May 4, 2016 21:17

Hi Ajit,

Make relative and make absolute simply add or subtract the mesh face fluxes (i.e. swept volume flux) from the volumetric flux.

This mesh face flux is calculated something like this (I'm going from memory):

1. Take a face, displace it to some other position in space.
2. Triangulate the face as it stands pre-motion and post motion. now you have two faces, each triangulated into more triangle faces.
3. For each triangle, create a prism by connecting the triangle before motion and after motion.
4. Calculate the volume of that prism.
5. Sum up all prisms for a face to get the volume swept by the face.

I hope that helps! I think you can find some more info from some of the work of Frank Boss.

Cheers,
Kyle

ajitkumar22 May 5, 2016 03:33

Thanks Kyle.

I understand the steps you mentioned. Actually I was looking for the piece of code in OpenFoam which implements these steps. I believe meshPhi does that job.

Best,
Ajit

kmooney May 5, 2016 03:42

Hi Ajit,

Here is where it calls the swept vol for each face (line 330):
https://github.com/OpenFOAM/OpenFOAM...rimitiveMesh.C

Here is where the faces are decomposed and swept vol calculated (line 608):
https://github.com/OpenFOAM/OpenFOAM...es/face/face.C

ajitkumar22 May 5, 2016 05:21

Thanks Kyle. I believe this is exactly what I was looking for.

Appreciate your help.


All times are GMT -4. The time now is 04:16.