Difference between revisions of "OpenFOAM"

From UFRC
Jump to navigation Jump to search
 
(33 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=OpenFoam=
+
__NOTOC__
 +
__NOEDITSECTION__
 +
[[Category:Software]][[Category:Fluid Dynamics]]
 +
{|<!--Main settings - REQUIRED-->
 +
|{{#vardefine:app|OpenFoam}}
 +
|{{#vardefine:url|http://www.openfoam.org}}
 +
|{{#vardefine:exe|}} <!--Present manual instructions for running the software -->
 +
|{{#vardefine:conf|}} <!--Enable config wiki page link - {{#vardefine:conf|1}} = ON/conf|}} = OFF-->
 +
|{{#vardefine:pbs|}} <!--Enable PBS script wiki page link-->
 +
|{{#vardefine:slurm|}} <!--Enable SLURM script wiki page link-->
 +
|{{#vardefine:policy|}} <!--Enable policy section -->
 +
|{{#vardefine:testing|}} <!--Enable performance testing/profiling section -->
 +
|{{#vardefine:faq|}} <!--Enable FAQ section -->
 +
|{{#vardefine:citation|}} <!--Enable Reference/Citation section -->
 +
|}
 +
<!-- ########  Template Body ######## -->
 +
<!--Description-->
 +
{{#if: {{#var: url}}|
 +
{{App_Description|app={{#var:app}}|url={{#var:url}}|name={{#var:app}}}}|}}
  
== Version 1.7.1 ==
+
OpenFOAM is a free, open source CFD software package produced by a commercial company, OpenCFD Ltd. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics and electromagnetic.
  
Needs to be built with gcc 4.4.4 or newer.  Gcc 4.4.4, in turn, requires a bunch of stuff so we have the following (in the order in which they should be built).
+
<!--Modules-->
 
+
==Required Modules==
=== gmp-5.0.1 ===
+
[[Modules|modules documentation]]
<pre>
+
*intel/2018
./configure --prefix=/apps/openfoam/tools
+
*openmpi/3.0.0
make -j 4
+
*openfoam/5.0
make install
 
</pre>
 
 
 
=== ppl-0.10.2 ===
 
 
 
There is an error in the configure script due to a change in GMP fixed as below.
 
  
 
<pre>
 
<pre>
diff -u configure.orig configure
+
$ module load intel/2018  openmpi/3.0.0 openfoam/5.0
--- configure.orig 2011-02-11 12:29:38.000000000 -0500
 
+++ configure 2011-02-10 13:34:14.000000000 -0500
 
@@ -16473,7 +16473,7 @@
 
      || GMP_LIMB_BITS != mp_bits_per_limb) {
 
    std::cerr
 
      << "GMP header (gmp.h) and library (ligmp.*) bits-per-limb mismatch:\n"
 
-      << "header gives " << __GMP_BITS_PER_MP_LIMB << ";\n"
 
+      << "header gives " << GMP_LIMB_BITS << ";\n"
 
      << "library gives " << mp_bits_per_limb << ".\n"
 
      << "This probably means you are on a bi-arch system and\n"
 
      << "you are compiling with the wrong header or linking with\n"
 
 
 
 
</pre>
 
</pre>
  
<pre>
+
==System Variables==
./configure --prefix=/apps/openfoam/tools \
+
=== OpenFOAM variables ===
            --with-libgmp-prefix=/apps/openfoam/tools \
+
* FOAM_INST_DIR - installation base directory
            --with-libgmpxx-prefix=/apps/openfoam/tools \
+
* FOAM_APPBIN - executable program directory
            --enable-cxx
+
* FOAM_LIB - library directory
make -j4
+
* FOAM_SRC - source directory
make install
+
* FOAM_EXT_LIBBIN - ThirdParty library directory
</pre>
+
* PV_PLUGIN_PATH - ParaView library directory
 +
* FOAM_TUTORIALS - tutorial directory
  
=== mpfr-2.4.2 ===
+
=== Wmake variables ===
 +
These are the wmake parameters used in building OpenFOAM and could be used for compiling the third-party OpenFOAM applications using wmake.
  
<pre>
+
* WM_PROJECT_INST_DIR - wmake installation base directory
./configure --prefix=/apps/openfoam/tools \
+
* WM_PROJECT_VERSION - wmake project version
            --with-gmp=/apps/openfoam/tools
+
* WM_PROJECT - wmake project name (OpenFOAM in this case)
make -j 4
+
* WM_PROJECT_DIR - wmake project directory
make install
+
* WM_DIR - directory where "wmake" executable is
</pre>
+
* WM_ARCH - architecture type
 +
* WM_COMPILER - compiler name
 +
* WM_COMPILE_OPTION - compiler option
 +
* WM_LINK_LANGUAGE - compiler for linking
 +
* WM_PRECISION_OPTION - precision type
  
=== cloog-ppl-0.15.9 ===
+
<!--Additional-->
 
+
{{#if: {{#var: exe}}|==Additional Information==
<pre>
+
WRITE INSTRUCTIONS ON RUNNING THE ACTUAL BINARY|}}
./configure --prefix=/apps/openfoam/tools \
+
{{#if: {{#var: conf}}|==Configuration==
            --with-gmp=/apps/openfoam/tools \
+
See the [[{{PAGENAME}}_Configuration]] page for {{#var: app}} configuration details.|}}
            --with-ppl=/apps/openfoam/tools 
+
{{#if: {{#var: pbs}}|==PBS Script Examples==
make -j 4
+
See the [[{{PAGENAME}}_PBS]] page for {{#var: app}} PBS script examples.|}}
make install
+
{{#if: {{#var: slurm}}|==SLURM Script Examples==
</pre>
+
See the [[{{PAGENAME}}_SLURM]] page for {{#var: app}} SLURM script examples.|}}
 
+
{{#if: {{#var: policy}}|==Usage Policy==
=== gcc-4.4.4 ===
+
WRITE USAGE POLICY HERE (perhaps templates for a couple of main licensing schemes can be used)|}}
 
+
{{#if: {{#var: testing}}|==Performance==
<pre>
+
WRITE PERFORMANCE TESTING RESULTS HERE|}}
../configure --prefix=/apps/openfoam/tools
+
{{#if: {{#var: faq}}|==FAQ==
            --with-gmp=/apps/openfoam/tools \
+
*'''Q:''' **'''A:'''|}}
            --with-mpfr=/apps/openfoam/tools \
+
{{#if: {{#var: citation}}|==Citation==
            --with-ppl=/apps/openfoam/tools \
+
If you publish research that uses {{{app}}} you have to cite it as follows:
            --with-cloog=/apps/openfoam/tools
+
WRITE CITATION HERE
make -j 8
+
|}}
make install
 
</pre>
 
 
 
== OpenFOAM: Undefined pthread library references ==
 
 
 
Undefined references to pthread routines required the following change to the wmake rules...
 
 
 
<pre>
 
--- wmake/rules/linux64Gcc/general.orig 2011-02-11 12:00:54.000000000 -0500
 
+++ wmake/rules/linux64Gcc/general 2011-02-11 11:45:49.000000000 -0500
 
@@ -1,7 +1,7 @@
 
CPP        = cpp -traditional-cpp $(GFLAGS)
 
LD        = ld
 
 
-PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
+PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl -lpthread
 
 
include $(GENERAL_RULES)/standard
 
</pre>
 

Latest revision as of 20:34, 10 December 2019

Description

OpenFoam website  

OpenFOAM is a free, open source CFD software package produced by a commercial company, OpenCFD Ltd. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics and electromagnetic.

Required Modules

modules documentation

  • intel/2018
  • openmpi/3.0.0
  • openfoam/5.0
$ module load intel/2018  openmpi/3.0.0 openfoam/5.0

System Variables

OpenFOAM variables

  • FOAM_INST_DIR - installation base directory
  • FOAM_APPBIN - executable program directory
  • FOAM_LIB - library directory
  • FOAM_SRC - source directory
  • FOAM_EXT_LIBBIN - ThirdParty library directory
  • PV_PLUGIN_PATH - ParaView library directory
  • FOAM_TUTORIALS - tutorial directory

Wmake variables

These are the wmake parameters used in building OpenFOAM and could be used for compiling the third-party OpenFOAM applications using wmake.

  • WM_PROJECT_INST_DIR - wmake installation base directory
  • WM_PROJECT_VERSION - wmake project version
  • WM_PROJECT - wmake project name (OpenFOAM in this case)
  • WM_PROJECT_DIR - wmake project directory
  • WM_DIR - directory where "wmake" executable is
  • WM_ARCH - architecture type
  • WM_COMPILER - compiler name
  • WM_COMPILE_OPTION - compiler option
  • WM_LINK_LANGUAGE - compiler for linking
  • WM_PRECISION_OPTION - precision type