CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to Map Fields in openFOAM using the utility (https://www.cfd-online.com/Forums/openfoam-solving/119231-how-map-fields-openfoam-using-utility.html)

Alhasan June 12, 2013 11:14

How to Map Fields in openFOAM using the utility
 
Hey All,

How to use mapping fields function in openFOAM,:(

-say there are two different case two boxes, one big box and one small box with inlet on one side and outlet on the other side and all the other sides are walls. the small box is within the big box and it is in the right place in space.

-how do i even go about this i read the manual dint do much help :confused:

-share any cases if u have mapped between them please :)

-usually i experiment with things play around with it, but right now i dont have time for that

- so please help me, by explaining how to do it, is there any tutorial cases that has been mapped between them..?

Regards,
Hasan K.J.

immortality June 14, 2013 08:26

Hi
could you attach an image of your case?are there two different cases or both boxes in one case?

Alhasan June 14, 2013 09:25

Two different Cases.
 
They are two different cases !!
the big box and the small box !!!!

i want the velocity fields from the big box to be mapped to the small one !!!

immortality June 14, 2013 10:21

in the doc/guide file there explained a not consistent mapFields for cavity case.
Read it.ask if had any problem.

Alhasan June 14, 2013 10:35

Hey Ehsan,
i am aware of this and i have read it, dint help me much is there any tutorial which has mapped the cases in openFOAM

- just want an example of the mapFieldDict with two cases so i can see whats happenign and understand or just mapFieldsDict would do

Thanks,
Hasan K.J.

zhengzh5 June 14, 2013 12:30

Quote:

Originally Posted by Alhasan (Post 434028)
Hey Ehsan,
i am aware of this and i have read it, dint help me much is there any tutorial which has mapped the cases in openFOAM

- just want an example of the mapFieldDict with two cases so i can see whats happenign and understand or just mapFieldsDict would do

Thanks,
Hasan K.J.

Hey, for non-consistent mapping, you can do the following in your mapFieldDict:

//matching pair of source and target patches
patchMap
(
patch1_source patch1_target
patch2_source patch2_target
...
);

//list of target patches
cuttingPatches
(
patch1
patch2
...
);

whereas patchMap requires that the source and target patches be collocated. and cuttingPatches is when the target patch is within the domain of the source.

so in your case, since you're mapping from big box to small box, and that the small box is completely within the big box. your patchMap will be empty, and your cuttingPatches will list all the patches from your small box, such that:

patchMap
(
);

cuttingPatches
(
left_side
right_side
top
bottom
front
back
);

give that a try. Oh and don't forget to have the usual OpenFOAM header in the mapFieldsDict

Alhasan June 14, 2013 17:52

Query
 
Hey Guys,

thanks Jace

Thats nice, so in my cutting patches do i need only to mention the inlet ? coz i want only the inlet to be patched, or do i still need to mention all the patches :)

- another main doubt is see there are two case folders big box small box, i keep my mappingFieldsDict in my target cases (small box) System folder ?

- so when i am in my target case folder i execute the command mapFields

- how does that openFOAM know where to map the fields from ?

- i know for a fact i am doing something drastically wrong here what is it :eek:

Thanks :)
Best Regards,
Hasan K.J

zhengzh5 June 14, 2013 18:06

Quote:

Originally Posted by Alhasan (Post 434066)
Hey Guys,

thanks Jace

Thats nice, so in my cutting patches do i need only to mention the inlet ? coz i want only the inlet to be patched, or do i still need to mention all the patches :)

- another main doubt is see there are two case folders big box small box, i keep my mappingFieldsDict in my target cases (small box) System folder ?

- so when i am in my target case folder i execute the command mapFields

- how does that openFOAM know where to map the fields from ?

- i know for a fact i am doing something drastically wrong here what is it :eek:

Thanks :)
Best Regards,
Hasan K.J

Hi Hasan,

1. within cuttingPatches, you only include the patches that you want to be mapped from the big box case (in your case, yes the inlet). remember you still need to assign boundary conditions for other patches separately if you don't want to map them from the bigBox case.

2. to use mapFields utility, first make sure you have the mesh created for the small box. then create a time directory, say 0 (assuming your simulation will start at time 0). create a separate folder, and call it bigBox (or whatever you want) and put the time directory from the big box case inside the newly created bigBox directory, (call the time directory 0, to match the small box initial time name). then simply call "mapFields bigBox/", where the argument for the mapFields utility is the path of the bigBox information.

