Extend-bazaar/utilities/cfMesh

From OpenFOAMWiki
< Extend-bazaar‎ | utilities
Revision as of 00:27, 24 December 2018 by Wyldckat (Talk | contribs)

1 Description

cfMesh is a library for mesh generation built on OpenFOAM and foam-extend.


2 Installation

Binaries and the source code can be downloaded from open source project cfMesh @ SourceForge.net.

Supported versions:

  1. cfMesh is already integrated into foam-extend since version 3.2.
  2. cfMesh is already integrated into OpenFOAM+ since version v1712.
  3. The last stable version 1.1.2 in the cfMesh project at SourceForge.net supported foam-extend 4.0 and OpenFOAM 4.0.
  4. After that, development branch in the official git repository does provide support for OpenFOAM+ and foam-extend, although it is possible to build with OpenFOAM versions 5 and 6 after some minor tweaking.


2.1 Installation instructions on OpenFOAM 5 and 6

There are two sets of instructions you can follow:

  1. Using the official repository - which lets you use the most recent developments in cfMesh, but requires you to make any additional modifications to the source code yourself, following the instructions provided there.
  2. Using an adapted fork of cfMesh - which provides simpler instructions on how to download and compile cfMesh with OpenFOAM 5 or 6, may not be as up to date on the developments as the official cfMesh repository.


2.1.1 Using the official repository

Assuming that you already have git installed, you can download the source code by using the following commands, after activating the desired OpenFOAM shell environment:

mkdir - p $FOAM_RUN
cd $FOAM_RUN/..
git clone https://git.code.sf.net/p/cfmesh/code cfmesh
cd cfmesh
git checkout development

Then the change that needs to be done to the source code is as follows:

 
diff --git a/meshLibrary/Make/options b/meshLibrary/Make/options
index fa47820..a2dcd7c 100644
--- a/meshLibrary/Make/options
+++ b/meshLibrary/Make/options
@@ -14,9 +14,8 @@ ifeq (OpenFOAM,$(findstring OpenFOAM,$(WM_PROJECT)))
     endif
 endif
 
-ifeq (v, $(findstring v, $(WM_PROJECT_VERSION)))
-    CFMESH_MACROS += -DOpenCFDSpecific
-endif
+# Use the same macro for OpenFOAM.com and OpenFOAM.org
+CFMESH_MACROS += -DOpenCFDSpecific
 
 ifeq ($(WM_PROJECT), foam)
     VER := $(shell expr `echo $(WM_PROJECT_VERSION)` \>= 3.2)

Then it's just a matter of running the following commands:

./Allwmake > log.make 2>&1
./Allwmake

The first command will send all of the screen output into the file log.make, so you will not see much going on, since it's being logged inside that file. The second command will then check if everything went well and it should complain if something went wrong.


2.1.2 Using an adapted fork of cfMesh

Assuming that you already have git installed and after activating the desired OpenFOAM shell environment, run the following commands:

mkdir - p $FOAM_RUN
cd $FOAM_RUN/..
git clone https://github.com/blueCFD/cfMesh.git cfmesh
cd cfmesh
git checkout development-OF5x
./Allwmake > log.make 2>&1
./Allwmake
  • The first command will send all of the screen output into the file log.make, so you will not see much going on, since it's being logged inside that file.
  • The second command will then check if everything went well and it should complain if something went wrong.


3 Tutorials

Depends on how you installed cfMesh:

  • When using cfMesh as integrated into foam-extend, the tutorial cases are provided at $FOAM_TUTORIALS/mesh/cfMesh.
  • When using cfMesh as integrated into OpenFOAM+, the tutorial cases are provided at $WM_PROJECT_DIR/modules/cfmesh/tutorials.
  • When using cfMesh as built from source code, the tutorial cases are inside the folder tutorials within the cfmesh source code folder.


4 History

  • 24 December 2018 - Restructured page and provided more details on where cfMesh is provided and how to install it on OpenFOAM 5 and 6.
  • 16 June 2014‎ - Quick page deployment based on template and added link to the cfMesh 1.0 source code.