|
[Sponsors] |
Merge and Stitch meshes using pyFoam libraries |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 13, 2018, 07:02 |
Merge and Stitch meshes using pyFoam libraries
|
#1 |
Member
Shailesh BG
Join Date: Aug 2017
Location: Bangalore
Posts: 39
Rep Power: 9 |
Hello Foamers,
Newbie to python and pyFoam, I am looking to automate my simulation using pyFoam libraries. Problem Statement: I have two different bodies which I have meshed but I want to merge and then stitch the two meshes. The meshing of my two regions muscle and tissue: Code:
# Muscle Meshing orig = SolutionDirectory(path.expandvars("muscle"), archive=None, paraviewLink=False) work = orig.cloneCase("muscle1") blockRun = BasicRunner(argv=["blockMesh", "-case", work.name], silent=True, server=False, writeState=False) blockRun.start() if not blockRun.runOK(): error("There was a problem with blockMesh") snapRun = BasicRunner(argv=["snappyHexMesh", "-case", work.name], silent=True, server=False, writeState=False) snapRun.start() if not snapRun.runOK(): error("There was a problem with snappyHexMesh") # Tissue Meshing orig = SolutionDirectory(path.expandvars("tissue"), archive=None, paraviewLink=False) work = orig.cloneCase("tissue1") blockRun = BasicRunner(argv=["blockMesh", "-case", work.name], silent=True, server=False, writeState=False) blockRun.start() if not blockRun.runOK(): error("There was a problem with blockMesh") snapRun = BasicRunner(argv=["snappyHexMesh", "-case", work.name], silent=True, server=False, writeState=False) snapRun.start() if not snapRun.runOK(): error("There was a problem with snappyHexMesh") Code:
runApplication mergeMeshes -overwrite . ../tissue/ # Merge tissue mesh onto the muscle mesh runApplication stitchMesh -partial -toleranceDict toleranceDict -overwrite muscle_ext muscle_int # partial stitch muscle patches per tolerance cd 0 rm meshPhi # remove meshPhi cd .. rm log.* # remove current merge and stitch logs cd constant/polyMesh/ # move to constant polymesh to remove current zones rm *Zones # remove all current zone files rm meshModifiers # remove mesh modifiers
__________________
Regards, Shailesh |
|
February 19, 2018, 02:30 |
|
#2 |
Member
Shailesh BG
Join Date: Aug 2017
Location: Bangalore
Posts: 39
Rep Power: 9 |
Hi,
Could anyone please help me out with this.
__________________
Regards, Shailesh |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] How to merge blocks? Match, merge or stitch? | gerritgroot | OpenFOAM Meshing & Mesh Conversion | 0 | November 13, 2015 21:59 |
[blockMesh] Struggling to stitch or merge these blocks | Jabo | OpenFOAM Meshing & Mesh Conversion | 1 | November 7, 2014 05:39 |