CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   Problem with mapFields - map 2d to 3d (

GerhardHolzinger March 28, 2013 05:47

Problem with mapFields - map 2d to 3d
3 Attachment(s)

I want to map the solution of a 2d problem to a 3d mesh.
The images show the blocks of the 2d and the 3d meshes.

The 2d mesh has 3600 cells, the 3d has 36000 cells (it is 10 cells deep).

If I use mapFields with an empty mapFieldsDict


patchMap        ( );

cuttingPatches  ( );

then, mapFields maps the 2d solution onto the first block layer of the 3d mesh. There is an image attached of the alpha1 field. There it is clear to see.

How can I map the 2d fields to the 3d mesh in all depth. I need my 3d mesh to be 3 blocks in depth.

Andrea_85 March 4, 2014 14:00

Hi Gerhard,

did you solve the problem? I also have to map a 2-D solution onto the corresponding 3-d mesh (basically i just "refined" the mesh in 1 direction, from 1 cell depth to 10 cells depth).



GerhardHolzinger March 4, 2014 14:26

I only came up with a quick and dirty workaround, nothing more.

If your 2D domain is just a thinner version of your 3D domain, you can use transformPoints to "inflate" the mesh so that the domain has the same dimensions as the 3D domain. transformPoints applies either a uniform or a non-uniform scaling factor to the point coordinates.
So, to "inflate" the mesh, I applied a scaling factor greater than one in z-direction and a factor of 1 in the other directions.
Then I could use mapFields.

However, this applies only if the 2D mesh is just a thinner version of the 3D mesh.

Andrea_85 March 5, 2014 05:47

This is exactly what i have.
Following your suggestions, i used transformpoint to "inflate" the 2-d geoemtry to correspond to the 3-d. Then i used the option -consistent and it it normal that is so slow? it run all the night without doing anything. It is stuck here

Create databases as time

Source time: 0
Target time: 0
Create meshes

Source mesh size: 4066574 Target mesh size: 20332870

the target mesh is quite maybe its normal. Can it run in parallel to speed up the process?



GerhardHolzinger March 5, 2014 07:00

I have no experience with mapping from a 4M cells case to a 20M cell case. You should check whether you run out of memory. You need to load both meshes in order to map fields between them. You also need to load all fields. So the mapping operation you describe sounds very memory hungry.

Andrea_85 March 5, 2014 07:22

probably it is because the mesh is really big. Anyway i solved it in another way...using matlab :)

thanks again


All times are GMT -4. The time now is 21:42.