Difference between revisions of "Extend-bazaar/utilities/cfMesh"

From OpenFOAMWiki
(Installation)
(Revamped the page, but still have to add the section for the tutorials...)
Line 1: Line 1:
This template is only a suggestion aimed at saving your time. Please feel free to use any other format on the subpage for your contribution!
 
 
'''Click "Edit" to access and copy the page code.'''
 
 
 
== Description ==
 
== Description ==
This code implements...
+
cfMesh is a library for mesh generation built on OpenFOAM and foam-extend.
  
 +
<br>
 
== Installation ==
 
== Installation ==
Download from [http://www.c-fields.com/Media/Default/Repository/cfMesh-v1.0.tgz HERE], use either
+
Binaries and the source code can be downloaded from open source project [http://sourceforge.net/projects/cfmesh/ cfMesh @ SourceForge.net].
  
* embedded .tgz archive directly on page (only for small files)
+
Supported versions:
* link to file-hoster
+
# cfMesh is already integrated into [http://foam-extend.org foam-extend] since version 3.2.
* link to repository, e.g. on sorceforge.org or github.org
+
# cfMesh is already integrated into {{OpenFOAM+}} since version v1712.
 +
# The last stable version 1.1.2 in the [http://sourceforge.net/projects/cfmesh/ cfMesh project at SourceForge.net] supported foam-extend 4.0 and OpenFOAM 4.0.
 +
# After that, {{tt|development}} branch in the [https://sourceforge.net/p/cfmesh/code/ official git repository] does provide support for {{OpenFOAM+}} and [http://foam-extend.org foam-extend], although it is possible to build with {{OpenFOAM}} versions 5 and 6 after some minor tweaking.
  
 +
<br>
 +
=== Installation instructions on OpenFOAM 5 and 6 ===
 +
 +
There are two sets of instructions you can follow:
 +
# [[#Using the official repository|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.
 +
# [[#Using an adapted fork of cfMesh|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.
 +
 +
<br>
 +
==== Using the official repository ====
 +
Assuming that you already have {{tt|git}} installed, you can download the source code by using the following commands, after activating the desired OpenFOAM shell environment:
 +
<bash>mkdir - p $FOAM_RUN
 +
cd $FOAM_RUN/..
 +
git clone https://git.code.sf.net/p/cfmesh/code cfmesh
 +
cd cfmesh
 +
git checkout development
 +
</bash>
  
Then compile by running:
+
Then the change that needs to be done to the source code is as follows:
<bash>cd src/
+
<bash>
./Allwmake
+
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)
 
</bash>
 
</bash>
  
== Usage examples ==
+
Then it's just a matter of running the following commands:
To use this code, insert into controlDict:
+
<bash>./Allwmake > log.make 2>&1
 +
./Allwmake</bash>
 +
The first command will send all of the screen output into the file {{tt|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.
  
<cpp>functions
+
<br>
{
+
==== Using an adapted fork of cfMesh ====
....(insert the necessary options here)...
+
Assuming that you already have {{tt|git}} installed and after activating the desired OpenFOAM shell environment, run the following commands:
}
+
<bash>mkdir - p $FOAM_RUN
</cpp>
+
cd $FOAM_RUN/..
 +
git clone https://github.com/blueCFD/cfMesh.git
 +
cd cfMesh
 +
git checkout development-OF5x
 +
./Allwmake > log.make 2>&1
 +
./Allwmake</bash>
  
== Documentation ==
+
* The first command will send all of the screen output into the file {{tt|log.make}}, so you will not see much going on, since it's being logged inside that file.
This implementation is based on publication by [http://www.mathstat.uottawa.ca/~rsmith/Zombies.pdf Munz et al (2009)].
+
* The second command will then check if everything went well and it should complain if something went wrong.
  
 +
<br>
 
== History ==
 
== History ==
1 Jun 2010: First upload
 
  
1 Oct 2011: Bug fix for negative inlet velocities
+
* 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.

Revision as of 02:16, 24 December 2018

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
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 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.