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

mesh storage in another directory

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

Like Tree2Likes
  • 2 Post By K62

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2014, 11:41
Default mesh storage in another directory
  #1
K62
New Member
 
Martin Schmelzer
Join Date: Aug 2012
Location: TU Delft
Posts: 4
Rep Power: 13
K62 is on a distinguished road
Dear all,

I study the turbulence models implemented in OpenFOAM. For this I need to run a bunch of different simulations for a test case with different settings (e.g. different coefficients), which requires a case folder structure for each simulations (0/ constant/ system/). However, the mesh is kept the same for all simulations and I don't wanna copy or rebuild it for each simulation, because it is rather expensive to do. Thus, I would like to know if you guys know a way, how to store the mesh in a something like a parent folder and link it to the folder structure of each simulation?

It should look similar to this kind of generic structure:

Simulation1/{0/ constant/ system/}
Simulation2/{0/ constant/ system/}
Simulation3/{0/ constant/ system/}
...
folder-containing-the-mesh-for-each-simulation/


Any help is appreciated!
K62 is offline   Reply With Quote

Old   October 21, 2014, 15:57
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 634
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,

You could just use soft-links, either via the terminal or some file manager. So make the mesh once (polyMesh folder) and create soft links in all constant folders to this polyMesh folder.

Regards,
Tom
tomf is offline   Reply With Quote

Old   October 22, 2014, 05:28
Default
  #3
K62
New Member
 
Martin Schmelzer
Join Date: Aug 2012
Location: TU Delft
Posts: 4
Rep Power: 13
K62 is on a distinguished road
Hi Tom,


Thanks for your reply. I already figured that out, but haven't posted it yet - I am sorry!


For everybody who runs into the same problem my detailed workaround is as follows:


0. Make a backup copy of your <case> (you never know...):
cp -r <case> bu.<case>


1. Copy your <case> containing 0/ constant/ system/ and name the copy e.g. parent_mesh_case:
cp -r <case> parent_mesh_case


2. Go to parent_mesh_case and create the mesh, e.g. by running blockMesh
cd parent_mesh_case
blockMesh


3. Now go back to your <case> and delete or rename the polyMesh folder, e.g.
cd ../<case>/constant
mv polyMesh bu.polyMesh (just in case you gonna need it in the future)


4. Create a symbolic link referring to the mesh directory in parent_mesh_case
ln -s ../../parent_mesh_case/constant/polyMesh .


5. Now if you copy your <case> also the symbolic link will be copied. So you don't copy your mesh, which might be expensive, but only the symbolic link, which is cheap.
cp <case> new_case
cp -a <case> new_case (on mac)



Now, everything what you change in parent_mesh_case/constant/polyMesh is also changed in <case>/constant/polyMesh


Again thanks to Tom for reminding me posting that.


Cheers!
behnamEll and Babelus like this.
K62 is offline   Reply With Quote

Reply

Tags
mesh, parent folder, running

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] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 08:34
3D Hybrid Mesh Errors DarrenC ANSYS Meshing & Geometry 11 August 5, 2013 07:42
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation tommymoose ANSYS Meshing & Geometry 48 April 15, 2013 05:24
[snappyHexMesh] Layers:problem with curvature giulio.topazio OpenFOAM Meshing & Mesh Conversion 10 August 22, 2012 10:03
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 04:52


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