src/OpenFOAM logo
The Open Source CFD Toolbox
  Search
  
  Back to OpenFOAM Home
 
  OpenCFD®
  Company profile
  OpenFOAM support
  OpenFOAM development
  OpenFOAM training
  Solutions
  Contact OpenCFD
  Recruitment
  Recommended links
 
  OpenFOAM®
  Features
  Download
  Documentation
  * User Guide
  * C++ Source Guide
  * README file
  * Release notes
  * Upgrading to 1.5
 
  Our trade mark policy
 
  © 2000-2008 OpenCFD Ltd
SourceForge.net Logo
OpenCFD® Solutions Contact OpenFOAM®
OpenFOAM 1.5 User Guide © 2000-2008 OpenCFD Ltd

5.6 Mapping fields between different geometries

The mapFields utility maps one or more fields relating to a given geometry onto the corresponding fields for another geometry. It is completely generalised in so much as there does not need to be any similarity between the geometries to which the fields relate. However, for cases where the geometries are consistent, mapFields can be executed with a special option that simplifies the mapping process.

For our discussion of mapFields we need to define a few terms. First, we say that the data is mapped from the source to the target. The fields are deemed consistent if the geometry and boundary types, or conditions, of both source and target fields are identical. The field data that mapFields maps are those fields within the time directory specified by startFrom/startTime in the controlDict of the target case. The data is read from the equivalent time directory of the source case and mapped onto the equivalent time directory of the target case.

5.6.1 Mapping consistent fields

A mapping of consistent fields is simply performed by executing mapFields on the (target) case using the -consistent command line option as follows:


    mapFields <source dir> -consistent

5.6.2 Mapping inconsistent fields

When the fields are not consistent, as shown in 5.18, mapFields requires a mapFieldsDict dictionary in the system directory of the target case. The following rules apply to the mapping:
  • the field data is mapped from source to target wherever possible, i.e. in our example all the field data within the target geometry is mapped from the source, except those in the shaded region which remain unaltered;
  • the patch field data is left unaltered unless specified otherwise in the mapFieldsDict dictionary.

The mapFieldsDict dictionary contain two lists that specify mapping of patch data. The first list is patchMap that specifies mapping of data between pairs of source and target patches that are geometrically coincident, as shown in 5.18. The list contains each pair of names of source and target patch. The second list is cuttingPatches that contains names of target patches whose values are to be mapped from the source internal field through which the target patch cuts. In the situation where the target patch only cuts through part of the source internal field, e.g. bottom left target patch in our example, those values within the internal field are mapped and those outside remain unchanged.


                                    Coincident patches:
                                    can be mapped  using patchMap


     Internal target patches:
     can be mapped   using cuttingPatches


Source field geometry
Target field geometry
\special {t4ht=

Figure 5.18: Mapping inconsistent fields


An example mapFieldsDict dictionary is shown below:


17  patchMap
18  (
19      lid movingWall
20  );
21  
22  cuttingPatches
23  (
24      fixedWalls
25  );
26  
27  // ************************************************************************* //


    mapFields <source dir>

5.6.3 Mapping parallel cases

If either or both of the source and target cases are decomposed for running in parallel, additional options must be supplied when executing mapFields:
-parallelSource
if the source case is decomposed for parallel running;
-parallelTarget
if the target case is decomposed for parallel running.