CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   MapFields does not work (https://www.cfd-online.com/Forums/openfoam-pre-processing/61517-mapfields-does-not-work.html)

hartinger September 23, 2005 06:05

HI, remove all Patches with
 
HI,

remove all Patches with zero faces in it from the 'boundary' file in the polymesh directory and try.

Pierre (colleague, who can't be bothered to register)

didomenico September 23, 2005 07:18

Hi Markus/Pierre, I have g
 
Hi Markus/Pierre,
I have good & bad news:
- your trick works, that means the mapFields goes to the end w/o problems;
- nothing is written in the target directory! It is the same behaviour I get without -consistent flag.
In my boundary files I have just a wall, inlet/outlet and wedge (two different patches) faces.
Have you suggestion how I can debug further?
Thanks
Massimiliano

pierre September 23, 2005 11:41

Right then, well it worked for
 
Right then, well it worked for me following these steps:
i.e if mapping
from SourceCase/500/ to TargetCase/500/
- make sure the latter dir exists
- In the target case, make sure that no previous internal Fields are written, specify instead for example for variable U
internalField uniform (0.569 0 0); (no list size specified)
- pray to the CFD god

I couldn't explain why it works rather than another way, but I trust that doensn't bother you that much right now.

Pierre

hjasak September 23, 2005 11:46

Have a look at the source code
 
Have a look at the source code: it's all to do with how you specify which time directory from the source case you want to map and where you want to put the results. If you use things like startTime or latestTime, it's easy to get confused...

Nothing wrong with the code as far as I know.

Enjoy,

Hrv

didomenico September 26, 2005 03:20

Hi Hrvoje, you were right,
 
Hi Hrvoje,
you were right, nothing wrong with the code. It was my fault: in the targetDir the controlDict had a false startTime (0.0091 instead 0.00091). I can only say that an error message (like "restart directory not found") could help me to find the problem http://www.cfd-online.com/OpenFOAM_D...part/happy.gif
Anyway, this was a good reason to compile OpenFoam in debug mode and look inside it...
Just a last question: each time I run blockMesh defaultFaces patch is created (with 0 faces) and this is a problem for mapFields (see the first message). How can I avoid it?
Thanks
Massimiliano

mattijs September 26, 2005 04:33

A zero sized patch defaultFace
 
A zero sized patch defaultFaces is kept if mergePatchPairs option is used.

There used to be a reason for this but I forgot why...

msrinath80 December 14, 2007 14:34

Hi all, I'm trying to do a
 
Hi all,

I'm trying to do a mapfields from one case to another. Only the mesh has been refined, so that geometry is essentially the same. Here is the excerpt from mapFields:

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4.1 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : mapFields . re65 . re65new -consistent
Date : Dec 10 2007
Time : 07:57:15
Host : moondance
PID : 6167
Root :
Case :
Nprocs : 1
Source: "." "re65"
Target: "." "re65new"

Create databases as time

Source time: 110
Target time: 110
Create meshes

Source mesh size: 3653328 Target mesh size: 29226624

It has been at this state for about 4 days now. Is this normal when working with such mesh sizes? The machine running mapFields has eight 2.8 GHz opteron processors with 128GB memory.

markc May 11, 2008 04:53

Hi Srinath, No, this is not n
 
Hi Srinath,
No, this is not normal.
Something else: I have the experience that using consistent on refined meshes is not always ok. Especially when there are curved areas near the boundaries the domain might have been changed, causing mapfields to fail on consistent. However switching it off and supplying a patch map list works perfect. Also if you interpolate to a case with different boundary conditions, the latter works.

Brgds
Mark

openfoam_user November 17, 2008 02:18

Hi all, I need to use the c
 
Hi all,

I need to use the command 'mapFields' between a coarse emsh and a medium mesh. I have used the 'rasInterFoam' solver until time t = 0.094 sec.

The case with the coarse mesh has run on 10 processors. The case with the medium mesh will run on 10 processors.

Could someone tell me the command to map the 'coarse' solution on the 'medium' grid. Thanks.

Regards,

Stephane.

zebu83 July 22, 2009 07:55

First of all you have to run "blockMesh", for the new mesh.

Then, probably, the command you are looking for is:

Quote:

mapFields ../"coarse mesh directory"/ -consistent (if the geometry is the same)
You have to modify also "controlDict", for example: in "starTime" you have to put the initial time step that you want "mapFields" start to map the new file. If your previous simulation stop at t = 10 s (for example) and you want to refine mesh and restart from it, you must change "starTime" in "controlDict" (change 0 in 10 or vice versa).
You have to specify also the reference case directory.

I hope it is useful!

MT

hz283 December 4, 2012 19:12

Hi All,

Can I ask you a question about the utility mapFields?

My question is as follows: I got the simulation results with structured meshes. Now I generated the unstructured meshes (totally the same geometry but on one wall a small inlet is newly generated). I list all other boundaries except that wall in patchMap list. All other procedures are followed by the friends posted in this forum. The mapped field file is generated, but the internal flow fields are completely wrong. This is not what I want.

Can I only map the internal flow field from structured to an unstructured meshes? Those boundary values are obtained through the boundary treatment as specified in the target case?

Thanks.

-hz

zebu83 December 5, 2012 07:58

Hi,

what do you mean with "the internal flow fields are completely wrong"?
Have you the possibility to run the new geometry?

Perhaps you can use mapField to have an initial (wrong) flow field, then run some coarse cases and then refined the mesh (untill you want or you have the capacity).

I hope it is useful, otherwise ask!

hz283 December 5, 2012 08:33

Hi Zebu83,

I am sorry, I did not express this clearly. In the source mesh, the flow field is fully developed. This is the reason why I would like to map this to my new unstructured meshes. I want to start based on this results. However, when I mapped the results to the target case, they are completely different. I tried the following several ways:

1, leave the patchMap and cuttingPatches lists blank
2, leave the cuttingPatches blank, and write some of the boundary in patchMap

The mapped results are always the one I mentioned above. In fact, I would like to only the internal fields, because the boundary values can be calculated directly according to the specification in the target case (unstructured meshes).

Thank you very much.

hz

vishwakarma September 22, 2014 03:14

Hi OpenFOAM users,

In regard to mapfields usage, it needs to be mentioned that the target fields files SHOULD NOT have the entry in the form of nonuniform list. If it is please make it uniform with a single value and let mapFields create the non uniform field based on source fields.

Thanks
Sandy


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