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

[cfMesh] and Multi Region Meshing

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

Like Tree13Likes
  • 9 Post By starykov
  • 3 Post By starykov
  • 1 Post By starykov

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2015, 06:19
Default and Multi Region Meshing
  #1
Member
 
amine
Join Date: Jan 2014
Location: FRANCE
Posts: 84
Rep Power: 12
aminem is on a distinguished road
Hi,

Can I use cfMesh for Multi Region Meshing like snappyHexMesh?

Thanks
aminem is offline   Reply With Quote

Old   July 10, 2015, 07:45
Default
  #2
New Member
 
Oleksiy Starykov
Join Date: Apr 2012
Posts: 4
Rep Power: 13
starykov is on a distinguished road
You can.
Please find a sample case in attachment, the Allrun-file shows you the way to make the multi-region mesh.
Attached Files
File Type: zip tubeStl.zip (52.8 KB, 680 views)
starykov is offline   Reply With Quote

Old   June 5, 2017, 16:37
Default
  #3
New Member
 
Anonymous
Join Date: Mar 2017
Posts: 3
Rep Power: 9
thegame24 is on a distinguished road
Quote:
Originally Posted by starykov View Post
You can.
Please find a sample case in attachment, the Allrun-file shows you the way to make the multi-region mesh.
Hi.

I think the file attached has different patches, as in, different walls are defined. What should I do to define separate regions (volumes) in the mesh.

I am a beginner here, so please correct me if I'm wrong.
thegame24 is offline   Reply With Quote

Old   June 6, 2017, 03:39
Default
  #4
New Member
 
Oleksiy Starykov
Join Date: Apr 2012
Posts: 4
Rep Power: 13
starykov is on a distinguished road
Hi,

the multi-regions meshing algorithm is self-explained in Allrun-script, but I can explain it to you.

First you need to create mesh for each region. Since cfmesh has no direct possibility for doing this, you can create two cases and generate mesh for each of them (with custom meshDict-settings):
Code:
 
cartesianMesh -case cases/pipewall
cartesianMesh -case cases/pipe
Afterwards you need to copy generated meshes to the constant/polyMesh directory in order to use them as region meshes:
Code:
 
cp -r cases/pipe/constant/polyMesh/ constant/pipe
cp -r cases/pipewall/constant/polyMesh/ constant/pipewall
Now you need to correctly adress the field mappings etc. This is done via changeDictionary tool, using the system/changeDictionaryDict for each region. In system/pipe/changeDictionaryDict you have:
Code:
 
dictionaryReplacement
{
boundary
   {
   pipe_to_pipewall
     {
      type mappedWall;
      sampleMode nearestPatchFace;
      sampleRegion pipewall;
      samplePatch pipewall_to_pipe;
      }

    }
 
}
That means that in the file constant/polyMesh/pipe/boundary the entry pipe_to_pipewall will be modified with these settings. You define this boundary as mapped on the neighboring region that has name pipewall, and the neighboring patch has name pipewall_to_pipe.
You need to create such mappings for all inter-region boundaries in your system.

Of course you need to properly set the heat transfer conditions at the boundaries, usually via changeDictionaryDict files.
spitchers, rando_foamer and requou like this.
starykov is offline   Reply With Quote

Old   June 6, 2017, 03:44
Default
  #5
New Member
 
Anonymous
Join Date: Mar 2017
Posts: 3
Rep Power: 9
thegame24 is on a distinguished road
Thanks. You saved me.
thegame24 is offline   Reply With Quote

Old   June 6, 2018, 10:26
Default
  #6
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!

I think you should use nearestPatchFaceAMI, since your mesh at the interface is not conform.
simrego is offline   Reply With Quote

Old   June 7, 2018, 02:39
Default
  #7
New Member
 
Oleksiy Starykov
Join Date: Apr 2012
Posts: 4
Rep Power: 13
starykov is on a distinguished road
Yes, you are right.
starykov is offline   Reply With Quote

Old   March 7, 2019, 08:01
Default
  #8
New Member
 
Bastian Heitkötter
Join Date: Mar 2018
Posts: 3
Rep Power: 8
Bastian@MM is on a distinguished road
Hi starykov,


I have a question about MultiRegion-Meshing with cfMesh. I have a case with 6 region andbe able to mesh them. But to run chtMultiRegionSimpleFoam I need the cellToRegion file in 0. How did you create it?
Bastian@MM is offline   Reply With Quote

Old   December 23, 2020, 10:19
Default it doesn't work
  #9
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
Hello,

I try to mesh multiregions, I found this topic and I try the case attached by starykov. When I do the Allrun command it complains with

