|
[Sponsors] |
November 6, 2010, 12:03 |
Issues with mapFields
|
#1 |
New Member
Austin French
Join Date: Aug 2010
Location: Adelaide, Australia
Posts: 1
Rep Power: 0 |
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 /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.1 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 1.7.1-320803922ee1 Exec : mapFields ../domain_1a Date : Nov 07 2010 Time : 01:30:07 Host : XXX-linux PID : 13179 Case : /home/xxx/OpenFOAM/xxx-1.7.1/run/domain_1b nProcs : 1 SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Source: ".." "domain_1a" Target: "/home/xxx/OpenFOAM/xxx-1.7.1/run" "domain_1b" Create databases as time Source time: 1000 Target time: 1000 Create meshes Source mesh size: 1130080 Target mesh size: 1824109 Mapping fields for time 1000 End Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.0 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object mapFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // patchMap ( inboard inboard outboard outboard inlet inlet outlet outlet bottomAndTop bottomAndTop hull_BL_A_O hull_BL_A_O ); cuttingPatches ( ); // ************************************************************************* // 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. |
|
January 13, 2011, 06:09 |
|
#2 |
Senior Member
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20 |
hi,
i am having the same problem. mapFields running without error but also without creating something. Did you found a solution? |
|
January 16, 2011, 14:12 |
|
#3 |
Member
|
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. |
|
February 12, 2011, 15:24 |
|
#4 |
Member
Mohammad.R.Shetab
Join Date: Jul 2010
Posts: 49
Rep Power: 16 |
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?!! |
|
April 12, 2011, 14:07 |
|
#5 |
New Member
Mark Beal
Join Date: Feb 2011
Posts: 24
Rep Power: 15 |
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 Exec : mapFields ../Coarse -sourceTime latestTime Date : Apr 12 2011 Time : 18:01:07 Host : msbealo-desk PID : 7678 Case : /home/msbealo/OpenFOAM/msbealo-1.7.1/run/Medium nProcs : 1 SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Source: ".." "Coarse" Target: "/home/msbealo/OpenFOAM/msbealo-1.7.1/run/" "Medium" Create databases as time Source time: 10 Target time: 10 Create meshes Source mesh size: 274765 Target mesh size: 495044 Mapping fields for time 10 End Code:
patchMap ( ); cuttingPatches ( ); Any help please? I know it's probably something pretty silly. Mark |
|
April 13, 2011, 09:14 |
|
#7 |
Member
Mohammad.R.Shetab
Join Date: Jul 2010
Posts: 49
Rep Power: 16 |
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 |
|
April 13, 2011, 09:58 |
|
#8 |
New Member
Mark Beal
Join Date: Feb 2011
Posts: 24
Rep Power: 15 |
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 |
|
June 10, 2011, 11:24 |
|
#9 |
New Member
Grim
Join Date: Mar 2011
Posts: 6
Rep Power: 15 |
Yes, it seems mapFields works (only) when the source time and target time are the same.
|
|
February 10, 2012, 12:18 |
|
#10 | |
Member
Join Date: Sep 2011
Posts: 45
Rep Power: 15 |
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 ? |
||
February 14, 2012, 09:22 |
|
#11 |
Member
Join Date: Sep 2011
Posts: 45
Rep Power: 15 |
No one found why mapFields outputs 0 values ?
|
|
February 14, 2012, 13:52 |
|
#12 |
New Member
Mark Beal
Join Date: Feb 2011
Posts: 24
Rep Power: 15 |
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 |
|
February 14, 2012, 15:58 |
|
#13 | |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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. |
||
February 14, 2012, 16:14 |
|
#14 | |
Member
Join Date: Sep 2011
Posts: 45
Rep Power: 15 |
Quote:
I'll try to post a picture. |
||
February 15, 2012, 10:20 |
|
#15 |
Member
Join Date: Sep 2011
Posts: 45
Rep Power: 15 |
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 ...) |
|
February 15, 2012, 15:22 |
|
#16 |
Member
Join Date: Sep 2011
Posts: 45
Rep Power: 15 |
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! |
|
May 24, 2013, 10:46 |
|
#17 |
Member
Ignacio
Join Date: Jan 2013
Posts: 33
Rep Power: 13 |
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 |
|
May 24, 2013, 11:57 |
|
#18 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Always I am using mapFields everything is working
Code:
mapFields -sourceTime latestTime -case ../coarseMeshSimulationName/ Works perfekt all the time. |
|
May 24, 2013, 14:27 |
|
#19 |
Member
Ignacio
Join Date: Jan 2013
Posts: 33
Rep Power: 13 |
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 |
|
April 10, 2014, 02:15 |
Plane normal defined with zero length
|
#20 |
Member
Ripudaman Manchanda
Join Date: May 2013
Posts: 55
Rep Power: 13 |
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' Starting program: /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/bin/mapFields ../frac1 -sourceTime 'latestTime' [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.3.x-e0d5f5a218ab Exec : /opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/bin/mapFields ../frac1 -sourceTime latestTime Date : Apr 10 2014 Time : 00:05:53 Host : "ubuntu" PID : 9303 Case : /home/ripuvm/OpenFOAM/ripuvm-2.3.x/multiFrac/cases/Consecutive1Well/frac2 nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Source: ".." "frac1" Target: "/home/ripuvm/OpenFOAM/ripuvm-2.3.x/multiFrac/cases/Consecutive1Well" "frac2" Create databases as time Case : ../frac1 nProcs : 1 Source time: 133 Target time: 54 Create meshes Source mesh size: 68670 Target mesh size: 83482 Creating and mapping fields for time 133 Creating mesh-to-mesh addressing for region0 and region0 regions using cellVolumeWeight --> FOAM FATAL ERROR: Plane normal defined with zero length Bad points:(15.24 -114.3 -22.86) (15.24 -106.68 -22.86) (15.24 -99.06 -22.86) From function void plane::calcPntAndVec ( const point&, const point&, const point& ) in file meshes/primitiveShapes/plane/plane.C at line 116. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::error::abort() in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 Foam::plane::calcPntAndVec(Foam::Vector<double> const&, Foam::Vector<double> const&, Foam::Vector<double> const&) in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #3 Foam::tetOverlapVolume::tetTetOverlapVol(Foam::tetPoints const&, Foam::tetPoints const&) const in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libmeshTools.so" #4 Foam::tetOverlapVolume::cellCellOverlapVolumeMinDecomp(Foam::primitiveMesh const&, int, Foam::primitiveMesh const&, int, Foam::treeBoundBox const&) const in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libmeshTools.so" #5 Foam::meshToMeshMethod::interVol(int, int) const in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libsampling.so" #6 Foam::cellVolumeWeightMethod::calculateAddressing(Foam::List<Foam::List<int> >&, Foam::List<Foam::List<double> >&, Foam::List<Foam::List<int> >&, Foam::List<Foam::List<double> >&, int, int, Foam::List<int> const&, Foam::List<bool>&, int&) in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libsampling.so" #7 Foam::cellVolumeWeightMethod::calculate(Foam::List<Foam::List<int> >&, Foam::List<Foam::List<double> >&, Foam::List<Foam::List<int> >&, Foam::List<Foam::List<double> >&) in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libsampling.so" #8 Foam::meshToMesh::calcAddressing(Foam::polyMesh const&, Foam::polyMesh const&) in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libsampling.so" #9 Foam::meshToMesh::calculate() in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libsampling.so" #10 Foam::meshToMesh::meshToMesh(Foam::polyMesh const&, Foam::polyMesh const&, Foam::meshToMesh::interpolationMethod const&, Foam::HashTable<Foam::word, Foam::word, Foam::string::hash> const&, Foam::List<Foam::word> const&) in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/lib/libsampling.so" #11 in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/bin/mapFields" #12 in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/bin/mapFields" #13 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #14 in "/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPOpt/bin/mapFields" Program received signal SIGABRT, Aborted. 0x00007ffff4260425 in raise () from /lib/x86_64-linux-gnu/libc.so.6 Thank you. Regards, Ripu |
|
Tags |
-consistent, mapfields, mapfieldsdict |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
FLUENT Speed Issues on Cluster | cfd23 | FLUENT | 2 | April 4, 2010 00:43 |
mapFields problems | andrea.pasquali | OpenFOAM | 1 | February 17, 2010 23:57 |
mapFields ignores sourceTime for -parallel source | andersking | OpenFOAM Bugs | 2 | September 2, 2009 11:38 |
mapFields between inconsistent meshes | nikwin | OpenFOAM Pre-Processing | 7 | July 30, 2009 05:35 |
MapFields to New Grid For Extreme Grid Deformations due to Body Motion | albcem | OpenFOAM | 0 | May 5, 2009 15:17 |