CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How to calculate the velocity field after mesh.update()? (http://www.cfd-online.com/Forums/openfoam-programming-development/104658-how-calculate-velocity-field-after-mesh-update.html)

fisch July 12, 2012 09:55

How to calculate the velocity field after mesh.update()?
 
Hi,

In my code to build a scalarTransportDyMFoam the mesh is changed with mesh.update() corretely.
Now i need a adjusted velocity field to calcuate phi out of it and to make it relative for my calculation of the PDE (scalarTransport Eqn.).

Do you know how to adjust the U field?

Thanks for any advice.
Rupert

tomislav_maric July 12, 2012 10:27

This is from interDyMFoam.C:

Code:

        {
            // Calculate the relative velocity used to map the relative flux phi
            volVectorField Urel("Urel", U);

            if (mesh.moving())
            {
                Urel -= fvc::reconstruct(fvc::meshPhi(U));
            }

            // Do any mesh changes
            mesh.update();
        }

Does this help? You also have a correctPhi.H to include later. Check out the source.

fisch July 13, 2012 04:30

Hi Tomislav,
thanks for the post.

In your given code you first calculate the U_relative and then you do the meshMotion, right?

What i want is to move the mesh and then i want to get the corresponding U_rel and U_abs.

Is this possible?
Thanks
Rupert

tomislav_maric July 13, 2012 05:41

Quote:

Originally Posted by fisch (Post 371255)
Hi Tomislav,
thanks for the post.

In your given code you first calculate the U_relative and then you do the meshMotion, right?

What i want is to move the mesh and then i want to get the corresponding U_rel and U_abs.

Is this possible?
Thanks
Rupert

Hi Rupert,

why do you need to calculate the relative flux in this order, when it is actually prescribed with a given velocity field and the existing, non-moved mesh?

Tomislav

fisch July 13, 2012 06:22

Ok, the whole story:

I want to build a scalarTransportFoam solver with moving meshes.

I think it works the following way:

After mesh.update() i have to figure out my current U_rel or U_abs. And calculate the corresponding phi field.
Then i have to make the phi relative as an explicit input of the equation.
Finally i want to store my U_abs field in my output files.

Right now the velocity field is not updated due to the mesh motion. It stays constant on the initial field.

Do you get my concern?
Thanks

Thangam June 8, 2015 03:41

Hi,

I know this is a old thread. Just wondering if you managed to solve the issue.

http://www.cfd-online.com/Forums/ope...ic-meshes.html


Thanks
Thangam.


All times are GMT -4. The time now is 20:56.