snappyhexmesh_gui
snappyhexmesh_gui copied to clipboard
Scale and convertToMeters in BlockmeshDict
Hi,
By doing the following changes in op_export.py you are able to use the correct scaling tag in blockMeshDict depending on if you're using openfoam.com or openfoam.org.
Line 56 to be changed to:
blockData = export_block_mesh_replacements(blockData, framework)
Line 229 to be changed to:
def export_block_mesh_replacements(data, framework):
After the line data = subst_value("HEADER", get_header_text(), data)
, but before the line data = subst_value("EXPORT_SCALE", "%.6g" % gui.export_scale, data)
add the following snippet:
tag="" tag="" if framework == 'openfoam.org': tag = "convertToMeters " elif framework == 'openfoam.com': tag = "scale " data = subst_value("EXPORT_SCALE_TAG", tag, data)
Also in blockMeshDictTemplate please add //EXPORT_SCALE_TAG// in line 18, so that line 18 becomes:
//_EXPORT_SCALE_TAG_// //_EXPORT_SCALE_//;
Happy SnappyHexMeshing,
BeaAnn
Thanks for the fix, now committed after minor editorial work!