CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   iterating on other mesh (

-mAx- February 16, 2012 03:51

iterating on other mesh
I have a simple question.
My calculation is finished, but I forgot to define one wall-BC for computing force on it. (I don't want to recompute from 0)
I just have to define my BC, and re-export my final (and right) mesh, and I need to iterate one time on new mesh (but from older mesh solution) for getting my force.
How can I do that?
Or is it a way to interpolate my solution from older mesh to new one?
Thanks in advance

fivos February 16, 2012 13:20

Hi Max,

I don't know exactly how you want to compute force and what you want to change with your BCs, but can't you simply change the BC at the last time step and change also the controldict file to add the force calculation (see here also here Of course then you have to continue from latest time step, by modifying the controlDict file.

If you want to interpolate your ready solution on your new mesh, you should use mapFields (see also here:, it does exactly what you want.

See also the tutorial for the cavity in OpenFoam web page ( - go to section 2.1.9). In the tutorial the solution of the lid-driven cavity is mapped on a clipped cavity and the solution goes on.

I hope this helps you.

philippose February 16, 2012 17:38

Hello Maxime,

As long as your mesh is exactly the same, and all you do is add on a patch definition, then you only need to re-export the mesh into OpenFOAM, and make the following changes:

In the controlDict file:
1. Set the "startFrom" option in controlDict to "latestTime"

2. Increase your "endTime" to some number higher than the current last iteration you have on disk

3. change "stopAt" to "writeNow" (This causes the simulation to run for one iteration, force the results to be written to disk, and then stop the simulation)

In the field files (U, p, epsilon, k, etc...) in your last iteration, add on the boundary patch that you just added using the same conditions you have used for any of the other walls you have in the mesh.

Now, rerun your solver (for example, simpleFoam).

This will cause OpenFOAM to run the solver for one iteration, and write the results to disk. These last set of results will have the pressure distribution on your new patch too, which you can then use to calculate the force.

In case you have any doubts, feel free to call :-)!

Have a nice day!

Philippose Rajan

-mAx- February 17, 2012 02:32

exactly what I wanted Philippose.
Great job!
Thanks also fivos for your time

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