I hope that makes sense, let me know =)

good luck!

Alhasan June 14, 2013 18:22

Quote:

Originally Posted by zhengzh5 (Post 434067)
Hi Hasan,

1. within cuttingPatches, you only include the patches that you want to be mapped from the big box case (in your case, yes the inlet). remember you still need to assign boundary conditions for other patches separately if you don't want to map them from the bigBox case.

2. to use mapFields utility, first make sure you have the mesh created for the small box. then create a time directory, say 0 (assuming your simulation will start at time 0). create a separate folder, and call it bigBox (or whatever you want) and put the time directory from the big box case inside the newly created bigBox directory, (call the time directory 0, to match the small box initial time name). then simply call "mapFields bigBox/", where the argument for the mapFields utility is the path of the bigBox information.

I hope that makes sense, let me know =)

good luck!

Ahh,, im sorry i just got too confused now, i have two cases bigbox and smallpox both of the are two different folders

-say the big box has 0,1000(timefolder) constant and systems folder only in it. (case has been run)

- say the small box has 0,constant, systems folder in it and i have the mappingFieldsDict within the systems folder and mesh created.

- say now i just create a folder lets call it MapData within the smallbox case folder and i copy the time directory from the big box (1000) into the MapData folder

- then i rename the file 1000 to 0 since 0 is my start time

- then i run the command mapFields MapData

am i right or am missing something in-between, just say Yes or No .. thanks :)

Thanks for your time Jace :)

Hasan K.J :)

zhengzh5 June 14, 2013 18:36

Quote:

Originally Posted by Alhasan (Post 434069)
Ahh,, im sorry i just got too confused now, i have two cases bigbox and smallpox both of the are two different folders

-say the big box has 0,1000(timefolder) constant and systems folder only in it. (case has been run)

- say the small box has 0,constant, systems folder in it and i have the mappingFieldsDict within the systems folder and mesh created.

- say now i just create a folder lets call it MapData within the smallbox case folder and i copy the time directory from the big box (1000) into the MapData folder

- then i rename the file 1000 to 0 since 0 is my start time

- then i run the command mapFields MapData

am i right or am missing something in-between, just say Yes or No .. thanks :)

Thanks for your time Jace :)

Hasan K.J :)

that should do!

Alhasan October 23, 2013 17:13

Hi pp,

It worked only when i did it like this

Source: "/panfs/storage/s199038" "TestWT1"
Target: "/panfs/storage/s199038" "Windtunnel3"

it wants the entire case to be present coz it asks for System folder to look at the control dict for some reason

all the best,
Hasan K.J

Alhasan November 5, 2013 15:59

Hi Jace,

Boundary conditions for mapped fields how do i have boundary conditions for patches that lie on the cutting plane of the Target case. ( the stream wise patches that lie right on the middle of the flow )

- even if i give free stream it asks for this value ? and the value is not consistent so what do i give

Kind Regards,
Hasan K.J

Alhasan December 5, 2013 17:34

Hi Jace,
For initial conditions when you are Mapping data what boundary conditions are preferable to keep the flow as close to the source case ?

For instance i was using Mapping Fields from a wind tunnel setup with a good moderate mesh to a smaller very fine mesh around the airfoil - I used Fixed Value for the inlet and Top and bottom of the airfoil domain - but the results vary a Lot !

Any suggestion on the boundary conditions ! ! to have Exact same flow field within in the smaller domain that maps from the larger domain.
Kind Regards,
Hasan K.J

wyldckat December 8, 2013 08:50

Greetings to all!

@Hasan: You might not be aware of this, but the problem you seem to be having is very likely a lot more complex than the brief explanation you've given.

Please start a new thread and explain in detail the case you're performing, as well as showing some images of what you're seeing with problems. I ask this because I'm guessing that there are at least 3 problems in your case, which are not necessarily related to mapFields:
  1. The refined mesh might be incorrect for your case, since it might be introducing problems in locations you're not expecting.
  2. The solvers used, their configuration and turbulence models.
  3. The boundary conditions used.
Best regards,
Bruno

