Issues with mapFields
Hi all.
I'm trying to use the mapFields utility to go from a coarser mesh to a finer one. I'm interested in refining the mesh around a body and have been using refinement regions in snappyHexMesh. The surface refinement on the body isn't changing at all, so the body meshes should be ~identical. After solving my coarser mesh to 1000 steps, I run the mapFields two different ways and get two different problems. Using -consistent, I get a target folder at the correct time in my new finer mesh. The interpolation has some issues but seemingly not near regions that are newly refined. Namely, I get small regions decreasing velocity to 0, which isn't ideal, but I think running the solution should get rid of them. The problem is I also get negative values of omega at those regions. This trips the bounding omega in the log file when I try to solve and the solver crashes. The error message has a lot about turbulence models and FPE's but I certainly don't find it particularly helpful. Using the mapFieldDict method, I get the following output. Code:
xxx@XXX-linux:~/OpenFOAM/xxx-1.7.1/run/domain_1b$ mapFields ../domain_1a Code:
/*--------------------------------*- C++ -*----------------------------------*\ So, I'm not entirely sure what to do. Obviously, not having to solve the whole 1.8mil mesh would be nice since its just a mesh refinement. I'm finding this problem is intermittent. Sometimes I am able to use -consistent and don't get the negative omega values. It varies with the mesh refinement that I am starting with and what I add to it. Which is all very frustrating. |
hi,
i am having the same problem. mapFields running without error but also without creating something. Did you found a solution? |
In my case it works executing:
mapFields directory_example/case_directory -sourceTime latestTime I left patchMap and cuttingPatches subDicts blank in the mapFieldsDict, but I created beforehand the temporal directory. Have a look at your time directory named "100" (latest time) because it should exist. Your simulation should reach the latest time to map the results and write it. If it is not created check the writing interval in controlDict. In my case the mesh size is the same but the geometry is different because it is a dynamic mesh problem. I have not tried with meshes of other sizes. |
Hi
Is it possible to map all the time directories of a case, to another one?! I mean map data from directories 0, 0.01, 0.02, 0.03, ..... of case 1 into directories 0, 0.01, 0.02, 0.03, ..... of case 2, all with one command?!! |
Did you ever solve this? I'm having exactly the same problem. If I use -consistent I get negative omega values and my solver gives up, if I use mapFieldsDict (with blank entries) I don't get an output.
I'm trying to map between a coarse and a medium mesh where the mesh density has only been changed by upping the values in blockMeshDict before running snappyHexMesh. I've tried: Code:
mapFields ../Coarse -consistent Code:
mapFields ../Coarse -sourceTime 10 Code:
mapFields ../Coarse -sourceTime 0 Code:
mapFields ../Coarse -sourceTime latestTime For each of the the cases I get a similar shell output of Code:
Build : 1.7.x-131caa989cd3 Code:
patchMap ( ); Any help please? I know it's probably something pretty silly. Mark |
maybe mapFields is not able to interpolate between meshes of different sizes. I'll try to figure it out.
|
Hi
I think you should make a temporary folder in the case and initial files of fields you want to map should be there. For example: if you want to map field omega from time 5 of coarse mesh to omega field from time 5 of fine mesh you should: 1- make a directory of time 5 in fine mesh case. 2- in that folder you should have a dictionary of omega that indicate boundary conditions ( the same as dictionary that you write in your 0 dictionary) 3-In your controlDict of case fine, change startTime to 5. 4- run the command "mapFields ../Coarse" It will map field omega from folder 5 of case coarse to folder 5 of case fine. Thats it! Mohammadreza |
Mohammadreza
Thanks! That seems to be working. I'm currently running something in the background so I can't test it fully but it does run using your suggestions. Regards, Mark |
Yes, it seems mapFields works (only) when the source time and target time are the same.
|
Quote:
I have exactly the same issue, I have many regions where mapFields attributes 0 values which is really bad... I guess it's a question of interpolation, but did anybody find a solution ? |
No one found why mapFields outputs 0 values ?
|
ic3wall,
For me, I followed Mohammadreza advise (above) and it works fine. I guess the obvious question is are you mapping the right time directory from the source to the target? You're not mapping the '0' folder? Make sure your target controlDict has the startTime of the last time of the source case. So, if you ran the first simulation to 10 seconds and then want to map this to the next case, copy the '0' time to '10' (to set up the right files), change the startTime to 10 in the target case and run mapFields. Post the output of mapFields if you still get something strange. Mark |
Quote:
I've experienced stability issues when refining meshes and wrote a utility to deal with it. The basic algorithm is: 1) Create a field with uniform value 1 in the mesh you want map FROM, call it "mark" or something 2) Create a field with uniform value -1 in the mesh you want to map TO, with the same name ("mark" in this general example) 3) Do your mapping inconsistently, and now 4) Now run through the the new "mark field", and whenever you find a cell (I restricted myself to cells) that has mark == -1, you should replace all field values (U, T, etc) for that cell with interpolations from valid nearby cells (those whose value of "mark" is 1) How you do the interpolation is up to you. Because the differences in geometry are so small in our case, we just directly copied valid field values. If the differences are larger you should do some kind of weighted interpolation. |
Quote:
I'll try to post a picture. |
2 Attachment(s)
Here it goes, the first picture is the large field and the second one is the result of the mapping on the smaller one. The yellow rectangle in the first picture shows the smaller domain on which I'm mapping.
As you can see on the second picture, there are several zero values scattered everywhere. Here's a part of the nonuniform List output that corresponds to the mapped field: 25921 ( 0.5 0.5 0.25 0 0 0.5 0 0.5 0 0 0 0.5 0.5 0 0.5 0.5 0.5 0.25 0 0.5 0.5 0.5 0 0 0.39767 0 0 0.0518247 0.00227012 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.137366 0.248451 0 0 0.488571 ...) |
Problem found!
I was using mapFieldsDict incorrectly, both patches I wanted to map are coincident, so they had to be included in PatchMap(...). CuttingPatches had to be empty. Basically I was mapping internal fields onto a surface ... which is not I what I wanted. Thank you for your help! |
Hello all,
I will use this thread to ask another issue with mapFields. I am using the results from a URANS simulation as initial values for LES. I use mapFields utility for this. Consisten flag on as the geometry and boundary conditions are the same. 1) If I use mapFields with ---> source: Coarse mesh, target: Fine mesh I get he values that make no sense (Zero pressure, negative k and omega, 1000 velocity...) 2) If I use mapFields with ---> source: Fine mesh, target: Coarse mesh. Then it works fine! Can anybody explain me why?? Is is a bug? I need to use the data from the URANS simulation for LES. Is there any other way I can do it without using mapFields? Thanks a lot =) Any idea / comment will be more than welcome |
Always I am using mapFields everything is working
Code:
Works perfekt all the time. |
1 Attachment(s)
Happy to know that it works perfectly for you.
But mine is just so crap at some cells as you can see on the pic |
Plane normal defined with zero length
Hi all,
I am having some problem in using the mapFields utility. When I map from coarse to fine mesh the utility works fine and gives me a clean result. However on trying to go from one level of refinement (region refinement using SHM) in one mesh to another level of refinement (refinement close to an imported STL file in SHM) in another mesh mapfields creates problems Here is when I face the problem:- I refine a region of my mesh and run my solver. Next I create a different coarse mesh with an STL file in the region of the previous refinement (using shm) and try mapping the results from the latest time of my refined mesh to the coarse mesh. This gives me the following error. I have posted the gdb output here. Please note that the points mentioned in the error output are not near the new STL file. Code:
(gdb) r ../frac1 -sourceTime 'latestTime' Thank you. Regards, Ripu |
All times are GMT -4. The time now is 03:22. |