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

mapFields with different number of patches

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By tomf
  • 1 Post By tomf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2023, 01:10
Default mapFields with different number of patches
  #1
New Member
 
Abhijit
Join Date: Aug 2020
Location: India
Posts: 28
Rep Power: 6
Redrakham is on a distinguished road
I want to solve vortex-induced vibration of a cylinder in a duct. I have solved the flow in a duct without the cylinder and then I want to map the fields from the cylinder-less problem to the problem with the cylinder in a duct. Both the geometries have same dimensions. But when I tried to map the fields the error comes:
--> FOAM FATAL ERROR:
Incompatible meshes: different number of patches, fromMesh = 6, toMesh = 7

I think the reason is with the cylinder case I have to add the cylinder patch. Is there anyway to map the fields with different number of patches?


I have attached the two meshes:
without_cylinder.jpeg with_cylinder.jpeg


Thank you in advance.
Redrakham is offline   Reply With Quote

Old   March 22, 2023, 04:56
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 646
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi Redrakham,

mapFields can be used in various situations. I think you could learn from the clipped cavity tutorial.

I think such a situation would apply for your case as well, where the cylinder patch would be part of the cuttingPatches in mapFieldsDict.

Hope this helps.
Tom
Redrakham likes this.
tomf is offline   Reply With Quote

Old   March 23, 2023, 06:49
Default
  #3
New Member
 
Abhijit
Join Date: Aug 2020
Location: India
Posts: 28
Rep Power: 6
Redrakham is on a distinguished road
I have tried this but got the same error.
Redrakham is offline   Reply With Quote

Old   March 23, 2023, 06:56
Default
  #4
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 646
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Well it would be helpful if you can share exactly what you typed, how your mapFieldsDict looks like and what the complete output says. Otherwise we can only guess what is going on.

Cheers,
Tom
tomf is offline   Reply With Quote

Old   March 23, 2023, 07:04
Default
  #5
New Member
 
Abhijit
Join Date: Aug 2020
Location: India
Posts: 28
Rep Power: 6
Redrakham is on a distinguished road
This is my mapFieldsDict:


FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object mapFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

patchMap ( );

cuttingPatches (cylinder1);


My patch name for cylinder is cylinder1.


This is the error I got:


Build : v1906 OPENFOAM=1906
Arch : "LSB;label=32;scalar=64"
Exec : mapFields -consistent -sourceTime latestTime ../without_cylinder1
Date : Mar 23 2023
Time : 15:10:01
Host : abhi
PID : 24097
I/O : uncollated
Case : /home/abhi/Turbulent/snappy_confined_2D/with_cylinder
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Source: "/home/abhi/Turbulent/snappy_confined_2D" "without_cylinder1"
Target: "/home/abhi/Turbulent/snappy_confined_2D" "with_cylinder"

Create databases as time

Source time: 600
Target time: 0
Create meshes

Source mesh size: 161280 Target mesh size: 385248



--> FOAM FATAL ERROR:
Incompatible meshes: different number of patches, fromMesh = 6, toMesh = 7

From function Foam::meshToMesh0::meshToMesh0(const Foam::fvMesh&, const Foam::fvMesh&)
in file meshToMesh0/meshToMesh0.C at line 134.

FOAM exiting


If you want I can share the whole case.
Redrakham is offline   Reply With Quote

Old   March 23, 2023, 07:57
Default
  #6
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 646
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

Thanks for the extra information. Your problem is the consistent option. That is only valid if your geometry and boundary conditions are exactly the same. But as you have the cylinder, the geometry is no longer exactly the same.

You may need to add all other patches to patchMap in you mapFieldsDict to copy the information on them from your empty domain case.

Best Regards,
Tom
Redrakham likes this.
tomf is offline   Reply With Quote

Old   April 4, 2023, 08:35
Default
  #7
New Member
 
Abhijit
Join Date: Aug 2020
Location: India
Posts: 28
Rep Power: 6
Redrakham is on a distinguished road
Thank you for your prompt reply. If I made the two geometries identical with one case having cylinder and the other have not then it is running all right. Now if I want to map the field of without cylinder case to the case of having cylinder with bigger geometry then it shows error:
--> FOAM FATAL IO ERROR:

size 385248 is not equal to the given value of 633468

file: /home/abhi/Turbulent/snappy_confined_2D/with_cylinder/0/nut

From function Foam::Field<Type>::Field(const Foam::word&, const Foam::dictionary&, Foam::label) [with Type = double; Foam::label = int]

in file /home/abhi/OpenFOAM-v1906/src/OpenFOAM/lnInclude/Field.C at line 221



My mapFieldsDict is Now:


fields (U);
patchMap ();



cuttingPatches (

cylinder1
top
bottom
front
back
inlet
outlet
);
Can you please help me with that.

Last edited by Redrakham; April 4, 2023 at 09:57. Reason: Grammatical error
Redrakham is offline   Reply With Quote

Old   April 4, 2023, 10:19
Default
  #8
New Member
 
Abhijit
Join Date: Aug 2020
Location: India
Posts: 28
Rep Power: 6
Redrakham is on a distinguished road
Here is my case files:
with_cylinder.zip
without_cylinder1.zip
Redrakham is offline   Reply With Quote

Reply


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
use the message in macro DEFINE_PROFILE with parallel processor alireza_T Fluent UDF and Scheme Programming 3 May 11, 2022 03:08
[Other] Can't Shake Erros: patch type 'patch' not constraint type 'empty' BrendaEM OpenFOAM Meshing & Mesh Conversion 12 April 3, 2022 19:32
[snappyHexMesh] snappyHexMesh stuck when snap is turned on yukuns OpenFOAM Meshing & Mesh Conversion 3 February 2, 2021 14:05
GenerateVolumeMesh Error - Surface Wrapper Self Interacting (?) AndreP STAR-CCM+ 10 August 2, 2018 08:48
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15


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