(edit: Hasan posted the new question here: http://www.cfd-online.com/Forums/ope...tml#post465387 )

ripudaman January 8, 2014 18:59

Empty Time Folder
 
Hasan,

I tried following all the steps you discussed above to do something similar maybe even something simpler. The problem I am facing is that after mapping the fields my time directory in the target folder remains empty. Did you face this problem? How did you fix it? I give more details of my problem set-up below :-

I use solidDisplacementFoam to create a circular fracture in the middle of a grid using snappyHexMesh. I simulate the opening of the fracture by using a constant stress on the two separated faces of the fracture ff1 and ff1_slave (faces separated using SHM). This fracture causes changes in the sigma and D fields around it in the remaining grid.

Now I want to create another fracture at a certain distance away from this created fracture but I want to create this fracture in the displaced field of the first fracture. So the converged solution of the first fracture needs to be mapped on to a new grid that has a second fracture in it. So I create a second case file where I have the same blockMesh but two fractures in the grid instead of 1. I again use SHM to create this initial configuration. Next I create an empty time directory in the case folder of the second fracture. The folder name is 100 which is the name of the 'latestTime' folder of the first fracture. The controlDict file of the second fracture reflects a startTime of 100. I believe this is very similar to the initial configuration that you obtain. The mapFieldsDict file has the existing patches from the first fracture in patchMap section and the new patches for the second fracture - ff2 and ff2_slave in the cuttingPatch section.

next I run the following command from the second fracture case directory (frac2)

mapFields ../frac1

and I get the following output

Code:

Case  : ./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: "." "frac2"

Create databases as time

Source time: 100
Target time: 100
Create meshes

Source mesh size: 64145    Target mesh size: 65006


Mapping fields for time 100


End


At the end of it when I look at the time folder of the second fracture I find it empty. This suggests that the mapping has not been done. Am I right?

Please do respond and share your experience.

Thank you.
Ripu
Quote:

Originally Posted by Alhasan (Post 458629)
Hi pp,

It worked only when i did it like this

Source: "/panfs/storage/s199038" "TestWT1"
Target: "/panfs/storage/s199038" "Windtunnel3"

it wants the entire case to be present coz it asks for System folder to look at the control dict for some reason

all the best,
Hasan K.J


Alhasan January 8, 2014 21:06

Hey Ripudaman,

let me begin with I did not understand you case setup -

- but I kinda know the possible mistakes that could be causing your problem

- you have to Make sure very important that both the cases exist in their correct ordinates like geometrically (x,y,z)

- you need to have a file in your time directory with the boundary conditions like for CFD we have U and p files before you begin mapping, NOTE: it will map the fields only the files that you put here for eg. i would want to map only velocity so i will put only U file when I am mapping.

- it does not show it mapping any files in your Map histroy you have provided so you might be having a empty time folder when you are mapping in your target directory

- and i hope you have the patches that has to be mapped in the MapFields Dict if the same patch exist on both cases you can use the patchMap function

Code:

//matching pair of source and target patches
patchMap
(
patch1_source patch1_target
patch2_source patch2_target
...
);

If it does not Exist the the make sure the bot cases merge geometrically and you can use
Code:

cuttingPatches
(
Patch1
Patch2
);

Best Regards,
Hasan K.J

hiuluom June 30, 2015 23:33

The command mapFields import U,T,P into target fields. If I only import T into target, can mapFields do that?

Alhasan July 1, 2015 03:27

Hi,
I'm definitely sure you can only import the required field. Like T or just U. Even If it imports all feilds by default you can delete the unnecessary fields and put your own BC
Regards,
Hasan K.J

hiuluom July 1, 2015 11:34

Thank you Hasan.

I am using OF 2.1.0, so it doesn't have option -fields(T) as OF height version. It imports list scalar much more value. I think that it is not good if I delete by hand these value.

Alhasan July 1, 2015 11:38

Hey Huy,

Can you please explain what you are trying to do. So it will be easier for us to help you.

If you want to map only one field have only that field in the time step that you are trying to map.

are you mapping the entire domain or just a patch or what type of setup please explain to us clearly so we will be able to help you.

Regards,
Hasan K.J

Chanterz February 4, 2016 23:22

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:
  • A target mesh that has an STL file meshed with SHM
  • A source mesh that is the same but without the meshed STL file inside

The target mesh is thus 'finer' than the source file. I.e. it has more cells, points and faces.

System architecture:
  • I have a 0,constant,system, 3962 folder (left empty), and 'blah' folder... these are ALL inside my target folder
  • 'blah' folder has a 0,constant and system folder of a pre-solved case of 3692. This is my 'source' case.
  • controlDict in target directory has been changed with a startTime of 3692
The Source and Target cases have the same boundary conditions apart from my desired cutting patch of 'heliostat', which is my meshed STL file.



What I do:
  • blockMesh and SHM the target case (see other threads about how to do this)
  • call <mapFields blah -sourceTime latestTime>
This is my mapFields:
*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
);

