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

mesh storage in another directory

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 14, 2014, 10:41
Default mesh storage in another directory
  #1
K62
New Member
 
Join Date: Aug 2012
Posts: 2
Rep Power: 0
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, 14:57
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Delft, Netherlands
Posts: 226
Rep Power: 10
tomf is on a distinguished road
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, 04:28
Default
  #3
K62
New Member
 
Join Date: Aug 2012
Posts: 2
Rep Power: 0
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!
K62 is offline   Reply With Quote

Reply

Tags
mesh, parent folder, running

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
3D Hybrid Mesh Errors DarrenC ANSYS Meshing & Geometry 11 August 5, 2013 06:42
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation tommymoose ANSYS Meshing & Geometry 48 April 15, 2013 04:24
Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Native Meshers: snappyHexMesh and Others 8 September 13, 2012 09:28
Layers:problem with curvature giulio.topazio OpenFOAM Native Meshers: snappyHexMesh and Others 10 August 22, 2012 09:03
2D Mesh Generation Tutorial for GMSH aeroslacker Open Source Meshers: Gmsh, Netgen, CGNS, ... 12 January 19, 2012 04:52


All times are GMT -4. The time now is 05:17.