HTML Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
/*   Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt   *\
|  Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com   |
\*---------------------------------------------------------------------------*/
Build  : 5.x-963176928289
Exec   : C:/PROGRA~1/BLUECF~1/OpenFOAM-5.x/platforms/mingw_w64GccDPInt32Opt/bin/changeDictionary.exe -region pipe
Date   : Dec 23 2020
Time   : 15:04:35
Host   : "PC_JULIEN"
PID    : 9648
I/O    : uncollated
Case   : C:/PROGRA~1/BLUECF~1/OFUSER~1/run/CFMESH~1/forum/tubeStl
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh pipe for time = 0

Read dictionary changeDictionaryDict with replacements for dictionaries 1(dictionaryReplacement)
Reading polyMesh/boundary file to extract patch names
Loaded dictionary boundary with entries
3
(
minY
maxY
pipe_to_pipewall
)

Replacing entries in dictionary dictionaryReplacement
Loading dictionary dictionaryReplacement


--> FOAM FATAL ERROR:
cannot find file "C:/PROGRA~1/BLUECF~1/OFUSER~1/run/CFMESH~1/forum/tubeStl/0/pipe/dictionaryReplacement"

    From function virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::uncollatedFileOperation::readStream(Foam::regIOobject&, const Foam::fileName&, const Foam::word&, bool) const
    in file global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C at line 522.

FOAM exiting
It is a problem with changeDictionnaryDict file I think but I don't know how to resolve this. I see also that there is no directory constant/polyMesh created. Maybe the problem comes from to this.

I work with bluecorecfd on windows 10.

Best regards
julieng is offline   Reply With Quote

Old   December 23, 2020, 16:15
Default
  #10
New Member
 
Oleksiy Starykov
Join Date: Apr 2012
Posts: 4
Rep Power: 13
starykov is on a distinguished road
Hello,

for this particular problem you have to remove that dictionaryReplacement with
{} parentheses in the dict file. The file format changed in the meantime.

But there are other changes, you have to adjust your files. Look at the heater-tutorials in the heatTransfer directory and update them accordingly.

Quote:
Originally Posted by julieng View Post
Hello,
YatengQ likes this.
starykov is offline   Reply With Quote

Old   March 6, 2022, 08:49
Default Error with tubeStl case
  #11
New Member
 
Aditya
Join Date: Jun 2021
Posts: 2
Rep Power: 0
Adibantwal is on a distinguished road
Hi, after running Allrun with your case, it gives this error:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _f3950763fe-20191219 OPENFOAM=1912
Arch   : "LSB;label=32;scalar=64"
Exec   : changeDictionary -region pipewall
Date   : Mar 06 2022
Time   : 18:17:54
Host   : LAPTOP-TT50BSP8
PID    : 21018
I/O    : uncollated
Case   : /mnt/c/Users/Aditya/Desktop/learrn/tubeStl/tubeStl
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

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh pipewall for time = 0

Read dictionary changeDictionaryDict with replacements for dictionaries 1(dictionaryReplacement)
Reading polyMesh/boundary file to extract patch names
Loaded dictionary boundary with entries 4(minY maxY wall pipewall_to_pipe)
Replacing entries in dictionary dictionaryReplacement
Loading dictionary dictionaryReplacement
--> FOAM Warning :
    From function int main(int, char**)
    in file changeDictionary.C at line 709
    Requested field to change dictionaryReplacement does not exist in "/mnt/c/Users/Aditya/Desktop/learrn/tubeStl/tubeStl/0/pipewall"

End
Adibantwal is offline   Reply With Quote

Old   July 26, 2022, 03:50
Default
  #12
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
Quote:
Originally Posted by starykov View Post
Yes, you are right.
Hi starykov

Though we apply nearestPatchFaceAMI in sampleMode (fields will be mapped in those two different regions in the process of simulation), the generated mesh in Paraview is still not conform, is there a way of creating a conformal mesh in this case in cfmesh?

Looking forward to hearing from you.

Best Regards,

Kit
itsme_kit 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] New multi region meshing tutorial with sHM Tobi OpenFOAM Meshing & Mesh Conversion 0 November 24, 2014 18:42
[snappyHexMesh] Multi Region Meshing bruce OpenFOAM Meshing & Mesh Conversion 12 July 31, 2013 11:09
[snappyHexMesh] Multi region meshing & recovering the original patch names fluidpath OpenFOAM Meshing & Mesh Conversion 4 May 19, 2013 20:13
[snappyHexMesh] Multi Region Meshing with sHM marango OpenFOAM Meshing & Mesh Conversion 3 March 27, 2012 01:51
Multi region meshing noob@cfd Siemens 2 March 26, 2012 13:32


All times are GMT -4. The time now is 18:35.