And this is the output:


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

When I check 3692 folder in target directory there is nothing there.


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
(taken from ripudaman in this thread: http://www.cfd-online.com/Forums/openfoam-pre-processing/81780-issues-mapfields.html)



... 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

Chanterz February 5, 2016 00:25

Wow found a possible solution:
 
3 Attachment(s)
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:

  • copied the 0 files from target case (of the boundary conditions I want of the patches INCLUDING heliostat boundary) into the-previously-blank 3692 file (where the source files 'were' to be uploaded).
  • When I employ mapFields as above, it seems that the mapFields function overwrites the target boundary files and fills it with the list of numbers that have matching boundary conditions between the target and source cases (outlined in patchMap) and leaves the 'heliostat' cutting patch alone.

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.

sisetrun April 27, 2016 02:19

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

Elham June 24, 2016 02:40

Dear sisetrun,

Could you find any solution for this problem? Please let me know since I have the same issue.

Thanks.

Elham

sisetrun June 24, 2016 02:52

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:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class vectorField; (points) // vectorAverageField for U
object points; or values for U
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
As BC for your patch, use
Quote:

inlet
{
type timeVaryingMappedFixedValue;
offset (0 0 0);
setAverage off;
}
offset is a dummy here, the actual data is taken from your "U" file in the constant/boundaryData... folder.

Regards

Elham June 24, 2016 03:58

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

Elham June 24, 2016 04:01

And another question:

Should I execute mapFields now?

sisetrun June 24, 2016 04:52

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

Elham June 27, 2016 03:59

Dear sisetrun,

Thanks. It took a day to manipulate and run the case succesfuly but you gave me the right points.

Cheers,

Elham

Esther Jin July 4, 2016 10:14

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

sisetrun July 5, 2016 01:42

Hey Esther,

the setup shut be fine...just run your case and with timevaryingMappedFixedValue as BC and the profile is mapped.

Quote:

This boundary conditions interpolates the values from a set of supplied points in space and
time. Supplied data should be specifi ed in constant/boundaryData/ < patchname > where:
- points : pointField with locations
- ddd : supplied values at time ddd
The points should be more or less on a plane since they get triangulated in 2-D.
Best regards

Esther Jin July 7, 2016 04:42

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

amin_jalalian August 14, 2016 06:14

lagrangian mapField
 
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?

sisetrun August 15, 2016 04:44

Hey amin_jalalian,
I do completely get your problem.
Can you please add a picture or try to be more precise?

amin_jalalian August 18, 2016 09:31

mapField Euler-Lagrange field with new wall.
 
2 Attachment(s)
Quote:

Originally Posted by sisetrun (Post 614048)
Hey amin_jalalian,
I do completely get your problem.
Can you please add a picture or try to be more precise?

I draw one quarter of IFRF No.1 combustion chamber and mesh in gambit. Pic has been attached. I put all walls in one boundary by name "walls". After some weeks I dedicate that separate inlet and outlet pipes walls and front and back walls from that boundary which now has top and side walls. Because it is better to put them adiabatic instead of fixed temperature. I named it "other_walls". Thus I have to wall boundary one "walls" which has top and side walls, the other "other_walls" which has inlet & outlet pipes walls and front & back walls.
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.

sisetrun August 19, 2016 03:29

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.

amin_jalalian August 19, 2016 05:41

Quote:

Originally Posted by sisetrun (Post 614644)
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.


Thanks
What does "transformPoints -translate" command do briefly?

sisetrun August 19, 2016 06: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

himanshu28 October 12, 2016 18:24

1 Attachment(s)
Quote:

Originally Posted by Chanterz (Post 583791)
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:

  • copied the 0 files from target case (of the boundary conditions I want of the patches INCLUDING heliostat boundary) into the-previously-blank 3692 file (where the source files 'were' to be uploaded).
  • When I employ mapFields as above, it seems that the mapFields function overwrites the target boundary files and fills it with the list of numbers that have matching boundary conditions between the target and source cases (outlined in patchMap) and leaves the 'heliostat' cutting patch alone.

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.

Hi All,

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
);

// ********************************************** //

After running mapFields I am getting a following error.

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

I don't know what could be the reason for this.
Is mapField capable of doing what I am trying to do.??

Thanks in advance.

sisetrun October 17, 2016 11:42

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


All times are GMT -4. The time now is 00:29.