CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

mapField: the same mesh, with one more patch

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By lukasf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 9, 2012, 03:15
Default mapField: the same mesh, with one more patch
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
Dear All,

I am trying to use the mapField command in order to transfer the solution between 2 meshes that are identical.

There is only a difference: in the targetMesh I have added a patch.

How can I solve this?

Thanks a lot,

Samuele
samiam1000 is offline   Reply With Quote

Old   August 9, 2012, 06:24
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Samuele,

A quick solution might be to use createPatch on the first case. You can find examples by running:
Code:
find $FOAM_TUTORIALS -name createPatchDict
find $FOAM_UTILITIES -name createPatchDict
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 9, 2012, 06:31
Default
  #3
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
Hi Bruno and thanks for answering,

actually I thought about creating a patch.

The point is that in case one I have a patch called wall-part_3-solid and I split this patch in two patches for case two: wall-part_3-solid and wall_back.

The point is that I have already the solution for case one.

Is it possible to add a patch on a solved case? Or I should run again the simulation?
samiam1000 is offline   Reply With Quote

Old   August 9, 2012, 06:33
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by samiam1000 View Post
Is it possible to add a patch on a solved case? Or I should run again the simulation?
I honestly don't know and never tried it on a case that already has a solution... but I think it should work
If it doesn't, then it's possibly a bug or missing feature
__________________
wyldckat is offline   Reply With Quote

Old   August 10, 2012, 20:59
Default
  #5
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16
mgdenno is on a distinguished road
Have you tried using the mapFieldsDict instead of use the -consistent flag?
mgdenno is offline   Reply With Quote

Old   October 29, 2012, 05:36
Default
  #6
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
Dear all,

just one more question.

What can I do if - instead of adding a patch - I'd like to remove a patch?

This is the case: I study a steady solution of a room woth a door.

Suddenly, the door desappears. Hence, I have 2 identical mesh, without the patch ``door''.

I am looking for the removePatch feature. Does this exist?

Thanks a lot,
Samuele
samiam1000 is offline   Reply With Quote

Old   October 31, 2012, 13:29
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Samuele,

I believe you still have to use createPatch!

But still, you don't need to remove a patch. You can simply define that patch as a wall and set parameters/boundary conditions as if it were a wall!

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   January 8, 2014, 19:01
Default Did you find a solution to this problem?
  #8
Member
 
Ripudaman Manchanda
Join Date: May 2013
Posts: 55
Rep Power: 13
ripudaman is on a distinguished road
Samuele,

I have a problem very similar to yours. Were you able to find a solution to the problem you discuss in this thread?

Thank you.
Ripu

Quote:
Originally Posted by samiam1000 View Post
Dear All,

I am trying to use the mapField command in order to transfer the solution between 2 meshes that are identical.

There is only a difference: in the targetMesh I have added a patch.

How can I solve this?

Thanks a lot,

Samuele
ripudaman is offline   Reply With Quote

Old   September 16, 2022, 09:11
Default
  #9
Senior Member
 
Lukas Fischer
Join Date: May 2018
Location: Germany, Munich
Posts: 117
Rep Power: 8
lukasf is on a distinguished road
Use the mapFields command:

Code:
mapFields "pathToSourceCase" -mapMethod mapNearest -targetRegion region0 -sourceTime 'latestTime'
My example:

Source Case: Has a patch called: lowerWall
New Case: Here the patch "lowerWall" is split into: WALL1, WALL2 and lowerWall.

Content of mapFieldsDict.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      mapFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


// List of pairs of source/target patches for mapping
patchMap
(
inlet inlet
outlet outlet
upperWall upperWall
lowerWall WALL1
lowerWall WALL2
lowerWall lowerWall
frontAndBack frontAndBack
);

// List of target patches cutting the source domain (these need to be
// handled specially e.g. interpolated from internal values)
cuttingPatches
(
);
lukasf is offline   Reply With Quote

Old   January 19, 2023, 02:44
Default
  #10
Senior Member
 
Lukas Fischer
Join Date: May 2018
Location: Germany, Munich
Posts: 117
Rep Power: 8
lukasf is on a distinguished road
The target case needs a time directory with the correct (empty) fields (boundary conditions and patch-names) prepared.



This way the results from the source file can be interpolated onto the target case.

Quote:
Originally Posted by lukasf View Post
Use the mapFields command:

Code:
mapFields "pathToSourceCase" -mapMethod mapNearest -targetRegion region0 -sourceTime 'latestTime'
My example:

Source Case: Has a patch called: lowerWall
New Case: Here the patch "lowerWall" is split into: WALL1, WALL2 and lowerWall.

Content of mapFieldsDict.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      mapFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


// List of pairs of source/target patches for mapping
patchMap
(
inlet inlet
outlet outlet
upperWall upperWall
lowerWall WALL1
lowerWall WALL2
lowerWall lowerWall
frontAndBack frontAndBack
);

// List of target patches cutting the source domain (these need to be
// handled specially e.g. interpolated from internal values)
cuttingPatches
(
);
Giwrgos K likes this.
lukasf is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 08:54
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
Create a GeometricField of a given type on given patch? philippose OpenFOAM Programming & Development 4 August 12, 2013 12:41
3D Hybrid Mesh Errors DarrenC ANSYS Meshing & Geometry 11 August 5, 2013 06:42
chtMultiRegionFoam Tutorial m.nichols19 OpenFOAM 12 September 9, 2010 11:56


All times are GMT -4. The time now is 09:34.