|
[Sponsors] |
How to Map Fields in openFOAM using the utility |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 5, 2016, 00:22 |
|
#21 |
New Member
Jade Chantrell
Join Date: Dec 2015
Location: Newcastle, Australia
Posts: 12
Rep Power: 11 |
Hi guys, I am trying to do something very similar to what you are trying to do. I will post what I have discovered so far relating to my problem and hopefully it can help yours. I am sick of mapFields problems - I just want to solve this!
So far I have:
The target mesh is thus 'finer' than the source file. I.e. it has more cells, points and faces. System architecture:
What I do:
*Note: heliostat is the STL file/object I have added into the farfield. Code:
patchMap ( inlet inlet outlet outlet sides sides top top ground ground ); cuttingPatches ( heliostat ); Code:
Source: "." "blah" Target: "/mnt/worimi/jade/Final_System" "simple_atm_smallerlayers_z0ofZero_withHeliostat" Create databases as time Source time: 3692 Target time: 3692 Create meshes Source mesh size: 2534400 Target mesh size: 2860432 Mapping fields for time 3692 End This method has worked for me when I leave mapFields blank, but of course, but only when I go from a fine to a coarse mesh. In this case, it mapped everything from Source to Target 3692 as nonuniform lists, to which I could add my extra BC for 'heliostat' at the end. (supplementary question: can I do this?) I have tried messing around with mapFields, by leaving out parts of cuttingPatches and patchMap, but it hasn't worked (I get the above output where it accepts the command but doesn't do anything). I WAS using 2.3x but if you get this error: Code:
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 ... then I have been led to believe this is a problem with mapFields in 2.3. OpenFoam 2.2 is supposed to work, but the creators have noticed this and have reverted back to 2.2 functionality in 3.0x. So I downloaded 3.0x and now in stead of getting this error with cuttingPatches it accepts it, but doesn't do anything. I feel like there is an issue with how it is reading the points or something - or the way the files are set up? If I have any development on the matter I will post, but at the moment I am quite stuck. Any help would be much appreciated by myself and, I'm guessing, MANY OF users. Kind regards, Jade |
|
February 5, 2016, 01:25 |
Wow found a possible solution:
|
#22 |
New Member
Jade Chantrell
Join Date: Dec 2015
Location: Newcastle, Australia
Posts: 12
Rep Power: 11 |
Back again!
Ok, so I managed to successfully mapFields with everying, including my cuttingPatch of heliostat, filled out above. What is also great, is that the cuttingPatch BC's are also mapped into the list of field numbers of the mapped solution files from source. Here's what I did:
The number of faces indicating that the coarse source mesh has been mapped onto the fine target mesh is also indicated at the top of these new files. I have to wait until Monday to run it. I will let you know how it goes. |
|
April 27, 2016, 03:19 |
|
#23 |
Member
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11 |
Hello everybody,
I found this thread while I was searching for mapping methods. In my case, I want to map a fully developed flow profile to a different inlet. Situation: Run a simulation of a tube (l=1m), sample at 0.9m and use this "cut" as inlet BC for a different case 2. Meshes are not the same... I tried meshFields, but I can only map an overlapping volume. Is there a way to map a cutting plane to the inlet of case 2? Thanks a lot for your info Regards |
|
June 24, 2016, 03:52 |
|
#25 | ||
Member
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11 |
Hey Elham.,
I managed it by sampling a fully developed flow from a pipe. Use "foamFile" as output in the sampleDict. Then you can have a look at incompressible/simpleFoam/pitzDailyExptinlet. In your constant directory, create a folder boundaryData and in this folder another one with the name of your inlet patch. Within this inlet-folder, your copy your points from sampleDict and a third folder "0" where you put your "U" file. make sure, that you add the OpenFoam header: Quote:
Quote:
Regards |
|||
June 24, 2016, 04:58 |
|
#26 |
Senior Member
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 17 |
Dear sisetrun,
Thanks for prompt reply. I have followed your instruction and sampled my inlet patch. Now I have points, U and P of inlet. But I don't know where should I assign BC for patch, since I have U and P ? Thanks. Elham |
|
June 24, 2016, 05:01 |
|
#27 |
Senior Member
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 17 |
And another question:
Should I execute mapFields now? |
|
June 24, 2016, 05:52 |
|
#28 |
Member
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11 |
Hey Alham,
there is no need for mapFields. Set the BC in your case/0 as shown above. In the constant/boundaryData/inlet/0/U is just the list of values for your points located in constant/boundaryData/inlet/points. This "plane" or " Circle" is taken as inlet BC for your geometry. For p it is a scalar and for U a vector... If you want to simulate a tube, just use U and set the p BC in case/0 to zeroGradient as usual. With this settings, you have a zeroGradient pressure at the inlet and for U you get the desired U profile |
|
June 27, 2016, 04:59 |
|
#29 |
Senior Member
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 17 |
Dear sisetrun,
Thanks. It took a day to manipulate and run the case succesfuly but you gave me the right points. Cheers, Elham |
|
July 4, 2016, 11:14 |
|
#30 |
New Member
Join Date: Jun 2016
Posts: 6
Rep Power: 10 |
Hello Sisetrun,
I have quite same problem with your case. I still not clear about how to map the inlet data onto another case. After creating the BoundaryData folder and setting inlet BC as timevaryingMappedFixedValue as you described in your case, what do I need to do in next step so that the inlet data can be mapped? Or is it already mapped and I can run the solvers directly? Looking forward to your reply. Thank you in advance. Best regards, Esther |
|
July 5, 2016, 02:42 |
|
#31 | |
Member
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11 |
Hey Esther,
the setup shut be fine...just run your case and with timevaryingMappedFixedValue as BC and the profile is mapped. Quote:
|
||
July 7, 2016, 05:42 |
|
#32 |
New Member
Join Date: Jun 2016
Posts: 6
Rep Power: 10 |
Dear Sisetrun,
According to the points you gave me I found out reason of the problem, now it works. Thank you for your help. cheers Esther |
|
August 14, 2016, 07:14 |
lagrangian mapField
|
#33 |
Member
amin jalalian
Join Date: Mar 2014
Posts: 34
Rep Power: 12 |
I want to separate some boundaries to some walls which had been merged into one wall.
They are some walls of a combustion chamber. particles come into chamber to combust. I mapField them by mapFieldDict, but O.F only maps lagrangian datas. What can I do? |
|
August 15, 2016, 05:44 |
|
#34 |
Member
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11 |
Hey amin_jalalian,
I do completely get your problem. Can you please add a picture or try to be more precise? |
|
August 18, 2016, 10:31 |
mapField Euler-Lagrange field with new wall.
|
#35 | |
Member
amin jalalian
Join Date: Mar 2014
Posts: 34
Rep Power: 12 |
Quote:
I want to mapField from previous results. What can I do now? When I adjust mapFieldsDict in target folder to this: Code:
patchMap ( ); cuttingPatches (other_walls); O.F only maps lagrangian results. Excuse because of poor english. |
||
August 19, 2016, 04:29 |
|
#36 |
Member
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11 |
Hey,
with mapFields, as far as I know, you can do the following things: -map fields from one case to a different case, so you can map the whole field from the old case to your new one. If the geometry is the same, use mapFields -consistant -map patches from old one to knew one by the name of each pactch -you can use transformPoints -translate to translate one of your meshes. Then you can map the overlapping part I have just maped U,p,k... fields. Though I do not have any experiences with lagrangian so far. |
|
August 19, 2016, 06:41 |
|
#37 | |
Member
amin jalalian
Join Date: Mar 2014
Posts: 34
Rep Power: 12 |
Quote:
Thanks What does "transformPoints -translate" command do briefly? |
||
August 19, 2016, 07:11 |
|
#38 |
Member
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11 |
use transformPoints -translate '(x y z)' in the terminal to translate the Mesh of your current working directory.
FYI: with surfaceTransformPoints -translate (or -scale) input.stl output.stl you can manipulate your stl geometry |
|
October 12, 2016, 19:24 |
|
#39 | |
Senior Member
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 14 |
Quote:
I am trying something similar and I tried the approach presented above but no luck till now. I have two geometries with different mesh size and one different patches. Attached the images of source and target geo. I am trying to use the mapFieldDict for the cases and following is the what mapFieldDict looks like. Code:
// List of pairs of source/target patches for mapping patchMap ( inlet inlet outlet outlet wall.ceiling wall.ceiling ); // List of target patches cutting the source domain (these need to be // handled specially e.g. interpolated from internal values) cuttingPatches ( wall.floor wall.human wall.hot wall.left emptyZ ); // ********************************************** // Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Source: "../source_case" "" Target: "/media/meisu/Storage/OpenFOAM/meisu-2.4.0/Project_SensorPlacement/Maptest" "target_case" Create databases as time Case : ../source_case nProcs : 1 Source time: 0 Target time: 0 Create meshes Source mesh size: 11140 Target mesh size: 9462 Creating and mapping fields for time 0 Creating mesh-to-mesh addressing for region0 and region0 regions using cellVolumeWeight Overlap volume: 2.635 Creating AMI between source patch outlet and target patch outlet using faceAreaWeightAMI AMI: Creating addressing and weights between 10 source faces and 12 target faces AMI: Patch source sum(weights) min/max/average = 1, 1, 1 AMI: Patch target sum(weights) min/max/average = 0.333333, 0.333333, 0.333333 Creating AMI between source patch inlet and target patch inlet using faceAreaWeightAMI AMI: Creating addressing and weights between 4 source faces and 5 target faces AMI: Patch source sum(weights) min/max/average = 1, 1, 1 AMI: Patch target sum(weights) min/max/average = 0.333333, 0.333333, 0.333333 Creating AMI between source patch wall.ceiling and target patch wall.ceiling using faceAreaWeightAMI AMI: Creating addressing and weights between 190 source faces and 166 target faces AMI: Patch source sum(weights) min/max/average = 1, 1, 1 AMI: Patch target sum(weights) min/max/average = 0.333333, 0.333333, 0.333333 interpolating U #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigSegv::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 ? at ??:? #4 ? at ??:? #5 ? at ??:? #6 ? at ??:? #7 ? at ??:? #8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #9 ? at ??:? Segmentation fault Is mapField capable of doing what I am trying to do.?? Thanks in advance. |
||
October 17, 2016, 12:42 |
|
#40 |
Member
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11 |
Hey,
sorry for the late reply, I have been on holiday ! I did not try such a geometry yet, but I think that the problem is in the bottom of your geometry. In the source, you have the gap in the x-axis. This gap is not present in the target. The gap also leads to different front and back geometries... Is it possible to map the inlet, outlet and the top? Cheers |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Map fields every time step | sebas | OpenFOAM Programming & Development | 17 | December 5, 2012 14:13 |
[Gmsh] 2D Mesh Generation Tutorial for GMSH | aeroslacker | OpenFOAM Meshing & Mesh Conversion | 12 | January 19, 2012 04:52 |
Matching Velocity and Pressure fields Fluent OpenFoam | alimansouri | OpenFOAM Running, Solving & CFD | 0 | January 13, 2009 18:51 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 19:07 |
The OpenFOAM extensions project | mbeaudoin | OpenFOAM | 16 | October 9, 2007 10:33 |