CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   MapFields only on internal fields (

cosimobianchini April 12, 2007 06:37

Hi all, I would like to map
Hi all,
I would like to map results from a mesh to another one with the same geometry but different boundary partitions (the number and the names of the patches do not correspond). However I'm not interested in mapping boundaryFields but only the internalFields.
I was not able to make mapFields work without the -consistent option.
Is there a way for mapping only values on the internalMesh?
Thanks a lot

sgr June 23, 2015 10:49

Hi Cosimo,

did you come up with an answer or a work around to your post? I have a case, where I refined certain regions using refineMesh. If I use mapFields to map field variables of the coarse Mesh on to the refined one, the internal Fields are not mapped. It is just the boundary conditions that are.

I dearly hope for a reply. Best regards,


canopus December 1, 2015 07:23

The question in still unanswered!
Is there a way for mapping only values on the

and not boundary values?

sgr December 1, 2015 07:25

I have not found a way and stopped looking, but am still interested in a solution, of course.


aboth June 14, 2017 02:38


I think I found a way to do this. I know it is late for you, but for future reference I leave this here:

I use:


mapFields ../../014LuLaw188/baseCase/ -sourceTime 0.05 -mapMethod mapNearest -targetRegion region0
with a mapFieldsDict file with blank patchMap and cuttingPatches entries

cp ~/OpenFOAM/OpenFOAM-2.3.x/tutorials/lagrangian/DPMFoam/Goldschmidt/system/mapFieldsDict ./system/
The important part is the

-targetRegion region0
Apparently region0 is the default name for the internal region if you do not specify names in blockMeshDict. (I do not have info on the default name used by other mesh generators.)

For me the mapping created some nan entries, and some programs cannot deal with this, so I substituted them with 0 by executing the following line in the 0 directory:


find ./ -type f -readable -writable -exec sed -i "s/nan/0/g" {} \;

Adriana Correia May 5, 2020 07:08

Field reinitialization in bynary with mapFields utility
Hello everyone,

The solution of Ambrus worked well for me.

In my case, I needed to do a field reinitialization by keeping the internal field and changing the boundary conditions. I had the same geometry with the same mesh refinement but as my files were in binary (to keep the double-precision) I couldn't change the boundaries manually, so the workaround I found was:

1. create the new files (p and U for example) with the desired boundary conditions
2. map the internal field from a previous case according to Ambrus instructions

I hope it may be useful if someone faces the same problem as me.

Best regards.

All times are GMT -4. The time now is 10:15.