Merge commit 'OpenCFD/master' into olesenm

This commit is contained in:
Mark Olesen
2008-07-14 12:59:35 +02:00
71 changed files with 2325557 additions and 1269 deletions

214
README
View File

@ -1,109 +1,85 @@
README for OpenFOAM: The Open Source CFD Toolbox
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# -*- mode: org; -*-
#
#+TITLE: *OpenFOAM README for version 1.5*
#+AUTHOR: OpenCFD Ltd.
#+DATE: 10 July 2008
#+LINK: http://www.opencfd.co.uk
#+OPTIONS: author:nil
0. Copyright
~~~~~~~~~~~~
OpenFOAM is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version. See the file COPYING in this directory, for a
description of the GNU General Public License terms under which you can
copy the files.
* Copyright
OpenFOAM is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. See the file COPYING in this directory, for a description of the GNU
General Public License terms under which you can copy the files.
* System requirements
OpenFOAM is developed and tested on Linux, but should work with other Unix
style systems. To check your system setup, execute the foamSystemCheck script
in the bin/ directory of the OpenFOAM installation. If no problems are
reported, proceed to "3. Installation"; otherwise contact your system
administrator.
1. Contents
~~~~~~~~~~~
0. Copyright
1. Contents
2. System requirements
3. Installation
4. Building from Sources (Optional)
5. Testing the installation
6. Getting started
7. Documentation
8. Help
9. Reporting Bugs
A. Running OpenFOAM in 32-bit mode
If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the
appendix "A. Running OpenFOAM in 32-bit mode".
* Installation
Download and unpack the files in the $HOME/OpenFOAM directory as described in:
http://www.OpenFOAM.org/download.html
2. System requirements
~~~~~~~~~~~~~~~~~~~~~~
OpenFOAM is developed and tested on Linux, but should work with other
Unix style systems. To check your system setup, execute the foamSystemCheck
script in the bin/ directory of the OpenFOAM installation. If no problems
are reported, proceed to "3. Installation"; otherwise contact your
system administrator.
The environment variable settings are contained in files in an etc/ directory
in the OpenFOAM release. e.g. in
If the user wishes to run OpenFOAM in 32/64-bit mode they should consult
the appendix "A. Running OpenFOAM in 32-bit mode".
+ $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/
+ where <VERSION> corresponds to the version 1.4, 1.5, ...
1) EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the
etc/bashrc file by adding the following line to the end of your
$HOME/.bashrc file:
3. Installation
~~~~~~~~~~~~~~~
Download and unpack the files in the $HOME/OpenFOAM directory as described
in: http://www.OpenFOAM.org/download.html
+ . $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/bashrc
The environment variable settings are contained in files in an etc/
directory in the OpenFOAM release. e.g. in
Then update the environment variables by sourcing the $HOME/.bashrc file by
typing in the terminal:
$HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/
+ . $HOME/.bashrc
where <VERSION> corresponds to the version 1.4, 1.5, ...
a)
EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'),
source the etc/bashrc file by adding the following line to the end
of your $HOME/.bashrc file:
. $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/bashrc
Then update the environment variables by sourcing the $HOME/.bashrc file
by typing in the terminal:
. $HOME/.bashrc
b)
OR, if running tcsh or csh, source the etc/cshrc file by adding the
2) OR, if running tcsh or csh, source the etc/cshrc file by adding the
following line to the end of your $HOME/.cshrc file:
source $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/cshrc
+ source $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/cshrc
Then update the environment variables by sourcing the $HOME/.cshrc file
by typing in the terminal:
Then update the environment variables by sourcing the $HOME/.cshrc file by
typing in the terminal:
source $HOME/.cshrc
+ source $HOME/.cshrc
3.1. Installation in alternative locations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** Installation in alternative locations
OpenFOAM may also be installed in alternative locations. However, the
installation directory should be network available (e.g., NFS) if
parallel calculations are planned.
installation directory should be network available (e.g., NFS) if parallel
calculations are planned.
The environment variable 'FOAM_INST_DIR' can be used to find and source
the appropriate resource file. Here is a bash/ksh/sh example:
The environment variable 'FOAM_INST_DIR' can be used to find and source the
appropriate resource file. Here is a bash/ksh/sh example:
export FOAM_INST_DIR=/data/app/OpenFOAM
foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
[ -f $foamDotFile ] && . $foamDotFile
+ export FOAM_INST_DIR=/data/app/OpenFOAM
+ foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
+ [ -f $foamDotFile ] && . $foamDotFile
and a csh/tcsh example:
setenv FOAM_INST_DIR /data/app/OpenFOAM
foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
if ( -f $foamDotFile ) source $foamDotFile
+ setenv FOAM_INST_DIR /data/app/OpenFOAM
+ foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
+ if ( -f $foamDotFile ) source $foamDotFile
The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts
of the OpenFOAM installation.
The value set in '$FOAM_INST_DIR' will be used to locate the remaining
parts of the OpenFOAM installation.
4. Building from Sources (Optional)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you cannot find an appropriate binary pack for your platform, you can
build the complete OpenFOAM from the source-pack. You will first need to
compile or obtain a recent version of gcc (we recomend gcc-4.3.?) for
your platform, which may be obtained from http://gcc.gnu.org/.
* Building from Sources (Optional)
If you cannot find an appropriate binary pack for your platform, you can build
the complete OpenFOAM from the source-pack. You will first need to compile or
obtain a recent version of gcc (we recomend gcc-4.3.?) for your platform,
which may be obtained from http://gcc.gnu.org/.
Install the compiler in
$WM_PROJECT_INST_DIR/ThirdParty/gcc-<GCC_VERSION>/platforms/$WM_ARCH$WM_COMPILER_ARCH/
@ -112,68 +88,54 @@
environment variables as in section 3.
Now go to the top-level source directory $WM_PROJECT_DIR and execute the
top-level build script './Allwmake'. In principle this will build
everything, but if problems occur with the build order it may be necessary
to update the environment variables and re-execute 'Allwmake'. If you
experience difficulties with building the source-pack, or your platform is
not currently supported, please contact <enquiries@OpenCFD.co.uk> to
negotiate a support contract and we will do the port and maintain it for
future releases.
top-level build script './Allwmake'. In principle this will build everything,
but if problems occur with the build order it may be necessary to update the
environment variables and re-execute 'Allwmake'. If you experience
difficulties with building the source-pack, or your platform is not currently
supported, please contact <enquiries@OpenCFD.co.uk> to negotiate a support
contract and we will do the port and maintain it for future releases.
* Testing the installation
To check your installation setup, execute the 'foamInstallationTest' script
(in the bin/ directory of the OpenFOAM installation). If no problems are
reported, proceed to getting started with OpenFOAM; otherwise, go back and
check you have installed the software correctly and/or contact your system
administrator.
5. Testing the installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~
To check your installation setup, execute the 'foamInstallationTest'
script (in the bin/ directory of the OpenFOAM installation). If no
problems are reported, proceed to getting started with OpenFOAM;
otherwise, go back and check you have installed the software correctly
and/or contact your system administrator.
6. Getting Started
~~~~~~~~~~~~~~~~~~
* Getting Started
Create a project directory within the $HOME/OpenFOAM directory named
<USER>-<VERSION> (e.g. 'chris-1.5' for user chris and OpenFOAM version 1.5)
and create a directory named 'run' within it, e.g. by typing:
mkdir -p $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
+ mkdir -p $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
Copy the 'tutorial' examples directory in the OpenFOAM distribution to the
'run' directory. If the OpenFOAM environment variables are set correctly,
then the following command will be correct:
cp -r $WM_PROJECT_DIR/tutorials $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
+ cp -r $WM_PROJECT_DIR/tutorials
$HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
Run the first example case of incompressible laminar flow in a cavity:
cd $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run/tutorials/icoFoam/cavity
blockMesh
icoFoam
+ cd $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run/tutorials/icoFoam/cavity
+ blockMesh
+ icoFoam
7. Documentation
~~~~~~~~~~~~~~~~
* Documentation
http://www.OpenFOAM.org/doc
* Help
http://www.OpenFOAM.org http://www.OpenFOAM.org/discussion.html
8. Help
~~~~~~~
http://www.OpenFOAM.org
http://www.OpenFOAM.org/discussion.html
9. Reporting Bugs in OpenFOAM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Reporting Bugs in OpenFOAM
http://www.OpenFOAM.org/bugs.html
A. Running OpenFOAM in 32-bit mode on 64-bit machines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Running OpenFOAM in 32-bit mode on 64-bit machines
Linux users with a 64-bit machine may install either the OpenFOAM 32-bit
version (linux) or the OpenFOAM 64-bit version (linux64), or both.
The 64-bit is the default mode on a 64-bit machine. To use an installed
32-bit version, the user must set the environment variable $WM_32 (to
anything, e.g. "on") before sourcing the etc/bashrc (or etc/cshrc) file.
Unsetting WM_32 and re-sourcing the etc/bashrc (or etc/cshrc) file will
set up the user to run in 64-bit mode.
version (linux) or the OpenFOAM 64-bit version (linux64), or both. The 64-bit
is the default mode on a 64-bit machine. To use an installed 32-bit version,
the user must set the environment variable $WM_32 (to anything, e.g. "on")
before sourcing the etc/bashrc (or etc/cshrc) file. Unsetting WM_32 and
re-sourcing the etc/bashrc (or etc/cshrc) file will set up the user to run in
64-bit mode.

341
README.html Normal file
View File

@ -0,0 +1,341 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en">
<head>
<title><b>OpenFOAM README for version 1.5</b></title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="10 July 2008"/>
<meta name="author" content="OpenCFD Ltd."/>
<style type="text/css">
html {
font-family: Times, serif;
font-size: 12pt;
}
.title { text-align: center; }
.todo { color: red; }
.done { color: green; }
.timestamp { color: grey }
.timestamp-kwd { color: CadetBlue }
.tag { background-color:lightblue; font-weight:normal }
.target { }
pre {
border: 1pt solid #AEBDCC;
background-color: #F3F5F7;
padding: 5pt;
font-family: courier, monospace;
font-size: 90%;
}
table { border-collapse: collapse; }
td, th {
vertical-align: top;
<!--border: 1pt solid #ADB9CC;-->
}
dt { font-weight: bold; }
</style>
</head><body>
<h1 class="title"><b>OpenFOAM README for version 1.5</b></h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Copyright</a></li>
<li><a href="#sec-2">2 System requirements</a></li>
<li><a href="#sec-3">3 Installation</a>
<ul>
<li><a href="#sec-3.1">3.1 Installation in alternative locations</a></li>
</ul>
</li>
<li><a href="#sec-4">4 Building from Sources (Optional)</a></li>
<li><a href="#sec-5">5 Testing the installation</a></li>
<li><a href="#sec-6">6 Getting Started</a></li>
<li><a href="#sec-7">7 Documentation</a></li>
<li><a href="#sec-8">8 Help</a></li>
<li><a href="#sec-9">9 Reporting Bugs in OpenFOAM</a></li>
<li><a href="#sec-10">10 Running OpenFOAM in 32-bit mode on 64-bit machines</a></li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1">1 Copyright</h2>
<div id="text-1">
<p>OpenFOAM is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. See the file COPYING in this directory, for a description of the GNU
General Public License terms under which you can copy the files.
</p>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2">2 System requirements</h2>
<div id="text-2">
<p>OpenFOAM is developed and tested on Linux, but should work with other Unix
style systems. To check your system setup, execute the foamSystemCheck script
in the bin/ directory of the OpenFOAM installation. If no problems are
reported, proceed to "3. Installation"; otherwise contact your system
administrator.
</p>
<p>
If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the
appendix "A. Running OpenFOAM in 32-bit mode".
</p>
</div>
</div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3">3 Installation</h2>
<div id="text-3">
<p>Download and unpack the files in the $HOME/OpenFOAM directory as described in:
<a href="http://www.OpenFOAM.org/download.html">http://www.OpenFOAM.org/download.html</a>
</p>
<p>
The environment variable settings are contained in files in an etc/ directory
in the OpenFOAM release. e.g. in
</p>
<ul>
<li>
$HOME/OpenFOAM/OpenFOAM-&lt;VERSION&gt;/etc/
</li>
<li>
where &lt;VERSION&gt; corresponds to the version 1.4, 1.5, &hellip;
</li>
<li>
EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the
etc/bashrc file by adding the following line to the end of your
$HOME/.bashrc file:
<ul>
<li>
. $HOME/OpenFOAM/OpenFOAM-&lt;VERSION&gt;/etc/bashrc
</li>
</ul>
<p>Then update the environment variables by sourcing the $HOME/.bashrc file by
typing in the terminal:
</p>
<ul>
<li>
. $HOME/.bashrc
</li>
</ul>
</li>
<li>
OR, if running tcsh or csh, source the etc/cshrc file by adding the
following line to the end of your $HOME/.cshrc file:
<ul>
<li>
source $HOME/OpenFOAM/OpenFOAM-&lt;VERSION&gt;/etc/cshrc
</li>
</ul>
<p>Then update the environment variables by sourcing the $HOME/.cshrc file by
typing in the terminal:
</p>
<ul>
<li>
source $HOME/.cshrc
</li>
</ul>
</li>
</ul>
</div>
<div id="outline-container-3.1" class="outline-3">
<h3 id="sec-3.1">3.1 Installation in alternative locations</h3>
<div id="text-3.1">
<p>OpenFOAM may also be installed in alternative locations. However, the
installation directory should be network available (e.g., NFS) if parallel
calculations are planned.
</p>
<p>
The environment variable 'FOAM_INST_DIR' can be used to find and source the
appropriate resource file. Here is a bash/ksh/sh example:
</p>
<ul>
<li>
export FOAM_INST_DIR=/data/app/OpenFOAM
</li>
<li>
foamDotFile=$FOAM_INST_DIR/OpenFOAM-&lt;VERSION&gt;/etc/bashrc
</li>
<li>
[ -f $foamDotFile ] &amp;&amp; . $foamDotFile
</li>
</ul>
<p>and a csh/tcsh example:
</p>
<ul>
<li>
setenv FOAM_INST_DIR /data/app/OpenFOAM
</li>
<li>
foamDotFile=$FOAM_INST_DIR/OpenFOAM-&lt;VERSION&gt;/etc/bashrc
</li>
<li>
if ( -f $foamDotFile ) source $foamDotFile
</li>
</ul>
<p>The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts
of the OpenFOAM installation.
</p>
</div>
</div>
</div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4">4 Building from Sources (Optional)</h2>
<div id="text-4">
<p>If you cannot find an appropriate binary pack for your platform, you can build
the complete OpenFOAM from the source-pack. You will first need to compile or
obtain a recent version of gcc (we recomend gcc-4.3.?) for your platform,
which may be obtained from <a href="http://gcc.gnu.org/">http://gcc.gnu.org/</a>.
</p>
<p>
Install the compiler in
$WM_PROJECT_INST_DIR/ThirdParty/gcc-&lt;GCC_VERSION&gt;/platforms/$WM_ARCH$WM_COMPILER_ARCH/
and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and
$WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the
environment variables as in section 3.
</p>
<p>
Now go to the top-level source directory $WM_PROJECT_DIR and execute the
top-level build script './Allwmake'. In principle this will build everything,
but if problems occur with the build order it may be necessary to update the
environment variables and re-execute 'Allwmake'. If you experience
difficulties with building the source-pack, or your platform is not currently
supported, please contact &lt;enquiries@OpenCFD.co.uk&gt; to negotiate a support
contract and we will do the port and maintain it for future releases.
</p>
</div>
</div>
<div id="outline-container-5" class="outline-2">
<h2 id="sec-5">5 Testing the installation</h2>
<div id="text-5">
<p>To check your installation setup, execute the 'foamInstallationTest' script
(in the bin/ directory of the OpenFOAM installation). If no problems are
reported, proceed to getting started with OpenFOAM; otherwise, go back and
check you have installed the software correctly and/or contact your system
administrator.
</p>
</div>
</div>
<div id="outline-container-6" class="outline-2">
<h2 id="sec-6">6 Getting Started</h2>
<div id="text-6">
<p>Create a project directory within the $HOME/OpenFOAM directory named
&lt;USER&gt;-&lt;VERSION&gt; (e.g. 'chris-1.5' for user chris and OpenFOAM version 1.5)
and create a directory named 'run' within it, e.g. by typing:
</p>
<ul>
<li>
mkdir -p $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
</li>
</ul>
<p>Copy the 'tutorial' examples directory in the OpenFOAM distribution to the
'run' directory. If the OpenFOAM environment variables are set correctly,
then the following command will be correct:
</p>
<ul>
<li>
cp -r $WM_PROJECT_DIR/tutorials
$HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
</li>
</ul>
<p>Run the first example case of incompressible laminar flow in a cavity:
</p>
<ul>
<li>
cd $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run/tutorials/icoFoam/cavity
</li>
<li>
blockMesh
</li>
<li>
icoFoam
</li>
</ul>
</div>
</div>
<div id="outline-container-7" class="outline-2">
<h2 id="sec-7">7 Documentation</h2>
<div id="text-7">
<p><a href="http://www.OpenFOAM.org/doc">http://www.OpenFOAM.org/doc</a>
</p>
</div>
</div>
<div id="outline-container-8" class="outline-2">
<h2 id="sec-8">8 Help</h2>
<div id="text-8">
<p><a href="http://www.OpenFOAM.org">http://www.OpenFOAM.org</a> <a href="http://www.OpenFOAM.org/discussion.html">http://www.OpenFOAM.org/discussion.html</a>
</p>
</div>
</div>
<div id="outline-container-9" class="outline-2">
<h2 id="sec-9">9 Reporting Bugs in OpenFOAM</h2>
<div id="text-9">
<p><a href="http://www.OpenFOAM.org/bugs.html">http://www.OpenFOAM.org/bugs.html</a>
</p>
</div>
</div>
<div id="outline-container-10" class="outline-2">
<h2 id="sec-10">10 Running OpenFOAM in 32-bit mode on 64-bit machines</h2>
<div id="text-10">
<p>Linux users with a 64-bit machine may install either the OpenFOAM 32-bit
version (linux) or the OpenFOAM 64-bit version (linux64), or both. The 64-bit
is the default mode on a 64-bit machine. To use an installed 32-bit version,
the user must set the environment variable $WM_32 (to anything, e.g. "on")
before sourcing the etc/bashrc (or etc/cshrc) file. Unsetting WM_32 and
re-sourcing the etc/bashrc (or etc/cshrc) file will set up the user to run in
64-bit mode.
</p></div>
</div>
<div id="postamble"><p class="date"> Date: 10 July 2008</p>
<p>HTML generated by org-mode 6.05a in emacs 23<p>
</div></body>
</html>

176
ReleaseNotes-1.5 Normal file
View File

@ -0,0 +1,176 @@
# -*- mode: org; -*-
#
#+TITLE: *OpenFOAM release notes for version 1.5*
#+AUTHOR: OpenCFD Ltd.
#+DATE: 10 July 2008
#+LINK: http://www.opencfd.co.uk
#+OPTIONS: author:nil
* Overview
OpenFOAM-1.5 is is a significant upgrade to version 1.4 in ways which are
outlined below. This release passes all our standard tests and the tutorials
have been broadly checked. If there are any bugs, please report them using
the instructions set out in: http://www.openfoam.org/bugs.html.
Most of the developments for this release are in: new applications, e.g. for
multiphase flow and cavitation, buoyancy-flow and heat transfer, high speed
flows and even molecular dynamics; new utilities, e.g. for meshing and case
monitoring; and, new modelling, e.g. in Lagrangian particle tracking,
radiation and rotating frames of reference. With these new applications come
numerous new example cases.
* GNU/Linux version
The 64bit binary packs of the OpenFOAM release were compiled on a machine
running SuSE GNU/Linux version 10.3 and the 32bit on a machine running Ubuntu
GNU/Linux version 7.1 and also tested on Ubuntu 8.04. We recommend that
users run OpenFOAM on one of these or a similar recent version of GNU/Linux.
This release has also been successfully compiled and tested on older GNU/Linux
releases but this requires the installation of Qt 4.3.? for ParaView-3 to run.
* C++ Compiler version
+ Released compiled with GCC 4.3.1, the latest version.
+ Built in support for the Intel C++ 10.? compiler (untested).
+ The choice of the compiler is controlled by the setting of the $WM\_COMPILER
and $WM\_COMPILER\_ARCH environment variables in the OpenFOAM-1.5/etc/bashrc
(or cshrc) file.
+ The location of the installation of the compiler is controlled by the
$WM\_COMPILER\_INST environment variable in the OpenFOAM-1.5/etc/settings.sh
(or settings.csh) file.
* Developments to solvers (applications)
+ New rhoCentralFoam solver for high-speed, viscous, compressible flows using
non-oscillatory, central-upwind schemes.
+ New interDyMFoam solver for 2 incompressible, isothermal, immiscible fluids
using a VoF phase-fraction based interface capturing approach, with optional
mesh motion and mesh topology changes including adaptive mesh
(un)refinement. Useful for simulations such as tank filling, sloshing ---
using solid body motion e.g. SDA or SKA (6DoF) --- and slamming (using the
mesh motion solver) and other large-scale applications that benefit from the
efficiency gain of adaptive mesh (un)refinement of the interface.
+ New compressibleInterFoam solver for 2 compressible, isothermal, immiscible
fluids using a volume of fluid (VoF) phase-fraction approach for
interface-capturing. The momentum and other fluid properties are of the
"mixture" and a single momentum equation is solved. Turbulence is modelled
using a run-time selectable incompressible LES model.
+ New interPhaseChangeFoam solver for 2 incompressible, isothermal, immiscible
fluids with phase-change, e.g. cavitation. Uses VoF interface capturing,
with momentum and other fluid properties described for the ``mixture'' and a
single momentum equation is solved. The set of phase-change models provided
are designed to simulate cavitation but other mechanisms of phase-change are
supported within this solver framework.
+ New rasCavitatingFoam solver for transient cavitation using a barotropic
compressibility model, with RAS turbulence.
+ New lesCavitatingFoam solver for transient cavitation using a barotropic
compressibility model, with LES turbulence.
+ New chtMultiRegionFoam solver that couples conjugate heat transfer in a
solid to a buoyancy-driven flow simulation.
+ New PDRFoam solver for compressible premixed/partially-premixed turbulent
combustion that includes porosity/distributed resistance (PDR) modelling to
handle regions containing solid blockages which cannot be resolved by the
mesh. Requires the PDR fields.
+ New lesBuoyantFoam solver for transient, buoyant, turbulent flow of
compressible fluids for ventilation and heat-transfer. Turbulence is
modelled using a run-time selectable compressible LES model.
+ New rhoPimpleFoam solver for transient, turbulent flow of compressible
fluids for ventilation and heat-transfer. Uses the flexible PIMPLE
(PISO-SIMPLE) solution for time-resolved and pseudo-transient simulations.
+ New buoyantSimpleRadiationFoam solver for steady-state, buoyant, turbulent
flow of compressible fluids with radiation, for ventilation and
heat-transfer.
+ New rhoTurbTwinParcelFoam solver for transient for compressible, turbulent
flow with two thermo-clouds.
+ New gnemdFOAM solver for general purpose molecular dynamics that simulates
atoms in arbitrary shaped domains and average atomic/molecular quantities to
the mesh to create field data.
+ New mdEqulibrationFoam solver to equilibrates and/or preconditions molecular
dynamics systems.
+ Demonstration SRFSimpleFoam solver based on simpleFoam that incorporates the
SRF extensions (see below) for rotating flows.
* Automatic mesher
New snappyHexMesh utility that generates split-hex meshes automatically from
triangulated (STL) surface geometries. The mesh approximately conforms to
the surface by iteratively refining a starting mesh and morphing the
resulting split-hex mesh to the surface. An optional phase will shrink back
the resulting mesh and insert cell layers. It has a flexible specification
of mesh refinement level and robust surface handling with a pre-specified
final mesh quality. It runs in parallel with a load balancing step every
iteration.
* Developments to utilities
+ New extrude2DMesh utility that extrudes 2D meshes into a 3D mesh. 2D meshes
are described by faces with 2 points, so can be used in combination with 2D
meshes converted with ccm26ToFoam.
+ New couplePatches functionality integrated into createPatch, which
optionally synchronises ("couples") points and faces of coupled (cyclic,
processor) patches.
+ New applyBoundaryLayer pre-processing utility to apply 1/7th power-law
boundary layers at walls, starting from uniform or potential flow solutions.
+ New execFlowFunctionObjects utility executes functionObjects as a
post-processing activity, e.g. probes, sampling, force calculation.
+ New changeDictionary utility makes batch changes to OpenFOAM input files,
e.g. to change boundary conditions of field files.
+ New foamCalc utility, a generic post-processing field calculator tool
+ New molConfig pre-processing utility for molecular dynamics cases. Fills
zones of a mesh with single crystal lattices of specified structure,
density, orientation, alignment and temperature.
+ Extended splitMeshRegions utility to split multi-zone meshes, e.g. defined
through cellZones, into separate meshes.
+ Extended the foamToVTK, decomposePar, reconstructPar and mapFields utilities
to include support for multiple particle clouds in parallel processing.
* Migration from ParaView 2.4 to ParaView 3.x
+ Rewritten OpenFOAM Reader Module for version 3, a major redesign of
ParaView.
+ New features include viewing patch names, reading of Lagrangian data,
handling of cell, face and point sets, multiple views.
* Model development
+ Overhauled the lagrangian library to support multiple clouds.
+ New lagrangianIntermediate library incorporating a hierarchy of parcel and
cloud types, accommodating kinematic, thermodynamic and reacting
applications, including coupling to the new radiation library. Sub-models
are added at the relevant level of physics, e.g.:
- kinematic: injection, wall interaction, drag, dispersion;
- thermo: heat transfer;
- reacting: reacting composition, mass transfer, surface reactions.
+ New single rotating frame of reference (SRF) library for rotating flow
applications, e.g. turbo-machinery.
+ New radiation library including the P1 model and associated Marshak boundary
conditions for incident radiation.
+ New displacementInterpolation motion solver for flexible mesh scaling.
+ New molecularDynamics Lagrangian library to calculate intermolecular forces
between spherically symmetrical monatomic species in arbitrary geometries.
* New functionObjects
To aid common monitoring and post-processing activities.
+ forces: calculate the force and moment on a patch or set of patches, e.g. to
calculate the lift, drag and moment of an object in the flow.
+ forceCoeffs: calculate the normalised force and moment on a patch or set of
patches, e.g. to calculate the lift, drag and moment coefficients of an
object in the flow.
+ fieldAverage: calculate field arithmetic mean and prime-squared averages for
a list of fields.
+ foamCalcFunctions: calculate field components, div, mag, magGrad or magSqr.
* Improvements to boundary conditions
+ Generalised jumpCyclic type: cyclic condition with an additional prescribed
jump in value.
+ fan type: specialisation of jumpCyclic, applying a prescribed jump in
pressure to simulate a fan within a mesh.
+ Generalised advective outflow boundary condition based on solving D/Dt(psi,
U) = 0 at the boundary.
+ Additional turbulent flow inlet to specify mixing length and frequency.
+ Generalisation of time varying set of boundary conditions.
* Other
+ New argument-free command execution, e.g typing "icoFoam" without root and
case directory arguments.
+ Extended time command line options.
+ Many enhancements to dictionary including macro substitution, optional
merging and default/overwrite behaviour, enhanced "#include" file handling
and the framework to support function evaluation.
+ Cross-links between applications and Doxygen documentation with the "-doc"
argument.
+ Non-blocking, non-buffered, parallel transfers with potential scaling
benefits for larger number of processors.

429
ReleaseNotes-1.5.html Normal file
View File

@ -0,0 +1,429 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en">
<head>
<title><b>OpenFOAM release notes for version 1.5</b></title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="10 July 2008"/>
<meta name="author" content="OpenCFD Ltd."/>
<style type="text/css">
html {
font-family: Times, serif;
font-size: 12pt;
}
.title { text-align: center; }
.todo { color: red; }
.done { color: green; }
.timestamp { color: grey }
.timestamp-kwd { color: CadetBlue }
.tag { background-color:lightblue; font-weight:normal }
.target { }
pre {
border: 1pt solid #AEBDCC;
background-color: #F3F5F7;
padding: 5pt;
font-family: courier, monospace;
font-size: 90%;
}
table { border-collapse: collapse; }
td, th {
vertical-align: top;
<!--border: 1pt solid #ADB9CC;-->
}
dt { font-weight: bold; }
</style>
</head><body>
<h1 class="title"><b>OpenFOAM release notes for version 1.5</b></h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Overview</a></li>
<li><a href="#sec-2">2 GNU/Linux version</a></li>
<li><a href="#sec-3">3 C++ Compiler version</a></li>
<li><a href="#sec-4">4 Developments to solvers (applications)</a></li>
<li><a href="#sec-5">5 Automatic mesher</a></li>
<li><a href="#sec-6">6 Developments to utilities</a></li>
<li><a href="#sec-7">7 Migration from ParaView 2.4 to ParaView 3.x</a></li>
<li><a href="#sec-8">8 Model development</a></li>
<li><a href="#sec-9">9 New functionObjects</a></li>
<li><a href="#sec-10">10 Improvements to boundary conditions</a></li>
<li><a href="#sec-11">11 Other</a></li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1">1 Overview</h2>
<div id="text-1">
<p>OpenFOAM-1.5 is is a significant upgrade to version 1.4 in ways which are
outlined below. This release passes all our standard tests and the tutorials
have been broadly checked. If there are any bugs, please report them using
the instructions set out in: <a href="http://www.openfoam.org/bugs.html">http://www.openfoam.org/bugs.html</a>.
</p>
<p>
Most of the developments for this release are in: new applications, e.g. for
multiphase flow and cavitation, buoyancy-flow and heat transfer, high speed
flows and even molecular dynamics; new utilities, e.g. for meshing and case
monitoring; and, new modelling, e.g. in Lagrangian particle tracking,
radiation and rotating frames of reference. With these new applications come
numerous new example cases.
</p>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2">2 GNU/Linux version</h2>
<div id="text-2">
<p>The 64bit binary packs of the OpenFOAM release were compiled on a machine
running SuSE GNU/Linux version 10.3 and the 32bit on a machine running Ubuntu
GNU/Linux version 7.1 and also tested on Ubuntu 8.04. We recommend that
users run OpenFOAM on one of these or a similar recent version of GNU/Linux.
This release has also been successfully compiled and tested on older GNU/Linux
releases but this requires the installation of Qt 4.3.? for ParaView-3 to run.
</p>
</div>
</div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3">3 C++ Compiler version</h2>
<div id="text-3">
<ul>
<li>
Released compiled with GCC 4.3.1, the latest version.
</li>
<li>
Built in support for the Intel C++ 10.? compiler (untested).
</li>
<li>
The choice of the compiler is controlled by the setting of the $WM_COMPILER
and $WM_COMPILER_ARCH environment variables in the OpenFOAM-1.5/etc/bashrc
(or cshrc) file.
</li>
<li>
The location of the installation of the compiler is controlled by the
$WM_COMPILER_INST environment variable in the OpenFOAM-1.5/etc/settings.sh
(or settings.csh) file.
</li>
</ul>
</div>
</div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4">4 Developments to solvers (applications)</h2>
<div id="text-4">
<ul>
<li>
New rhoCentralFoam solver for high-speed, viscous, compressible flows using
non-oscillatory, central-upwind schemes.
</li>
<li>
New interDyMFoam solver for 2 incompressible, isothermal, immiscible fluids
using a VoF phase-fraction based interface capturing approach, with optional
mesh motion and mesh topology changes including adaptive mesh
(un)refinement. Useful for simulations such as tank filling, sloshing ---
using solid body motion e.g. SDA or SKA (6DoF) &mdash; and slamming (using the
mesh motion solver) and other large-scale applications that benefit from the
efficiency gain of adaptive mesh (un)refinement of the interface.
</li>
<li>
New compressibleInterFoam solver for 2 compressible, isothermal, immiscible
fluids using a volume of fluid (VoF) phase-fraction approach for
interface-capturing. The momentum and other fluid properties are of the
"mixture" and a single momentum equation is solved. Turbulence is modelled
using a run-time selectable incompressible LES model.
</li>
<li>
New interPhaseChangeFoam solver for 2 incompressible, isothermal, immiscible
fluids with phase-change, e.g. cavitation. Uses VoF interface capturing,
with momentum and other fluid properties described for the ``mixture'' and a
single momentum equation is solved. The set of phase-change models provided
are designed to simulate cavitation but other mechanisms of phase-change are
supported within this solver framework.
</li>
<li>
New rasCavitatingFoam solver for transient cavitation using a barotropic
compressibility model, with RAS turbulence.
</li>
<li>
New lesCavitatingFoam solver for transient cavitation using a barotropic
compressibility model, with LES turbulence.
</li>
<li>
New chtMultiRegionFoam solver that couples conjugate heat transfer in a
solid to a buoyancy-driven flow simulation.
</li>
<li>
New PDRFoam solver for compressible premixed/partially-premixed turbulent
combustion that includes porosity/distributed resistance (PDR) modelling to
handle regions containing solid blockages which cannot be resolved by the
mesh. Requires the PDR fields.
</li>
<li>
New lesBuoyantFoam solver for transient, buoyant, turbulent flow of
compressible fluids for ventilation and heat-transfer. Turbulence is
modelled using a run-time selectable compressible LES model.
</li>
<li>
New rhoPimpleFoam solver for transient, turbulent flow of compressible
fluids for ventilation and heat-transfer. Uses the flexible PIMPLE
(PISO-SIMPLE) solution for time-resolved and pseudo-transient simulations.
</li>
<li>
New buoyantSimpleRadiationFoam solver for steady-state, buoyant, turbulent
flow of compressible fluids with radiation, for ventilation and
heat-transfer.
</li>
<li>
New rhoTurbTwinParcelFoam solver for transient for compressible, turbulent
flow with two thermo-clouds.
</li>
<li>
New gnemdFOAM solver for general purpose molecular dynamics that simulates
atoms in arbitrary shaped domains and average atomic/molecular quantities to
the mesh to create field data.
</li>
<li>
New mdEqulibrationFoam solver to equilibrates and/or preconditions molecular
dynamics systems.
</li>
<li>
Demonstration SRFSimpleFoam solver based on simpleFoam that incorporates the
SRF extensions (see below) for rotating flows.
</li>
</ul>
</div>
</div>
<div id="outline-container-5" class="outline-2">
<h2 id="sec-5">5 Automatic mesher</h2>
<div id="text-5">
<p>New snappyHexMesh utility that generates split-hex meshes automatically from
triangulated (STL) surface geometries. The mesh approximately conforms to
the surface by iteratively refining a starting mesh and morphing the
resulting split-hex mesh to the surface. An optional phase will shrink back
the resulting mesh and insert cell layers. It has a flexible specification
of mesh refinement level and robust surface handling with a pre-specified
final mesh quality. It runs in parallel with a load balancing step every
iteration.
</p>
</div>
</div>
<div id="outline-container-6" class="outline-2">
<h2 id="sec-6">6 Developments to utilities</h2>
<div id="text-6">
<ul>
<li>
New extrude2DMesh utility that extrudes 2D meshes into a 3D mesh. 2D meshes
are described by faces with 2 points, so can be used in combination with 2D
meshes converted with ccm26ToFoam.
</li>
<li>
New couplePatches functionality integrated into createPatch, which
optionally synchronises ("couples") points and faces of coupled (cyclic,
processor) patches.
</li>
<li>
New applyBoundaryLayer pre-processing utility to apply 1/7th power-law
boundary layers at walls, starting from uniform or potential flow solutions.
</li>
<li>
New execFlowFunctionObjects utility executes functionObjects as a
post-processing activity, e.g. probes, sampling, force calculation.
</li>
<li>
New changeDictionary utility makes batch changes to OpenFOAM input files,
e.g. to change boundary conditions of field files.
</li>
<li>
New foamCalc utility, a generic post-processing field calculator tool
</li>
<li>
New molConfig pre-processing utility for molecular dynamics cases. Fills
zones of a mesh with single crystal lattices of specified structure,
density, orientation, alignment and temperature.
</li>
<li>
Extended splitMeshRegions utility to split multi-zone meshes, e.g. defined
through cellZones, into separate meshes.
</li>
<li>
Extended the foamToVTK, decomposePar, reconstructPar and mapFields utilities
to include support for multiple particle clouds in parallel processing.
</li>
</ul>
</div>
</div>
<div id="outline-container-7" class="outline-2">
<h2 id="sec-7">7 Migration from ParaView 2.4 to ParaView 3.x</h2>
<div id="text-7">
<ul>
<li>
Rewritten OpenFOAM Reader Module for version 3, a major redesign of
ParaView.
</li>
<li>
New features include viewing patch names, reading of Lagrangian data,
handling of cell, face and point sets, multiple views.
</li>
</ul>
</div>
</div>
<div id="outline-container-8" class="outline-2">
<h2 id="sec-8">8 Model development</h2>
<div id="text-8">
<ul>
<li>
Overhauled the lagrangian library to support multiple clouds.
</li>
<li>
New lagrangianIntermediate library incorporating a hierarchy of parcel and
cloud types, accommodating kinematic, thermodynamic and reacting
applications, including coupling to the new radiation library. Sub-models
are added at the relevant level of physics, e.g.:
<ul>
<li>
kinematic: injection, wall interaction, drag, dispersion;
</li>
<li>
thermo: heat transfer;
</li>
<li>
reacting: reacting composition, mass transfer, surface reactions.
</li>
</ul>
</li>
<li>
New single rotating frame of reference (SRF) library for rotating flow
applications, e.g. turbo-machinery.
</li>
<li>
New radiation library including the P1 model and associated Marshak boundary
conditions for incident radiation.
</li>
<li>
New displacementInterpolation motion solver for flexible mesh scaling.
</li>
<li>
New molecularDynamics Lagrangian library to calculate intermolecular forces
between spherically symmetrical monatomic species in arbitrary geometries.
</li>
</ul>
</div>
</div>
<div id="outline-container-9" class="outline-2">
<h2 id="sec-9">9 New functionObjects</h2>
<div id="text-9">
<p>To aid common monitoring and post-processing activities.
</p><ul>
<li>
forces: calculate the force and moment on a patch or set of patches, e.g. to
calculate the lift, drag and moment of an object in the flow.
</li>
<li>
forceCoeffs: calculate the normalised force and moment on a patch or set of
patches, e.g. to calculate the lift, drag and moment coefficients of an
object in the flow.
</li>
<li>
fieldAverage: calculate field arithmetic mean and prime-squared averages for
a list of fields.
</li>
<li>
foamCalcFunctions: calculate field components, div, mag, magGrad or magSqr.
</li>
</ul>
</div>
</div>
<div id="outline-container-10" class="outline-2">
<h2 id="sec-10">10 Improvements to boundary conditions</h2>
<div id="text-10">
<ul>
<li>
Generalised jumpCyclic type: cyclic condition with an additional prescribed
jump in value.
</li>
<li>
fan type: specialisation of jumpCyclic, applying a prescribed jump in
pressure to simulate a fan within a mesh.
</li>
<li>
Generalised advective outflow boundary condition based on solving D/Dt(psi,
U) = 0 at the boundary.
</li>
<li>
Additional turbulent flow inlet to specify mixing length and frequency.
</li>
<li>
Generalisation of time varying set of boundary conditions.
</li>
</ul>
</div>
</div>
<div id="outline-container-11" class="outline-2">
<h2 id="sec-11">11 Other</h2>
<div id="text-11">
<ul>
<li>
New argument-free command execution, e.g typing "icoFoam" without root and
case directory arguments.
</li>
<li>
Extended time command line options.
</li>
<li>
Many enhancements to dictionary including macro substitution, optional
merging and default/overwrite behaviour, enhanced "#include" file handling
and the framework to support function evaluation.
</li>
<li>
Cross-links between applications and Doxygen documentation with the "-doc"
argument.
</li>
<li>
Non-blocking, non-buffered, parallel transfers with potential scaling
benefits for larger number of processors.
</li>
</ul>
</div>
</div>
<div id="postamble"><p class="date"> Date: 10 July 2008</p>
<p>HTML generated by org-mode 6.05a in emacs 23<p>
</div></body>
</html>

View File

@ -3,4 +3,4 @@ U/maxwellSlipUFvPatchVectorField.C
T/smoluchowskiJumpTFvPatchScalarField.C
rho/fixedRhoFvPatchScalarField.C
LIB = $(FOAM_USER_LIBBIN)/librhoCentralFoam
LIB = $(FOAM_LIBBIN)/librhoCentralFoam

View File

@ -28,7 +28,7 @@
),
// Divergence term is handled explicitly to be
// consistent with the explicit transport solution
divU*min(alpha1, 1.0)
divU*min(alpha1, scalar(1))
);
forAll(dgdt, celli)

View File

@ -140,7 +140,7 @@
);
volScalarField dgdt =
pos(alpha2)*fvc::div(phi)/max(alpha2, 0.0001);
pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001));
// Construct interface from alpha1 distribution
interfaceProperties interface(alpha1, U, twoPhaseProperties);

View File

@ -40,7 +40,10 @@
solve
(
(max(alpha1, 0.0)*(psi1/rho1) + max(alpha2, 0.0)*(psi2/rho2))
(
max(alpha1, scalar(0))*(psi1/rho1)
+ max(alpha2, scalar(0))*(psi2/rho2)
)
*pdEqnComp()
+ pdEqnIncomp
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,8 +26,15 @@ Description
Utility to create patches out of selected boundary faces. Faces come either
from existing patches or from a faceSet.
More specifically it:
- creates new patches (from selected boundary faces). Synchronise faces
on coupled patches.
- synchronises points on coupled boundaries
- remove patches with 0 faces in them
\*---------------------------------------------------------------------------*/
#include "syncTools.H"
#include "argList.H"
#include "polyMesh.H"
#include "Time.H"
@ -48,6 +55,23 @@ namespace Foam
defineTemplateTypeNameAndDebug(IOPtrList<dictionary>, 0);
}
// Combine operator to synchronise points. We choose point nearest to origin so
// we can use e.g. great,great,great as null value.
class nearestEqOp
{
public:
void operator()(vector& x, const vector& y) const
{
if (magSqr(y) < magSqr(x))
{
x = y;
}
}
};
label getPatch(const polyBoundaryMesh& patches, const word& patchName)
{
@ -55,7 +79,7 @@ label getPatch(const polyBoundaryMesh& patches, const word& patchName)
if (patchI == -1)
{
FatalErrorIn("createPatch")
FatalErrorIn("createPatch(const polyBoundaryMesh&, const word&)")
<< "Cannot find source patch " << patchName
<< endl << "Valid patch names are " << patches.names()
<< exit(FatalError);
@ -105,47 +129,174 @@ void changePatchID
// Filter out the empty patches.
void filterPatches(polyMesh& mesh)
{
Info<< "Filtering empty patches." << endl;
const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Old patches.
// Patches to keep
DynamicList<polyPatch*> allPatches(patches.size());
labelList compactPatchMap(patches.size());
label nOldPatches = returnReduce(patches.size(), sumOp<label>());
// Copy old patches.
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.size() > 0)
// Note: reduce possible since non-proc patches guaranteed in same order
if (!isA<processorPolyPatch>(pp))
{
compactPatchMap[patchI] = allPatches.size();
allPatches.append
(
pp.clone
if (returnReduce(pp.size(), sumOp<label>()) > 0)
{
allPatches.append
(
patches,
allPatches.size(),
pp.size(),
pp.start()
).ptr()
);
}
else
{
Info<< "Removing empty patch " << pp.name() << " at position "
<< patchI << endl;
compactPatchMap[patchI] = -1;
pp.clone
(
patches,
allPatches.size(),
pp.size(),
pp.start()
).ptr()
);
}
else
{
Info<< "Removing empty patch " << pp.name() << " at position "
<< patchI << endl;
}
}
}
allPatches.shrink();
// Copy non-empty processor patches
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
mesh.removeBoundary();
mesh.addPatches(allPatches);
if (isA<processorPolyPatch>(pp))
{
if (pp.size() > 0)
{
allPatches.append
(
pp.clone
(
patches,
allPatches.size(),
pp.size(),
pp.start()
).ptr()
);
}
else
{
Info<< "Removing empty processor patch " << pp.name()
<< " at position " << patchI << endl;
}
}
}
label nAllPatches = returnReduce(allPatches.size(), sumOp<label>());
if (nAllPatches != nOldPatches)
{
Info<< "Removing patches." << endl;
allPatches.shrink();
mesh.removeBoundary();
mesh.addPatches(allPatches);
}
else
{
Info<< "No patches removed." << endl;
}
}
// Dump for all patches the current match
void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
{
if (isA<cyclicPolyPatch>(patches[patchI]))
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patches[patchI]);
label halfSize = cycPatch.size()/2;
// Dump halves
{
OFstream str(prefix+cycPatch.name()+"_half0.obj");
meshTools::writeOBJ
(
str,
static_cast<faceList>
(
SubList<face>
(
cycPatch,
halfSize
)
),
cycPatch.points()
);
}
{
OFstream str(prefix+cycPatch.name()+"_half1.obj");
meshTools::writeOBJ
(
str,
static_cast<faceList>
(
SubList<face>
(
cycPatch,
halfSize,
halfSize
)
),
cycPatch.points()
);
}
// cycPatch.writeOBJ
// (
// prefix+cycPatch.name()+"_half0.obj",
// SubList<face>
// (
// cycPatch,
// halfSize
// ),
// cycPatch.points()
// );
// cycPatch.writeOBJ
// (
// prefix+cycPatch.name()+"_half1.obj",
// SubList<face>
// (
// cycPatch,
// halfSize,
// halfSize
// ),
// cycPatch.points()
// );
// Lines between corresponding face centres
OFstream str(prefix+cycPatch.name()+"_match.obj");
label vertI = 0;
for (label faceI = 0; faceI < halfSize; faceI++)
{
const point& fc0 = mesh.faceCentres()[cycPatch.start()+faceI];
meshTools::writeOBJ(str, fc0);
vertI++;
label nbrFaceI = halfSize + faceI;
const point& fc1 = mesh.faceCentres()[cycPatch.start()+nbrFaceI];
meshTools::writeOBJ(str, fc1);
vertI++;
str<< "l " << vertI-1 << ' ' << vertI << nl;
}
}
}
}
@ -153,100 +304,148 @@ void filterPatches(polyMesh& mesh)
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.insert("overwrite", "");
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
bool overwrite = args.options().found("overwrite");
const bool overwrite = args.options().found("overwrite");
Info<< "Reading createPatchDict\n" << endl;
Info<< "Reading createPatchDict." << nl << endl;
PtrList<dictionary> patchSources
IOdictionary dict
(
IOdictionary
IOobject
(
IOobject
(
"createPatchDict",
runTime.system(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
).lookup("patches")
"createPatchDict",
runTime.system(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
// Whether to synchronise points
const Switch pointSync(dict.lookup("pointSync"));
// Set the matching tolerance so we can read illegal meshes
scalar tol = readScalar(dict.lookup("matchTolerance"));
Info<< "Using relative tolerance " << tol
<< " to match up faces and points" << nl << endl;
coupledPolyPatch::matchTol = tol;
# include "createPolyMesh.H"
const polyBoundaryMesh& patches = mesh.boundaryMesh();
// If running parallel check same patches everywhere
patches.checkParallelSync(true);
// 1. All all new patches
dumpCyclicMatch("initial_", mesh);
// Read patch construct info from dictionary
PtrList<dictionary> patchSources(dict.lookup("patches"));
// 1. Add all new patches
// ~~~~~~~~~~~~~~~~~~~~~~
// Old and new patches.
DynamicList<polyPatch*> allPatches(patches.size() + patchSources.size());
// Copy old patches.
forAll(patches, patchI)
if (patchSources.size() > 0)
{
const polyPatch& pp = patches[patchI];
// Old and new patches.
DynamicList<polyPatch*> allPatches(patches.size()+patchSources.size());
Info<< "Copying patch " << pp.name() << " at position "
<< patchI << endl;
label startFaceI = mesh.nInternalFaces();
allPatches.append
(
pp.clone
(
patches,
patchI,
pp.size(),
pp.start()
).ptr()
);
}
forAll(patchSources, addedI)
{
const dictionary& dict = patchSources[addedI];
word patchName(dict.lookup("name"));
label destPatchI = patches.findPatchID(patchName);
word patchType(dict.lookup("type"));
if (destPatchI == -1)
// Copy old patches.
forAll(patches, patchI)
{
destPatchI = allPatches.size();
const polyPatch& pp = patches[patchI];
Info<< "Adding new patch " << patchName << " of type " << patchType
<< " as patch " << destPatchI << endl;
// Add an empty patch.
allPatches.append
(
polyPatch::New
if (!isA<processorPolyPatch>(pp))
{
allPatches.append
(
patchType,
patchName,
0,
mesh.nFaces(),
destPatchI,
patches
).ptr()
);
pp.clone
(
patches,
patchI,
pp.size(),
startFaceI
).ptr()
);
startFaceI += pp.size();
}
}
forAll(patchSources, addedI)
{
const dictionary& dict = patchSources[addedI];
word patchName(dict.lookup("name"));
label destPatchI = patches.findPatchID(patchName);
word patchType(dict.lookup("type"));
if (destPatchI == -1)
{
destPatchI = allPatches.size();
Info<< "Adding new patch " << patchName
<< " of type " << patchType
<< " as patch " << destPatchI << endl;
// Add an empty patch.
allPatches.append
(
polyPatch::New
(
patchType,
patchName,
0, // size
startFaceI, // start
destPatchI,
patches
).ptr()
);
}
}
// Copy old patches.
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (isA<processorPolyPatch>(pp))
{
allPatches.append
(
pp.clone
(
patches,
patchI,
pp.size(),
startFaceI
).ptr()
);
startFaceI += pp.size();
}
}
allPatches.shrink();
mesh.removeBoundary();
mesh.addPatches(allPatches);
Info<< endl;
}
allPatches.shrink();
mesh.removeBoundary();
mesh.addPatches(allPatches);
// 2. Repatch faces
@ -303,8 +502,8 @@ int main(int argc, char *argv[])
faceSet faces(mesh, setName);
Info<< "Read " << faces.size() << " faces from faceSet "
<< faces.name() << endl;
Info<< "Read " << returnReduce(faces.size(), sumOp<label>())
<< " faces from faceSet " << faces.name() << endl;
// Sort (since faceSet contains faces in arbitrary order)
labelList faceLabels(faces.toc());
@ -341,15 +540,45 @@ int main(int argc, char *argv[])
<< "Valid source types are 'patches' 'set'" << exit(FatalError);
}
}
// Change mesh, no inflation
meshMod.changeMesh(mesh, false);
Info<< endl;
// Change mesh, use inflation to reforce calculation of transformation
// tensors.
Info<< "Doing topology modification to order faces." << nl << endl;
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, true);
mesh.movePoints(map().preMotionPoints());
// Synchronise points.
if (!pointSync)
{
Info<< "Not synchronising points." << nl << endl;
}
else
{
Info<< "Synchronising points." << endl;
pointField newPoints(mesh.points());
syncTools::syncPointList
(
mesh,
newPoints,
nearestEqOp(), // cop
point(GREAT, GREAT, GREAT), // nullValue
true // applySeparation
);
scalarField diff(mag(newPoints-mesh.points()));
Info<< "Points changed by average:" << gAverage(diff)
<< " max:" << gMax(diff) << nl << endl;
mesh.movePoints(newPoints);
}
// 3. Remove zeros-sized patches
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Info<< "Removing patches with no faces in them." << nl<< endl;
filterPatches(mesh);
@ -363,7 +592,7 @@ int main(int argc, char *argv[])
}
// Write resulting mesh
Info<< "Writing repatched mesh to " << runTime.timeName() << endl;
Info<< "Writing repatched mesh to " << runTime.timeName() << nl << endl;
mesh.write();
Info<< "End\n" << endl;

View File

@ -26,6 +26,12 @@ FoamFile
// face times this factor.
matchTolerance 1E-3;
// Do a synchronisation of coupled points.
pointSync true;
// Patches to create.
// If no patches does a coupled point and face synchronisation anyway.
patches
(
{

View File

@ -24,7 +24,7 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# buildParaView
# buildParaView3.3-cvs
#
# Description
# Build and install ParaView
@ -38,32 +38,57 @@
PARAVIEW_SRC="ParaView3.3-cvs"
PARAVIEW_MAJOR_VERSION="3.3"
VERBOSE=OFF
INCLUDE_MPI=ON
# User options
# ~~~~~~~~~~~~
# MPI suport
INCLUDE_MPI=OFF
MPI_MAX_PROCS=32
INCLUDE_PYTHON=ON
# Python
# note: script will try to determine python library. If it fails, specify the
# path using the PYTHON_LIBRARY variable
INCLUDE_PYTHON=OFF
#PYTHON_LIBRARY="/usr/lib64/libpython2.5.so.1.0"
PYTHON_LIBRARY=""
# MESA graphics
INCLUDE_MESA=OFF
# No further editing should be required below this line
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set +x
# provide a shortcut for repeated builds - use with caution
# Provide a shortcut for repeated builds - use with caution
if [ "$#" -gt 0 ]
then
CMAKE_SKIP=YES
fi
# Initialisation
#~~~~~~~~~~~~~~~
initialiseVariables
# Set configure options
#~~~~~~~~~~~~~~~~~~~~~~
addMpiSupport # set MPI specific options
addPythonSupport # set python specific options
addMesaSupport # set MESA specific options
# Build and install
# ~~~~~~~~~~~~~~~~~
buildParaView
installParaView
echo "done"
#------------------------------------------------------------------------------

View File

@ -27,51 +27,60 @@
# foamInstallationTest
#
# Description
# Checks the machine system, the installation of FOAM, and the user's
# personal configuration for running FOAM.
# Checks the machine system, the installation of OpenFOAM, and the user's
# personal configuration for running OpenFOAM.
#
#------------------------------------------------------------------------------
# SETTINGS
#~~~~~~~~~
FOAM_VERSION=1.4.2
GCC_VERSION=4.2.2
GZIP_VERSION=1.3.5
GTAR_VERSION=1.13.25
JAVA_VERSION=1.4.2+
# Base settings
FOAM_VERSION=1.5
SUPPLIED_VERSION_GCC=4.3.1
MIN_VERSION_GCC=4.2.0
#GLOBAL VARIABLES
# General
WIDTH=20
# Global variables
FATALERROR=0
CRITICALERROR=0
SSHRSHOK=0
#SYSTEM VARIABLES
# System variables
USER_SHELL=`basename $SHELL`
HOST_NAME=`uname -n`
OS=`uname -s`
OS_VERSION=`uname -r`
USER_NAME=$LOGNAME
if [ ! -n $USER_NAME ]; then
USER_NAME=$USER
fi
#==============================================================================
# HELPER FUNCTIONS
#==============================================================================
# FUNCTIONS
#~~~~~~~~~~
hline () {
echo "-------------------------------------------------------------------------------"
}
expenv () {
eval "echo $1"
}
heading () {
echo ""
echo ""
echo "$1"
}
lenBase () {
echo $1 | tr -d " " | wc -m | tr -d " "
echo $1 | tr -d " " | wc -m | tr -d " "
}
length () {
NOCHAR=`lenBase $1`
NOCHAR=`expr $NOCHAR - 1`
@ -81,10 +90,12 @@ length () {
echo $NOCHAR
}
stringLength () {
echo $1 | wc -m | tr -d " "
}
fixlen () {
WORD=$1
ONELEN=`stringLength $1`
@ -102,6 +113,7 @@ fixlen () {
fi
}
reportEnv () {
EXP_ENV=`eval "echo $1"`
EXP_PATH=`eval "echo $2"`
@ -119,7 +131,12 @@ reportEnv () {
IFS=':'
for e in $EXP_PATH
do
if [ "$e" = "$EXP_ENV" -o "$e" = "${EXP_ENV}/bin" -o "${EXP_ENV}/lib" = "$e" ] ; then
if \
[ \
"$e" = "$EXP_ENV" \
-o "$e" = "${EXP_ENV}/bin" \
-o "${EXP_ENV}/lib" = "$e" \
] ; then
ON_PATH="yes "
fi
done
@ -141,7 +158,12 @@ reportEnv () {
IFS=':'
for e in $EXP_PATH
do
if [ "$e" = "$EXP_ENV" -o "$e" = "${EXP_ENV}/bin" -o "${EXP_ENV}/lib" = "$e" ] ; then
if \
[ \
"$e" = "$EXP_ENV" \
-o "$e" = "${EXP_ENV}/bin" \
-o "${EXP_ENV}/lib" = "$e" \
] ; then
ON_PATH="yes "
fi
done
@ -171,6 +193,7 @@ reportEnv () {
}
findExec() {
OLD_IFS=$IFS
IFS=':'
@ -197,140 +220,117 @@ findExec() {
return 1
}
reportExecutable () {
APP_PATH=""
APP_PATH=`findExec $PATH $1`
APP_SPEC="$2"
if [ `length $APP_PATH` -eq 0 ];then
if [ ! -n $APP_PATH ];then
echo "`fixlen "$1" 9`" "*** not installed ***"
VERSION=""
case $1 in
icoFoam) echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1` ;;
gcc) echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1`;;
icoFoam)
echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1`
;;
gcc)
echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1`
;;
tar) ;;
gtar) ;;
gzip) ;;
dx) ;;
java) ;;
esac
echo
return 1
fi
case $1 in
icoFoam) VERSION=`$1 2>&1 | grep ' Version:' | sed -e 's/.*Version:/Version:/' | cut -d" " -f2`;;
gcc) VERSION=`$1 -v 2>&1 | grep 'version' | cut -d" " -f3`;;
gtar) VERSION=`$APP_PATH --version | head -1`;;
icoFoam)
VERSION=`$1 2>&1 \
| \grep ' Version:' \
| sed -e 's/.*Version:/Version:/' \
| cut -d" " -f3`
;;
gcc)
VERSION=`$1 -v 2>&1 \
| grep 'version' \
| cut -d" " -f3`
if [ ! "$VERSION" = "$SUPPLIED_VERSION_GCC" ]; then
echo "WARNING: gcc version does not match gcc supplied" \
"with this release of OpenFOAM"
echo " Supplied version: $SUPPLIED_VERSION_GCC"
echo " User version : $VERSION"
echo " Minimum required: $MIN_VERSION_GCC"
echo ""
fi
;;
gtar)
VERSION=`$APP_PATH --version | head -1`
;;
tar)
VERSION=`$APP_PATH --version | head -1 | cut -d" " -f4`
;;
gzip)
case $OS in
SunOS) VERSION=`$1 --version 2>&1 | grep gzip | cut -d" " -f2`;;
*) VERSION=`$1 --version | head -1 | cut -d" " -f2`;;
SunOS)
VERSION=`$1 --version 2>&1 | grep gzip | cut -d" " -f2`
;;
*)
VERSION=`$1 --version | head -1 | cut -d" " -f2`
;;
esac
;;
dx) unset DXEXEC; VERSION=`$1 -version 2>&1 | grep 'Open ' | grep 'Script' | cut -d" " -f6`;;
java) VERSION=`$1 -version 2>&1 | grep 'version' | cut -d" " -f3 | tr -d "\""`;;
esac
if [ "$APP_PATH" = "$APP_SPEC" ] || [ ! "$2" ]; then
echo "`fixlen "$1" 9` `fixlen "$VERSION" 10` `fixlen "$APP_PATH" 58`"
else
echo "`fixlen "$1" 9` `fixlen "$VERSION" 10`"
echo "WARNING: Conflicting installations:"
echo " foam settings: $APP_SPEC"
echo " current path : $APP_PATH"
echo " OpenFOAM settings : $APP_SPEC"
echo " current path : $APP_PATH"
case $1 in
icoFoam) echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1` ;;
gcc) echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1`;;
icoFoam)
echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1`
;;
gcc)
echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1`
;;
gtar) ;;
gzip) ;;
dx) ;;
java) ;;
esac
echo
echo ""
fi
}
checkPermissions () {
PERMISSIONS=""
case $OS in
SunOS)
if /usr/bin/test -e "$1" ; then
if /usr/bin/test -r $1 ; then
PERMISSIONS="${PERMISSIONS}r"
else
PERMISSIONS="${PERMISSIONS} "
fi
if /usr/bin/test -w $1 ; then
PERMISSIONS="${PERMISSIONS}w"
else
PERMISSIONS="${PERMISSIONS} "
fi
if /usr/bin/test -w $1 ; then
PERMISSIONS="${PERMISSIONS}x"
else
PERMISSIONS="${PERMISSIONS} "
fi
echo "`fixlen "$1" 50` `fixlen "$PERMISSIONS" 5` `fixlen "$2" 5` `fixlen "$3" 6`"
else
echo "`fixlen "$1" 50` does not exist `fixlen "" 10` `fixlen "$3" 6`"
fi
;;
*)
if [ -e "$1" ] ; then
if [ -r $1 ] ; then
PERMISSIONS="${PERMISSIONS}r"
else
PERMISSIONS="${PERMISSIONS} "
fi
if [ -w $1 ] ; then
PERMISSIONS="${PERMISSIONS}w"
else
PERMISSIONS="${PERMISSIONS} "
fi
if [ -w $1 ] ; then
PERMISSIONS="${PERMISSIONS}x"
else
PERMISSIONS="${PERMISSIONS} "
fi
echo "`fixlen "$1" 50` `fixlen "$PERMISSIONS" 5` `fixlen "$2" 5` `fixlen "$3" 6`"
else
echo "`fixlen "$1" 50` does not exist `fixlen "" 10` `fixlen "$3" 6`"
fi
;;
esac
if [ "$3" = "yes" ] && [ ! "$PERMISSIONS" = "$2" ]; then
CRITICALERROR=`expr $CRITICALERROR + 1`
echo "WARNING: CRITICAL ERROR"
echo
fi
}
pingTest () {
RESULT=""
case $OS in
SunOS)
PINGTEST=`/usr/sbin/ping $1 2>&1`
if [ "`echo $PINGTEST | grep "alive"`" != "" ] ; then
RESULT="Successful"
elif [ "`echo $PINGTEST | grep "unknown host"`" != "" ] ; then
RESULT="No_entry_for_\"$1\"_in_/etc/hosts"
else
RESULT="Networking_cannot_reach_$1"
fi
;;
*)
PINGTEST=`/bin/ping -w 3 -c 1 $1 2>&1`
RESULT=""
case $OS in
SunOS)
PINGTEST=`/usr/sbin/ping $1 2>&1`
if [ "`echo $PINGTEST | grep "alive"`" != "" ] ; then
RESULT="Successful"
elif [ "`echo $PINGTEST | grep "unknown host"`" != "" ] ; then
RESULT="No_entry_for_\"$1\"_in_/etc/hosts"
else
RESULT="Networking_cannot_reach_$1"
fi
;;
*)
PINGTEST=`/bin/ping -w 3 -c 1 $1 2>&1`
if [ "`echo $PINGTEST | grep "1 received"`" != "" ] ; then
RESULT="Successful"
elif [ "`echo $PINGTEST | grep "unknown host"`" != "" ] ; then
RESULT="No_entry_for_\"$1\"_in_/etc/hosts"
else
RESULT="Networking_cannot_reach_$1"
fi
;;
esac
# echo "inna pingtest2 $1 $RESULT" 1>&2
RESULT="Successful"
elif [ "`echo $PINGTEST | grep "unknown host"`" != "" ] ; then
RESULT="No_entry_for_\"$1\"_in_/etc/hosts"
else
RESULT="Networking_cannot_reach_$1"
fi
;;
esac
echo "`fixlen "Pinging_$1" 25` `fixlen "$RESULT" 45` `fixlen "$2" 5`"
@ -341,6 +341,7 @@ esac
fi
}
telnetPortTest () {
telnet -e A $1 $2 <<EOF
A
@ -348,213 +349,165 @@ quit
EOF
}
checkTelnetPort () {
if [ -x "/usr/bin/telnet" ] || [ -x "/bin/telnet" ] ; then
RESULT=`telnetPortTest $1 $2 2>&1 | egrep "onnect.* [t|r]"`
if [ "`echo $RESULT | grep 'Connected to'`" ] ; then
RESULT='Successful'
elif [ "`echo $RESULT | grep 'Connection refused'`" ] ; then
RESULT='Unsuccessful_connection_refused*'
if [ -x "/usr/bin/telnet" ] || [ -x "/bin/telnet" ] ; then
RESULT=`telnetPortTest $1 $2 2>&1 | egrep "onnect.* [t|r]"`
if [ "`echo $RESULT | grep 'Connected to'`" ] ; then
RESULT='Successful'
elif [ "`echo $RESULT | grep 'Connection refused'`" ] ; then
RESULT='Unsuccessful_connection_refused*'
else
RESULT="Not_active*"
fi
else
RESULT="Not_active*"
RESULT='No_telnet_running:_cannot_check*'
fi
else
RESULT='No_telnet_running:_cannot_check*'
fi
}
checkRsh () {
checkTelnetPort $HOST_NAME 222
echo "`fixlen "Test_rsh:" 25` `fixlen "$RESULT" 45` "yes""
if [ "$RESULT" != 'Successful' ]; then
SSHRSHOK=`expr $SSHRSHOK + 1`
fi
checkTelnetPort $HOST_NAME 222
echo "`fixlen "Test_rsh:" 25` `fixlen "$RESULT" 45` "yes""
if [ "$RESULT" != 'Successful' ]; then
SSHRSHOK=`expr $SSHRSHOK + 1`
fi
}
checkSsh () {
checkTelnetPort $HOST_NAME 22
echo "`fixlen "Test_ssh:" 25` `fixlen "$RESULT" 45` "yes""
if [ "$RESULT" != 'Successful' ]; then
SSHRSHOK=`expr $SSHRSHOK + 1`
fi
checkTelnetPort $HOST_NAME 22
echo "`fixlen "Test_ssh:" 25` `fixlen "$RESULT" 45` "yes""
if [ "$RESULT" != 'Successful' ]; then
SSHRSHOK=`expr $SSHRSHOK + 1`
fi
}
checkOpenFOAMEnvironment() {
if [ ! -d "$WM_PROJECT_INST_DIR" -o ! -d "$WM_THIRD_PARTY_DIR" ]; then
echo ""
echo "FATAL ERROR: OpenFOAM environment not configured."
echo ""
echo " Please refer to the installation section of the README file:"
echo " <OpenFOAM installation dir>/OpenFOAM-${FOAM_VERSION}/README"
echo " to source the OpenFOAM environment."
echo ""
exit 1
fi
}
# REMAINING ARGUMENTS
#~~~~~~~~~~~~~~~~~~~~
#
#------------
# MAIN SCRIPT
#------------
checkUserShell() {
case $USER_SHELL in
csh | tcsh)
USER_CONFIG_TYPE="cshrc"
echo "`fixlen "Shell:" $WIDTH` ${USER_SHELL}"
;;
bash | ksh)
USER_CONFIG_TYPE="bashrc"
echo "`fixlen "Shell:" $WIDTH` ${USER_SHELL}"
;;
*) USER_CONFIG_TYPE=""
echo "`fixlen "Shell:" $WIDTH` ${USER_SHELL}"
echo "FATAL ERROR: Cannot identify the shell you are running."
echo " OpenFOAM ${FOAM_VERSION} is compatible with "
echo " csh, tcsh, ksh and bash."
echo
FATALERROR=`expr $FATALERROR + 1`;;
esac
}
checkHostName() {
if [ ! "$HOST_NAME" ]; then
echo "`fixlen "Host:" $WIDTH` ${HOST_NAME}"
echo "FATAL ERROR: Cannot stat hostname."
echo " Contact your system administrator, "
echo " OpenFOAM ${FOAM_VERSION} needs a valid "
echo " hostname to function."
echo
FATALERROR=`expr $FATALERROR + 1`
else
echo "`fixlen "Host:" $WIDTH` ${HOST_NAME}"
fi
}
checkOS () {
if [ "$OS" = "Linux" ] || [ "$OS" = "LinuxAMD64" ] || [ "$OS" = "SunOS" ]; then
echo "`fixlen "OS:" $WIDTH` ${OS} version ${OS_VERSION}"
else
echo "FATAL ERROR: Incompatible operating system \"$OS\"."
echo " OpenFOAM ${FOAM_VERSION} is currently "
echo " available for Linux and SunOS only."
echo
FATALERROR=`expr $FATALERROR + 1`
fi
}
#==============================================================================
# MAIN SCRIPT
#==============================================================================
#
echo "Executing $0:"
#
#------------------------------------------------------------------------------
heading "Checking basic setup..."
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hline #----------
USER_SHELL=`basename $SHELL`
HOST_NAME=`uname -n`
OS=`uname -s`
OS_VERSION=`uname -r`
USER_NAME=$LOGNAME
WIDTH=20
if [ `length $USER_NAME` -eq 0 ] ; then
USER_NAME=$USER
fi
#
case $USER_SHELL in
csh | tcsh)
USER_CONFIG_TYPE="cshrc"
echo "`fixlen "Shell:" $WIDTH` ${USER_SHELL}"
;;
bash | ksh)
USER_CONFIG_TYPE="bashrc"
echo "`fixlen "Shell:" $WIDTH` ${USER_SHELL}"
;;
*) USER_CONFIG_TYPE=""
echo "`fixlen "Shell:" $WIDTH` ${USER_SHELL}"
echo "FATAL ERROR: Cannot identify the shell you are running."
echo " Fam ${FOAM_VERSION} is compatible with "
echo " csh, tcsh, ksh and bash."
echo
FATALERROR=`expr $FATALERROR + 1`;;
esac
#
if [ ! "$HOST_NAME" ]; then
echo "`fixlen "Host:" $WIDTH` ${HOST_NAME}"
echo "FATAL ERROR: Cannot stat hostname."
echo " Contact your system administrator, "
echo " Foam ${FOAM_VERSION} needs a valid "
echo " hostname to function."
echo
FATALERROR=`expr $FATALERROR + 1`
else
echo "`fixlen "Host:" $WIDTH` ${HOST_NAME}"
fi
#
if [ "$OS" = "Linux" ] || [ "$OS" = "LinuxAMD64" ] || [ "$OS" = "SunOS" ]; then
echo "`fixlen "OS:" $WIDTH` ${OS} version ${OS_VERSION}"
else
echo "FATAL ERROR: Incompatible operating system \"$OS\"."
echo " Foam${FOAM_VERSION} is currently "
echo " available for Linux and SunOS only."
echo
FATALERROR=`expr $FATALERROR + 1`
fi
#
if [ `length $USER_NAME` -eq 0 ]; then
echo "`fixlen "User:" $WIDTH` ${USER_NAME}"
echo "FATAL ERROR: Cannot stat user name ${USER_NAME}."
echo ""
echo " Contact your system administrator, "
echo " Foam${FOAM_VERSION} needs a valid "
echo " user name to function."
echo
FATALERROR=`expr $FATALERROR + 1`
else
echo "`fixlen "User:" $WIDTH` ${USER_NAME}"
fi
#
USER_CONFIG_FILE="${HOME}/.${USER_CONFIG_TYPE}"
if [ -f ${USER_CONFIG_FILE} ] ; then
echo "`fixlen "User_config:" $WIDTH` ${USER_CONFIG_FILE}"
else
echo "`fixlen "User_config:" $WIDTH` ${USER_CONFIG_FILE}"
echo "FATAL ERROR: User config file: *** not located ***"
echo " Create a user config file $USER_CONFIG_FILE"
echo
FATALERROR=`expr $FATALERROR + 1`
fi
#
# heading "Checking if user config file sources the foam config file..."
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FOAM_CONFIG_FILE=`echo $HOME/.OpenFOAM-${FOAM_VERSION}/${USER_CONFIG_TYPE}`
case ${USER_CONFIG_TYPE} in
cshrc) SRC_STR="source";;
bashrc) SRC_STR=".";;
esac
#
SOURCE_FOAM_CONFIG=`grep "^${SRC_STR}.*OpenFOAM-${FOAM_VERSION}/${USER_CONFIG_TYPE}" ${USER_CONFIG_FILE}`
#
if [ ! "$SOURCE_FOAM_CONFIG" = "" ] ; then
echo "`fixlen "Foam_config:" $WIDTH` "$FOAM_CONFIG_FILE sourced correctly.""
else
echo "FATAL ERROR: $FOAM_CONFIG_FILE does not appear to be sourced from:"
echo " $USER_CONFIG_FILE"
echo ""
echo "You need the following at the end of your $USER_CONFIG_FILE file:"
echo "${SRC_STR} $HOME/OpenFOAM/OpenFOAM-${FOAM_VERSION}/etc/${USER_CONFIG_TYPE}"
echo "or equivalent depending on the location of the OpenFOAM installation."
echo
FATALERROR=`expr $FATALERROR + 1`
fi
#
if [ ! "$WM_PROJECT_INST_DIR" ]; then
echo
echo "FATAL ERROR Foam install directory not set."
echo
echo "Set correct path to installation 'WM_PROJECT_INST_DIR' in $HOME/.foam2.3/bashrc"
elif [ ! -d $WM_PROJECT_INST_DIR ]; then
echo
echo "FATAL ERROR Cannot find FOAM installation at: $WM_PROJECT_INST_DIR"
echo
echo "Set correct path to installation 'WM_PROJECT_INST_DIR' in $HOME/.foam2.3/bashrc"
FATALERROR=`expr $FATALERROR + 1`
fi
hline #--------------------
#
heading "Checking main FOAM env variables..."
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hline
checkOpenFOAMEnvironment
checkUserShell
checkHostName
checkOS
hline
#------------------------------------------------------------------------------
heading "Checking main OpenFOAM env variables..."
COL1=`fixlen "Environment_variable" 21`
COL2=`fixlen "Set_to_file_or_directory" 40`
COL3="Valid"
COL4="Path"
COL5="Crit"
hline #--------------------
hline
echo "$COL1 $COL2 $COL3 $COL5"
hline #--------------------
hline
reportEnv '$WM_PROJECT_INST_DIR' 'noPath' "yes"
reportEnv '$WM_PROJECT_USER_DIR' 'noPath' "no"
reportEnv '$FOAM_JOB_DIR' 'noPath' "yes"
hline #--------------------
#
heading "Checking the FOAM env variables set on the PATH..."
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hline #--------------------
reportEnv '$WM_THIRD_PARTY_DIR' 'noPath' "yes"
hline
#------------------------------------------------------------------------------
heading "Checking the OpenFOAM env variables set on the PATH..."
hline
echo "$COL1 $COL2 $COL3 $COL4 $COL5"
hline #--------------------
hline
reportEnv '$WM_PROJECT_DIR' '$PATH' "yes"
echo ""
reportEnv '$FOAM_USER_APPBIN' '$PATH' "no"
reportEnv '$FOAM_APPBIN' '$PATH' "yes"
reportEnv '$FOAM_USER_APPBIN' '$PATH' "no"
reportEnv '$WM_DIR' '$PATH' "yes"
reportEnv '$CEI_HOME' '$PATH' "no"
echo ""
reportEnv '$JAVA_PATH' '$PATH' "no"
reportEnv '$MPI_ARCH_PATH' '$PATH' "yes"
hline #--------------------
#
heading "Checking the FOAM env variables set on the LD_LIBRARY_PATH..."
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hline #--------------------
hline
#------------------------------------------------------------------------------
heading "Checking the OpenFOAM env variables set on the LD_LIBRARY_PATH..."
hline
echo "$COL1 $COL2 $COL3 $COL4 $COL5"
hline #--------------------
hline
reportEnv '$FOAM_LIBBIN' '$LD_LIBRARY_PATH' "yes"
reportEnv '$FOAM_USER_LIBBIN' '$LD_LIBRARY_PATH' "no"
reportEnv '$MPI_ARCH_PATH' '$LD_LIBRARY_PATH' "yes"
hline #--------------------
#
heading "Software versions"
#~~~~~~~~~~~~~~~~~~~~~~~~~~
hline
#------------------------------------------------------------------------------
heading "Third party software"
COL1=`fixlen "Software" 9`
COL2=`fixlen "Version" 10`
COL3=`fixlen "Location" 10`
hline #--------------------
hline
echo "$COL1 $COL2 $COL3"
hline #--------------------
hline
reportExecutable gcc "${WM_COMPILER_DIR}/bin/gcc"
reportExecutable java "${JAVA_HOME}/bin/java"
reportExecutable gzip
if [ "$OS" = "Linux" ] ; then
reportExecutable tar
@ -562,44 +515,35 @@ else
reportExecutable gtar
fi
reportExecutable icoFoam "${FOAM_APPBIN}/icoFoam"
hline #--------------------
#
heading "Checking file/directory permissions..."
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
COL1=`fixlen "File/directory" 50`
COL2=`fixlen "Set" 5`
COL3=`fixlen "Reqd" 5`
COL4=`fixlen "Crit" 5`
hline #--------------------
echo "$COL1 $COL2 $COL3 $COL4"
hline #--------------------
#
hline
#------------------------------------------------------------------------------
heading "Checking networking..."
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
COL1=`fixlen "Action" 25`
COL2=`fixlen "Result" 45`
COL3=`fixlen "Crit" 5`
hline #--------------------
hline
echo "$COL1 $COL2 $COL3"
hline #--------------------
hline
pingTest "$HOST_NAME" "yes"
pingTest "localHost" "yes"
checkRsh
checkSsh
if [ $SSHRSHOK -eq 1 ]; then
echo "(*) Only one of rsh or ssh is required by the Foam enviroment."
echo "(*) Only one of rsh or ssh is required by the OpenFOAM enviroment."
elif [ $SSHRSHOK -gt 1 ]; then
echo "FATAL ERROR: No remote shell available."
echo " Foam${FOAM_VERSION} enviroment requires either ssh and/or rsh."
echo " OpenFOAM ${FOAM_VERSION} enviroment requires either ssh and/or rsh."
echo " Contact your system administrator."
echo ""
FATALERROR=`expr $FATALERROR + 1`
fi
echo ""
hline #--------------------
hline
echo ""
if [ $FATALERROR -gt 0 ] ; then
echo "The system test has evoked $FATALERROR fatal error(s)."
@ -619,4 +563,10 @@ if [ $CRITICALERROR -gt 0 ] || [ $FATALERROR -gt 0 ]; then
fi
echo ""
echo "done."
echo ""
exit 0
#------------------------------------------------------------------------------

View File

@ -232,6 +232,18 @@ installParaView ()
-print
fi
# Replace local CMAKE_HOME path with CMAKE_HOME
# environment variables
find . -iname '*cmake*' -execdir sed -i \
"s,$CMAKE_HOME,\$ENV{CMAKE_HOME},g" {} ';' \
-print
# Replace local WM_COMPILER_DIR path with WM_COMPILER_DIR
# environment variables
find . -iname '*cmake*' -execdir sed -i \
"s,$WM_COMPILER_DIR,\$ENV{WM_COMPILER_DIR},g" {} ';' \
-print
# create a softlink to the $PARAVIEW_OBJ_DIR/bin folder
# - workaround for chosen install location
echo " Creating paraview $PARAVIEW_MAJOR_VERSION soft link to /bin"

View File

@ -32,8 +32,8 @@
#------------------------------------------------------------------------------
export WM_PROJECT=OpenFOAM
#export WM_PROJECT_VERSION=dev
: ${WM_PROJECT_VERSION:=dev}; export WM_PROJECT_VERSION
export WM_PROJECT_VERSION=1.5
#: ${WM_PROJECT_VERSION:=dev}; export WM_PROJECT_VERSION
#!!User:

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -32,8 +32,8 @@
#------------------------------------------------------------------------------
setenv WM_PROJECT OpenFOAM
#setenv WM_PROJECT_VERSION dev
if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION dev
setenv WM_PROJECT_VERSION 1.5
#if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION dev
#!!User:
# either setenv FOAM_INST_DIR before sourcing this file or set

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Wrapper for stat() system call.
\*---------------------------------------------------------------------------*/
#include "fileStat.H"
@ -35,33 +32,15 @@ Description
#include <unistd.h>
#include <sys/sysmacros.h>
/*
#undef major
#undef minor
#undef makedev
# define major(dev) ((int)(((dev) >> 8) & 0xff))
# define minor(dev) ((int)((dev) & 0xff))
# define makedev(major, minor) ((((unsigned int) (major)) << 8) \
| ((unsigned int) (minor)))
*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
fileStat::fileStat()
Foam::fileStat::fileStat()
:
isValid_(false)
{}
// Construct from components
fileStat::fileStat(const fileName& fName, const unsigned int maxTime)
Foam::fileStat::fileStat(const fileName& fName, const unsigned int maxTime)
{
// Work on volatile
volatile bool locIsValid = false;
@ -85,8 +64,7 @@ fileStat::fileStat(const fileName& fName, const unsigned int maxTime)
}
// Construct from Istream.
fileStat::fileStat(Istream& is)
Foam::fileStat::fileStat(Istream& is)
{
is >> *this;
}
@ -94,10 +72,9 @@ fileStat::fileStat(Istream& is)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// compare two fileStates for same device
bool fileStat::sameDevice(const fileStat& stat2) const
bool Foam::fileStat::sameDevice(const fileStat& stat2) const
{
return
return
isValid_
&& (
major(status_.st_dev) == major(stat2.status().st_dev)
@ -105,14 +82,14 @@ bool fileStat::sameDevice(const fileStat& stat2) const
);
}
// compare two fileStates for same Inode
bool fileStat::sameINode(const fileStat& stat2) const
bool Foam::fileStat::sameINode(const fileStat& stat2) const
{
return isValid_ && (status_.st_ino == stat2.status().st_ino);
}
// compare state against inode
bool fileStat::sameINode(const label iNode) const
bool Foam::fileStat::sameINode(const label iNode) const
{
return isValid_ && (status_.st_ino == ino_t(iNode));
}
@ -120,13 +97,12 @@ bool fileStat::sameINode(const label iNode) const
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// Input in list syntax
Istream& operator>>(Istream& is, fileStat& fStat)
Foam::Istream& Foam::operator>>(Istream& is, fileStat& fStat)
{
// Read beginning of machine info list
is.readBegin("fileStat");
label
label
devMaj, devMin,
ino, mode, uid, gid,
rdevMaj, rdevMin,
@ -172,11 +148,10 @@ Istream& operator>>(Istream& is, fileStat& fStat)
}
// Output in list syntax
Ostream& operator<<(Ostream& os, const fileStat& fStat)
Foam::Ostream& Foam::operator<<(Ostream& os, const fileStat& fStat)
{
//Set precision so 32bit unsigned int can be printed
// int oldPrecision = os.precision();
// Set precision so 32bit unsigned int can be printed
// int oldPrecision = os.precision();
int oldPrecision = 0;
os.precision(10);
@ -200,8 +175,4 @@ Ostream& operator<<(Ostream& os, const fileStat& fStat)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1004,120 +1004,124 @@ Foam::vectorField Foam::autoSnapDriver::calcNearestSurface
const refinementSurfaces& surfaces = meshRefiner_.surfaces();
const fvMesh& mesh = meshRefiner_.mesh();
// Divide surfaces into zoned and unzoned
labelList zonedSurfaces;
labelList unzonedSurfaces;
getZonedSurfaces(zonedSurfaces, unzonedSurfaces);
// Displacement per patch point
vectorField patchDisp(localPoints.size(), vector::zero);
// 1. All points to non-interface surfaces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (returnReduce(localPoints.size(), sumOp<label>()) > 0)
{
List<pointIndexHit> hitInfo;
labelList hitSurface;
surfaces.findNearest
(
unzonedSurfaces,
localPoints,
sqr(4*snapDist), // sqr of attract distance
hitSurface,
hitInfo
);
// Divide surfaces into zoned and unzoned
labelList zonedSurfaces;
labelList unzonedSurfaces;
getZonedSurfaces(zonedSurfaces, unzonedSurfaces);
// 1. All points to non-interface surfaces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
forAll(hitInfo, pointI)
{
if (hitInfo[pointI].hit())
{
patchDisp[pointI] =
hitInfo[pointI].hitPoint()
- localPoints[pointI];
}
//else
//{
// WarningIn("autoSnapDriver::calcNearestSurface(..)")
// << "For point:" << pointI
// << " coordinate:" << localPoints[pointI]
// << " did not find any surface within:"
// << 4*snapDist[pointI]
// << " meter." << endl;
//}
}
}
// 2. All points on zones to their respective surface
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Surfaces with zone information
const wordList& faceZoneNames = surfaces.faceZoneNames();
forAll(zonedSurfaces, i)
{
label zoneSurfI = zonedSurfaces[i];
const labelList surfacesToTest(1, zoneSurfI);
// Get indices of points both on faceZone and on pp.
labelList zonePointIndices
(
getZoneSurfacePoints
List<pointIndexHit> hitInfo;
labelList hitSurface;
surfaces.findNearest
(
pp,
faceZoneNames[zoneSurfI]
)
);
unzonedSurfaces,
localPoints,
sqr(4*snapDist), // sqr of attract distance
hitSurface,
hitInfo
);
pointField zonePoints(zonePointIndices.size());
forAll(zonePointIndices, i)
{
zonePoints[i] = localPoints[zonePointIndices[i]];
}
// Find nearest for points both on faceZone and pp.
List<pointIndexHit> hitInfo;
labelList hitSurface;
surfaces.findNearest
(
labelList(1, zoneSurfI),
zonePoints,
sqr(4*snapDist),
hitSurface,
hitInfo
);
forAll(hitInfo, pointI)
{
if (hitInfo[pointI].hit())
forAll(hitInfo, pointI)
{
patchDisp[pointI] =
hitInfo[pointI].hitPoint()
- localPoints[pointI];
}
else
{
WarningIn("autoSnapDriver::calcNearestSurface(..)")
<< "For point:" << pointI
<< " coordinate:" << localPoints[pointI]
<< " did not find any surface within:"
<< 4*snapDist[pointI]
<< " meter." << endl;
if (hitInfo[pointI].hit())
{
patchDisp[pointI] =
hitInfo[pointI].hitPoint()
- localPoints[pointI];
}
//else
//{
// WarningIn("autoSnapDriver::calcNearestSurface(..)")
// << "For point:" << pointI
// << " coordinate:" << localPoints[pointI]
// << " did not find any surface within:"
// << 4*snapDist[pointI]
// << " meter." << endl;
//}
}
}
}
{
scalarField magDisp(mag(patchDisp));
Info<< "Wanted displacement : average:"
<< gSum(magDisp)/returnReduce(patchDisp.size(), sumOp<label>())
<< " min:" << gMin(magDisp)
<< " max:" << gMax(magDisp) << endl;
// 2. All points on zones to their respective surface
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Surfaces with zone information
const wordList& faceZoneNames = surfaces.faceZoneNames();
forAll(zonedSurfaces, i)
{
label zoneSurfI = zonedSurfaces[i];
const labelList surfacesToTest(1, zoneSurfI);
// Get indices of points both on faceZone and on pp.
labelList zonePointIndices
(
getZoneSurfacePoints
(
pp,
faceZoneNames[zoneSurfI]
)
);
pointField zonePoints(zonePointIndices.size());
forAll(zonePointIndices, i)
{
zonePoints[i] = localPoints[zonePointIndices[i]];
}
// Find nearest for points both on faceZone and pp.
List<pointIndexHit> hitInfo;
labelList hitSurface;
surfaces.findNearest
(
labelList(1, zoneSurfI),
zonePoints,
sqr(4*snapDist),
hitSurface,
hitInfo
);
forAll(hitInfo, pointI)
{
if (hitInfo[pointI].hit())
{
patchDisp[pointI] =
hitInfo[pointI].hitPoint()
- localPoints[pointI];
}
else
{
WarningIn("autoSnapDriver::calcNearestSurface(..)")
<< "For point:" << pointI
<< " coordinate:" << localPoints[pointI]
<< " did not find any surface within:"
<< 4*snapDist[pointI]
<< " meter." << endl;
}
}
}
{
scalarField magDisp(mag(patchDisp));
Info<< "Wanted displacement : average:"
<< gSum(magDisp)/returnReduce(patchDisp.size(), sumOp<label>())
<< " min:" << gMin(magDisp)
<< " max:" << gMax(magDisp) << endl;
}
}
Info<< "Calculated surface displacement in = "

View File

@ -28,16 +28,12 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// allow undef in results
bool Foam::ensightFile::allowUndef_ = false;
// value to represent undef in results
Foam::scalar Foam::ensightFile::undefValue_ = Foam::floatScalarVGREAT;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from pathname
Foam::ensightFile::ensightFile
(
const fileName& pathname,
@ -55,6 +51,7 @@ Foam::ensightFile::ensightFile
precision(5);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::ensightFile::~ensightFile()
@ -88,7 +85,6 @@ Foam::scalar Foam::ensightFile::undefValue(const scalar& value)
}
// binary write
Foam::Ostream& Foam::ensightFile::write
(
const char* buf,
@ -100,11 +96,7 @@ Foam::Ostream& Foam::ensightFile::write
}
// write string as "%80s" or as binary
Foam::Ostream& Foam::ensightFile::write
(
const string& value
)
Foam::Ostream& Foam::ensightFile::write(const string& value)
{
char buf[80];
@ -141,11 +133,7 @@ Foam::Ostream& Foam::ensightFile::write
}
// write integer as "%10d" or as binary
Foam::Ostream& Foam::ensightFile::write
(
const label& value
)
Foam::Ostream& Foam::ensightFile::write(const label& value)
{
if (format() == IOstream::BINARY)
{
@ -167,7 +155,6 @@ Foam::Ostream& Foam::ensightFile::write
}
// write integer with specified width or as binary
Foam::Ostream& Foam::ensightFile::write
(
const label& value,
@ -194,11 +181,7 @@ Foam::Ostream& Foam::ensightFile::write
}
// write float as "%12.5e" or as binary
Foam::Ostream& Foam::ensightFile::write
(
const scalar& value
)
Foam::Ostream& Foam::ensightFile::write(const scalar& value)
{
if (format() == IOstream::BINARY)
{
@ -220,7 +203,6 @@ Foam::Ostream& Foam::ensightFile::write
}
// Add carriage return to ascii stream
void Foam::ensightFile::newline()
{
if (format() == IOstream::ASCII)
@ -230,7 +212,6 @@ void Foam::ensightFile::newline()
}
// write undef value
Foam::Ostream& Foam::ensightFile::writeUndef()
{
write(undefValue_);
@ -238,11 +219,7 @@ Foam::Ostream& Foam::ensightFile::writeUndef()
}
// write element keyword with trailing newline, optionally with undef
Foam::Ostream& Foam::ensightFile::writeKeyword
(
const string& key
)
Foam::Ostream& Foam::ensightFile::writeKeyword(const string& key)
{
if (allowUndef_)
{
@ -260,7 +237,6 @@ Foam::Ostream& Foam::ensightFile::writeKeyword
}
// write "C Binary" for binary files
Foam::Ostream& Foam::ensightFile::writeBinaryHeader()
{
if (format() == IOstream::BINARY)
@ -274,8 +250,6 @@ Foam::Ostream& Foam::ensightFile::writeBinaryHeader()
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
// '*' mask appropriate for subDir
Foam::string Foam::ensightFile::mask()
{
char buf[16] = "********";
@ -283,7 +257,6 @@ Foam::string Foam::ensightFile::mask()
}
// consistent zero-padded numbers for subdirectories
Foam::string Foam::ensightFile::subDir(const label n)
{
char buf[16];
@ -293,6 +266,4 @@ Foam::string Foam::ensightFile::subDir(const label n)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -30,12 +30,15 @@ Description
Correctly handles binary write as well.
\*---------------------------------------------------------------------------*/
#ifndef ensightFile_H
#define ensightFile_H
#include "OFstream.H"
#include "IOstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
@ -47,19 +50,26 @@ class ensightFile
:
public OFstream
{
//- allow undef in results
static bool allowUndef_;
// Private data
//- value to represent undef in results
static scalar undefValue_;
//- allow undef in results
static bool allowUndef_;
//- Disallow default bitwise assignment
void operator=(const ensightFile&);
//- value to represent undef in results
static scalar undefValue_;
// Private member functions
//- Disallow default bitwise assignment
void operator=(const ensightFile&);
//- Disallow default copy constructor
ensightFile(const ensightFile&);
//- Disallow default copy constructor
ensightFile(const ensightFile&);
public:
// Constructors
//- Construct from pathname
@ -69,10 +79,13 @@ public:
IOstream::streamFormat format=IOstream::BINARY
);
// Destructor
~ensightFile();
~ensightFile();
// Access
//- Return setting for whether 'undef' values are allowed in results
static bool allowUndef();
@ -82,7 +95,9 @@ public:
//- consistent zero-padded numbers for subdirectories
static string subDir(const label);
// Edit
static bool allowUndef(bool);
//- Assign the value to represent undef in the results
@ -90,6 +105,7 @@ public:
// NB: do not use values larger than floatScalarVGREAT
static scalar undefValue(const scalar&);
// Output
//- binary write
@ -125,6 +141,8 @@ public:
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -28,8 +28,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from pathname
Foam::ensightGeoFile::ensightGeoFile
(
const fileName& pathname,
@ -53,11 +51,7 @@ Foam::ensightGeoFile::~ensightGeoFile()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// write keyword with trailing newline
Foam::Ostream& Foam::ensightGeoFile::writeKeyword
(
const string& key
)
Foam::Ostream& Foam::ensightGeoFile::writeKeyword(const string& key)
{
write(key);
newline();
@ -65,6 +59,5 @@ Foam::Ostream& Foam::ensightGeoFile::writeKeyword
return *this;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -29,28 +29,36 @@ Description
Specialized Ensight output with extra geometry file header
\*---------------------------------------------------------------------------*/
#ifndef ensightGeoFile_H
#define ensightGeoFile_H
#include "ensightFile.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class ensightGeoFile Declaration
\*---------------------------------------------------------------------------*/
class ensightGeoFile
:
public ensightFile
{
//- Disallow default bitwise assignment
void operator=(const ensightGeoFile&);
// Private member functions
//- Disallow default bitwise assignment
void operator=(const ensightGeoFile&);
//- Disallow default copy constructor
ensightGeoFile(const ensightGeoFile&);
//- Disallow default copy constructor
ensightGeoFile(const ensightGeoFile&);
public:
// Constructors
//- Construct from pathname
@ -60,21 +68,23 @@ public:
IOstream::streamFormat format=IOstream::BINARY
);
// Destructor
~ensightGeoFile();
//- Destructor
~ensightGeoFile();
// Output
//- write keyword with trailing newline
virtual Ostream& writeKeyword(const string& key);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -41,11 +41,7 @@ Foam::List<Foam::word> Foam::ensightPart::elemTypes_(0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
//- check for fully defined fields
bool Foam::ensightPart::isFieldDefined
(
const List<scalar>& field
) const
bool Foam::ensightPart::isFieldDefined(const List<scalar>& field) const
{
forAll(elemLists_, elemI)
{
@ -67,7 +63,6 @@ bool Foam::ensightPart::isFieldDefined
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
Foam::ensightPart::ensightPart
()
:
@ -82,7 +77,6 @@ Foam::ensightPart::ensightPart
{}
// Construct empty part with number and description
Foam::ensightPart::ensightPart
(
label partNumber,
@ -100,7 +94,6 @@ Foam::ensightPart::ensightPart
{}
// Construct empty part with number and description
Foam::ensightPart::ensightPart
(
label partNumber,
@ -119,11 +112,7 @@ Foam::ensightPart::ensightPart
{}
// Construct as copy
Foam::ensightPart::ensightPart
(
const ensightPart& part
)
Foam::ensightPart::ensightPart(const ensightPart& part)
:
number_(part.number_),
name_(part.name_),
@ -138,7 +127,6 @@ Foam::ensightPart::ensightPart
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
// runtime selection
Foam::autoPtr<Foam::ensightPart> Foam::ensightPart::New(Istream& is)
{
word partType(is);
@ -161,6 +149,7 @@ Foam::autoPtr<Foam::ensightPart> Foam::ensightPart::New(Istream& is)
return autoPtr<ensightPart>(cstrIter()(is));
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::ensightPart::~ensightPart()
@ -169,7 +158,6 @@ Foam::ensightPart::~ensightPart()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// reconstruct from Istream
void Foam::ensightPart::reconstruct(Istream& is)
{
dictionary dict(is);
@ -198,7 +186,6 @@ void Foam::ensightPart::reconstruct(Istream& is)
}
// renumber elements
void Foam::ensightPart::renumber(labelList const& origId)
{
// transform to global values first
@ -226,6 +213,4 @@ void Foam::ensightPart::renumber(labelList const& origId)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -63,9 +63,9 @@ class ensightPart
// Static data members
static List<word> elemTypes_;
// Private Member Functions
protected:
// Protected data
//- part number
@ -92,6 +92,7 @@ protected:
//- mesh reference used
const polyMesh* meshPtr_;
// Protected Classes
//- track the points used by the part and map global to local indices
@ -155,12 +156,12 @@ protected:
) const
{}
public:
//- Runtime type information
TypeName("ensightPart");
// Public data
// Constructors
@ -206,9 +207,9 @@ public:
static autoPtr<ensightPart> New(Istream& is);
// Destructor
//- Destructor
virtual ~ensightPart();
virtual ~ensightPart();
// Static members
@ -217,6 +218,7 @@ public:
return elemTypes_;
}
// Access
//- number of elements in this part
@ -272,6 +274,7 @@ public:
return offset_;
}
// Edit
//- renumber elements
@ -332,7 +335,6 @@ public:
ensightGeoFile&,
const ensightPart&
);
};

View File

@ -40,7 +40,6 @@ namespace Foam
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream);
}
// names for addressable ensight element types
Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_
(
IStringStream
@ -52,11 +51,7 @@ Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// classify the cell types, track the points used
void Foam::ensightPartCells::classify
(
const labelList& idList
)
void Foam::ensightPartCells::classify(const labelList& idList)
{
// References to cell shape models
const cellModel& tet = *(cellModeller::lookup("tet"));
@ -229,7 +224,6 @@ void Foam::ensightPartCells::classify
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct empty part with number and description
Foam::ensightPartCells::ensightPartCells
(
label partNumber,
@ -240,7 +234,6 @@ Foam::ensightPartCells::ensightPartCells
{}
// Construct from polyMesh without zones
Foam::ensightPartCells::ensightPartCells
(
label partNumber,
@ -253,7 +246,6 @@ Foam::ensightPartCells::ensightPartCells
}
// Construct from polyMesh and list of (non-zoned) cells
Foam::ensightPartCells::ensightPartCells
(
label partNumber,
@ -267,7 +259,6 @@ Foam::ensightPartCells::ensightPartCells
}
// Construct from polyMesh and cellZone
Foam::ensightPartCells::ensightPartCells
(
label partNumber,
@ -281,21 +272,13 @@ Foam::ensightPartCells::ensightPartCells
}
// Construct as copy
Foam::ensightPartCells::ensightPartCells
(
const ensightPartCells& part
)
Foam::ensightPartCells::ensightPartCells(const ensightPartCells& part)
:
ensightPart(part)
{}
// Construct from Istream
Foam::ensightPartCells::ensightPartCells
(
Istream& is
)
Foam::ensightPartCells::ensightPartCells(Istream& is)
:
ensightPart()
{
@ -305,15 +288,12 @@ Foam::ensightPartCells::ensightPartCells
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::ensightPartCells::~ensightPartCells()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// track the points used
Foam::ensightPart::localPoints Foam::ensightPartCells::calcLocalPoints() const
{
const polyMesh& mesh = *meshPtr_;
@ -362,7 +342,6 @@ Foam::ensightPart::localPoints Foam::ensightPartCells::calcLocalPoints() const
}
// write cell connectivities
void Foam::ensightPartCells::writeConnectivity
(
ensightGeoFile& os,
@ -449,6 +428,4 @@ void Foam::ensightPartCells::writeConnectivity
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -52,8 +52,6 @@ class ensightPartCells
:
public ensightPart
{
// Private data
// Private Member Functions
//- Disallow default bitwise assignment
@ -77,6 +75,7 @@ class ensightPartCells
const labelList& pointMap
) const;
protected:
//- addressable Ensight element types
@ -135,9 +134,8 @@ public:
}
// Destructor
virtual ~ensightPartCells();
//- Destructor
virtual ~ensightPartCells();
// Member Functions
@ -147,7 +145,6 @@ public:
{
return elemTypes_;
}
};

View File

@ -31,13 +31,14 @@ License
#include "dictionary.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(ensightPartFaces, 0);
addToRunTimeSelectionTable(ensightPart, ensightPartFaces, istream);
}
// names for addressable ensight element types
Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_
(
IStringStream
@ -46,9 +47,9 @@ Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_
)()
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct empty part with number and description
Foam::ensightPartFaces::ensightPartFaces
(
label partNumber,
@ -61,7 +62,6 @@ Foam::ensightPartFaces::ensightPartFaces
}
// Construct from polyMesh and polyPatch
Foam::ensightPartFaces::ensightPartFaces
(
label partNumber,
@ -137,22 +137,13 @@ Foam::ensightPartFaces::ensightPartFaces
}
// Construct as copy
Foam::ensightPartFaces::ensightPartFaces
(
const ensightPartFaces &part
)
Foam::ensightPartFaces::ensightPartFaces(const ensightPartFaces &part)
:
ensightPart(part)
{}
// Construct from Istream
Foam::ensightPartFaces::ensightPartFaces
(
Istream& is
)
Foam::ensightPartFaces::ensightPartFaces(Istream& is)
:
ensightPart()
{
@ -160,6 +151,7 @@ Foam::ensightPartFaces::ensightPartFaces
reconstruct(is);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::ensightPartFaces::~ensightPartFaces()
@ -168,7 +160,6 @@ Foam::ensightPartFaces::~ensightPartFaces()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// track the points used
Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const
{
const polyMesh& mesh = *meshPtr_;
@ -212,7 +203,6 @@ Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const
}
// write face connectivities
void Foam::ensightPartFaces::writeConnectivity
(
ensightGeoFile& os,
@ -258,6 +248,4 @@ void Foam::ensightPartFaces::writeConnectivity
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -51,8 +51,6 @@ class ensightPartFaces
:
public ensightPart
{
// Private data
// Private Member Functions
//- Disallow default bitwise assignment
@ -70,6 +68,7 @@ class ensightPartFaces
const labelList& pointMap
) const;
protected:
//- addressable ensight element types
@ -115,9 +114,8 @@ public:
}
// Destructor
virtual ~ensightPartFaces();
//- Destructor
virtual ~ensightPartFaces();
// Member Functions
@ -127,7 +125,6 @@ public:
{
return elemTypes_;
}
};

View File

@ -31,7 +31,6 @@ Description
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
// write generalized field components
template <class Type>
void Foam::ensightPart::writeField
(
@ -66,6 +65,4 @@ void Foam::ensightPart::writeField
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -33,7 +33,6 @@ Description
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// write the part header
void Foam::ensightPart::writeHeader
(
ensightFile& os,
@ -54,7 +53,6 @@ void Foam::ensightPart::writeHeader
}
// write scalar field for idList
void Foam::ensightPart::writeFieldList
(
ensightFile& os,
@ -80,12 +78,7 @@ void Foam::ensightPart::writeFieldList
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// write summary information about the object
bool Foam::ensightPart::writeSummary
(
Ostream& os
) const
bool Foam::ensightPart::writeSummary(Ostream& os) const
{
os << indent << type() << nl
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
@ -102,11 +95,7 @@ bool Foam::ensightPart::writeSummary
}
// write reconstruction information for the object
bool Foam::ensightPart::writeData
(
Ostream& os
) const
bool Foam::ensightPart::writeData(Ostream& os) const
{
os << indent << type() << nl
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
@ -130,12 +119,7 @@ bool Foam::ensightPart::writeData
}
// write geometry by components
void Foam::ensightPart::writeGeometry
(
ensightGeoFile& os
) const
void Foam::ensightPart::writeGeometry(ensightGeoFile& os) const
{
if (size() && meshPtr_)
{
@ -182,7 +166,6 @@ void Foam::ensightPart::writeGeometry
}
// write scalar field
void Foam::ensightPart::writeScalarField
(
ensightFile& os,
@ -207,7 +190,6 @@ void Foam::ensightPart::writeScalarField
}
// write vector field components
void Foam::ensightPart::writeVectorField
(
ensightFile& os,
@ -259,6 +241,5 @@ Foam::ensightGeoFile& Foam::operator<<
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -28,11 +28,7 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from polyMesh
Foam::ensightParts::ensightParts
(
const polyMesh& pMesh
)
Foam::ensightParts::ensightParts(const polyMesh& pMesh)
:
partsList_()
{
@ -40,11 +36,7 @@ Foam::ensightParts::ensightParts
}
// Construct from IOobject
Foam::ensightParts::ensightParts
(
const IOobject& ioObj
)
Foam::ensightParts::ensightParts(const IOobject& ioObj)
:
partsList_()
{
@ -61,12 +53,7 @@ Foam::ensightParts::~ensightParts()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// clear old information and construct anew from polyMesh
void Foam::ensightParts::recalculate
(
const polyMesh& pMesh
)
void Foam::ensightParts::recalculate(const polyMesh& pMesh)
{
partsList_.clear();
@ -197,7 +184,6 @@ void Foam::ensightParts::recalculate
}
// renumber elements
void Foam::ensightParts::renumber
(
const labelList& origCellId,
@ -218,11 +204,7 @@ void Foam::ensightParts::renumber
}
// write the geometry
void Foam::ensightParts::writeGeometry
(
ensightGeoFile& os
) const
void Foam::ensightParts::writeGeometry( ensightGeoFile& os) const
{
// with some feedback
Info<< "write geometry part:" << nl << flush;
@ -235,11 +217,7 @@ void Foam::ensightParts::writeGeometry
}
// write summary information about the objects
bool Foam::ensightParts::writeSummary
(
Ostream& os
) const
bool Foam::ensightParts::writeSummary(Ostream& os) const
{
forAll(partsList_, partI)
{
@ -250,10 +228,7 @@ bool Foam::ensightParts::writeSummary
}
void Foam::ensightParts::writeData
(
Ostream& os
) const
void Foam::ensightParts::writeData(Ostream& os) const
{
// Write size of list
os << nl << partsList_.size();
@ -275,7 +250,6 @@ void Foam::ensightParts::writeData
}
// write scalar field
void Foam::ensightParts::writeScalarField
(
ensightFile& os,
@ -298,7 +272,6 @@ void Foam::ensightParts::writeScalarField
}
// write vector field components
void Foam::ensightParts::writeVectorField
(
ensightFile& os,
@ -322,8 +295,6 @@ void Foam::ensightParts::writeVectorField
}
}
// * * * * * * * * * * * * * * * Member operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
@ -337,6 +308,5 @@ Foam::ensightGeoFile& Foam::operator<<
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -66,6 +66,7 @@ class ensightParts
//- Disallow default bitwise assignment
void operator=(const ensightParts&);
public:
// Constructors
@ -76,9 +77,12 @@ public:
//- Construct from IOobject
ensightParts(const IOobject&);
// Destructor
~ensightParts();
//- Destructor
~ensightParts();
// Member functions
//- clear old information and construct anew from polyMesh
void recalculate(const polyMesh&);
@ -132,6 +136,7 @@ public:
const GeometricField<Type, fvPatchField, volMesh>&
) const;
// Friend Operators
friend ensightGeoFile& operator<<
@ -139,7 +144,6 @@ public:
ensightGeoFile&,
const ensightParts&
);
};

View File

@ -26,11 +26,11 @@ Description
Template to write generalized field components
\*---------------------------------------------------------------------------*/
#include "ensightParts.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// write generalized field components
template <class Type>
void Foam::ensightParts::writeField
(
@ -72,6 +72,5 @@ void Foam::ensightParts::writeField
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -177,7 +177,5 @@ const Foam::labelListList& Foam::meshReader::pointCells() const
return *pointCellsPtr_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -42,7 +42,6 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// add in boundary face
void Foam::meshReader::addPolyBoundaryFace
(
const label cellId,
@ -86,7 +85,6 @@ void Foam::meshReader::addPolyBoundaryFace
}
// add in boundary face
void Foam::meshReader::addPolyBoundaryFace
(
const cellFaceIdentifier& identifier,
@ -96,6 +94,7 @@ void Foam::meshReader::addPolyBoundaryFace
addPolyBoundaryFace(identifier.cell, identifier.face, nCreatedFaces);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void Foam::meshReader::createPolyBoundary()
@ -370,6 +369,7 @@ void Foam::meshReader::createPolyBoundary()
<< "Number of interfaces: " << nInterfaces << endl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::List<Foam::polyPatch*>
@ -445,6 +445,5 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
return p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -31,6 +31,7 @@ Description
- standard connectivity checks
- added baffle support
\*---------------------------------------------------------------------------*/
#include "meshReader.H"
@ -325,6 +326,5 @@ void Foam::meshReader::createPolyCells()
// added in createPolyBoundary()
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -34,7 +34,6 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// Pointers to cell shape models
const Foam::cellModel* Foam::meshReader::unknownModel = Foam::cellModeller::
lookup
(
@ -65,27 +64,17 @@ lookup
"hex"
);
// * * * * * * * * * * * * * * Static Functions * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// attach cellZones based on the cellTable Id
// - any other values can be extracted later from the cellTable dictionary
void Foam::meshReader::addCellZones
(
polyMesh& mesh
) const
void Foam::meshReader::addCellZones(polyMesh& mesh) const
{
cellTable_.addCellZones(mesh, cellTableId_);
warnDuplicates("cellZones", mesh.cellZones().names());
}
// attach faceZones based on the monitoring boundary conditions
void Foam::meshReader::addFaceZones
(
polyMesh& mesh
) const
void Foam::meshReader::addFaceZones(polyMesh& mesh) const
{
label nZone = monitoringSets_.size();
mesh.faceZones().setSize(nZone);
@ -128,7 +117,6 @@ void Foam::meshReader::addFaceZones
}
// create and access the polyMesh
Foam::autoPtr<Foam::polyMesh> Foam::meshReader::mesh
(
const objectRegistry& registry
@ -172,7 +160,6 @@ Foam::autoPtr<Foam::polyMesh> Foam::meshReader::mesh
}
//- write the polyMesh
void Foam::meshReader::writeMesh
(
const polyMesh& mesh,
@ -199,7 +186,6 @@ void Foam::meshReader::writeMesh
}
// Clear extra storage before creation of the mesh to reduce the memory usage
void Foam::meshReader::clearExtraStorage()
{
cellFaces_.clear();
@ -241,6 +227,7 @@ Foam::meshReader::meshReader
cellTable_()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::meshReader::~meshReader()
@ -248,7 +235,5 @@ Foam::meshReader::~meshReader()
deleteDemandDrivenData(pointCellsPtr_);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -51,6 +51,7 @@ SourceFiles
createPolyCells.C
meshReader.C
meshReaderAux.C
\*---------------------------------------------------------------------------*/
#ifndef meshReader_H
@ -74,54 +75,69 @@ namespace Foam
class meshReader
{
protected:
//- identify cell faces in terms of cell Id and face Id
//- Identify cell faces in terms of cell Id and face Id
class cellFaceIdentifier
{
public:
//- cell Id
label cell;
// Public data
//- face Id
label face;
//- Cell Id
label cell;
//- Construct null
cellFaceIdentifier() : cell(-1), face(-1) {}
//- Face Id
label face;
// Constructors
//- Construct null
cellFaceIdentifier() : cell(-1), face(-1) {}
//- Construct from cell/face components
cellFaceIdentifier(label c, label f) : cell(c), face(f) {}
//- Construct from cell/face components
cellFaceIdentifier(label c, label f) : cell(c), face(f) {}
// Check
//- used if cell or face are non-negative
bool used() const
{
return (cell >= 0 && face >= 0);
}
//- Used if cell or face are non-negative
bool used() const
{
return (cell >= 0 && face >= 0);
}
//- Unused if cell or face are negative
bool unused() const
{
return (cell < 0 || face < 0);
}
//- unsed if cell or face are negative
bool unused() const
{
return (cell < 0 || face < 0);
}
// Member Operators
bool operator!=(const cellFaceIdentifier& cf) const
{
return (cell != cf.cell || face != cf.face);
}
bool operator==(const cellFaceIdentifier& cf) const
{
return (cell == cf.cell && face == cf.face);
}
bool operator!=(const cellFaceIdentifier& cf) const
{
return (cell != cf.cell || face != cf.face);
}
bool operator==(const cellFaceIdentifier& cf) const
{
return (cell == cf.cell && face == cf.face);
}
// IOstream Operators
friend Ostream& operator<<(Ostream& os, const cellFaceIdentifier& cf)
{
os << "(" << cf.cell << "/" << cf.face << ")";
return os;
}
};
friend Ostream& operator<<
(
Ostream& os,
const cellFaceIdentifier& cf
)
{
os << "(" << cf.cell << "/" << cf.face << ")";
return os;
}
};
private:
@ -154,6 +170,7 @@ private:
//- Face sets for monitoring
HashTable<List<label>, word, string::hash> monitoringSets_;
// Private Member Functions
//- Disallow default bitwise copy construct
@ -170,7 +187,7 @@ private:
//- Make polyhedral cells and global faces if the mesh is polyhedral
void createPolyCells();
//- add in boundary face
//- Add in boundary face
void addPolyBoundaryFace
(
const label cellId,
@ -178,17 +195,17 @@ private:
const label nCreatedFaces
);
//- add in boundary face
//- Add in boundary face
void addPolyBoundaryFace
(
const cellFaceIdentifier& identifier,
const label nCreatedFaces
);
//- add cellZones based on cellTable Id
//- Add cellZones based on cellTable Id
void addCellZones(polyMesh&) const;
//- add faceZones based on monitoring boundary conditions
//- Add faceZones based on monitoring boundary conditions
void addFaceZones(polyMesh&) const;
//- Make polyhedral boundary from shape boundary
@ -204,7 +221,7 @@ private:
void writeInterfaces(const objectRegistry&) const;
// write List<label> in constant/polyMesh
//- Write List<label> in constant/polyMesh
void writeMeshLabelList
(
const objectRegistry& registry,
@ -219,7 +236,9 @@ private:
return const_cast<faceListList&>(cellFaces_);
}
protected:
// Protected data
//- Pointers to cell shape models
@ -229,19 +248,19 @@ protected:
static const cellModel* prismModel;
static const cellModel* hexModel;
//- referenced filename
//- Referenced filename
fileName geometryFile_;
//- geometry scaling
//- Geometry scaling
scalar scaleFactor_;
//- Points supporting the mesh
pointField points_;
//- lookup original Cell number for a given cell
//- Lookup original Cell number for a given cell
labelList origCellId_;
//- identify boundary faces by cells and their faces
//- Identify boundary faces by cells and their faces
// for each patch
List<List<cellFaceIdentifier> > boundaryIds_;
@ -260,19 +279,17 @@ protected:
//- List of each baffle face
faceList baffleFaces_;
// cell table id for each cell
//- Cell table id for each cell
labelList cellTableId_;
// cell table persistent data saved as a dictionary
//- Cell table persistent data saved as a dictionary
cellTable cellTable_;
// Member Functions
//- subclasses are required to supply this information
virtual bool readGeometry
(
const scalar scaleFactor = 1.0
) = 0;
//- Subclasses are required to supply this information
virtual bool readGeometry(const scalar scaleFactor = 1.0) = 0;
//- Return mesh points
pointField& points() const
@ -280,23 +297,28 @@ protected:
return const_cast<pointField&>(points_);
}
public:
// Static Members
//- warn about repeated names
//- Warn about repeated names
static void warnDuplicates(const word& context, const wordList&);
// Constructors
//- Construct from fileName
meshReader(const fileName&, const scalar scaleFactor = 1.0);
// Destructor
virtual ~meshReader();
//- Destructor
virtual ~meshReader();
// Member Functions
//- create and return polyMesh
//- Create and return polyMesh
virtual autoPtr<polyMesh> mesh(const objectRegistry&);
//- Write auxiliary information
@ -310,6 +332,7 @@ public:
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -23,17 +23,14 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*----------------------------------------------------------------------------*/
#include "meshReader.H"
#include "IOMap.H"
#include "OFstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Static Functions * * * * * * * * * * * * * //
// warn about duplicate names
void Foam::meshReader::warnDuplicates
(
const word& context,
@ -76,8 +73,6 @@ void Foam::meshReader::warnDuplicates
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// write interface (baffle) mapping
void Foam::meshReader::writeInterfaces(const objectRegistry& registry) const
{
// write constant/polyMesh/interface
@ -103,14 +98,12 @@ void Foam::meshReader::writeInterfaces(const objectRegistry& registry) const
ioObj.writeHeader(os);
os << interfaces_
<< "// ************************************************************************* //"
<< "// *************************************"
<< "************************************ //"
<< endl;
}
// write List<label> in constant/polyMesh
// this is crucial for later conversion back to ccm/starcd
void Foam::meshReader::writeMeshLabelList
(
const objectRegistry& registry,
@ -151,6 +144,7 @@ void Foam::meshReader::writeMeshLabelList
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::meshReader::writeAux(const objectRegistry& registry) const
@ -179,10 +173,4 @@ void Foam::meshReader::writeAux(const objectRegistry& registry) const
}
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -34,21 +34,16 @@ License
#include "IFstream.H"
#include "IOMap.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// special boundary regions
const char* Foam::meshReaders::STARCD::defaultBoundaryName =
"Default_Boundary_Region";
const char* Foam::meshReaders::STARCD::defaultSolidBoundaryName =
"Default_Boundary_Solid";
// keep solids
bool Foam::meshReaders::STARCD::keepSolids = false;
// face addressing from pro-STAR faces -> foam faces
const int Foam::meshReaders::STARCD::starToFoamFaceAddr[4][6] =
{
{ 4, 5, 2, 3, 0, 1 }, // 11 = pro-STAR hex
@ -57,12 +52,9 @@ const int Foam::meshReaders::STARCD::starToFoamFaceAddr[4][6] =
{ 0, -1, 4, 2, 1, 3 } // 14 = pro-STAR pyramid
};
// * * * * * * * * * * * * * * Static Functions * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// read and discard to newline
void Foam::meshReaders::STARCD::readToNewline(IFstream& is)
{
char ch = '\n';
@ -73,14 +65,8 @@ void Foam::meshReaders::STARCD::readToNewline(IFstream& is)
while ((is) && ch != '\n');
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// read header
bool Foam::meshReaders::STARCD::readHeader
(
IFstream& is,
word fileSignature
)
bool Foam::meshReaders::STARCD::readHeader(IFstream& is, word fileSignature)
{
if (!is.good())
{
@ -108,19 +94,16 @@ bool Foam::meshReaders::STARCD::readHeader
return true;
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// read boundaryRegion names and the cellTable information from
// dictionaries that have been extracted from the .inp file
void Foam::meshReaders::STARCD::readAux
(
const objectRegistry& registry
)
void Foam::meshReaders::STARCD::readAux(const objectRegistry& registry)
{
boundaryRegion_.readDict(registry);
cellTable_.readDict(registry);
}
// read in the points from the .vrt file
//
/*---------------------------------------------------------------------------*\
@ -219,7 +202,6 @@ void Foam::meshReaders::STARCD::readPoints
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// read in the cells from the .cel file
//
@ -261,10 +243,7 @@ for each cell face.
Strictly speaking, we only need the cellModeller for adding boundaries.
\*---------------------------------------------------------------------------*/
void Foam::meshReaders::STARCD::readCells
(
const fileName& inputName
)
void Foam::meshReaders::STARCD::readCells(const fileName& inputName)
{
const word fileSignature = "PROSTAR_CELL";
label nFluids = 0, nSolids = 0, nBaffles = 0, nShells = 0;
@ -545,7 +524,8 @@ void Foam::meshReaders::STARCD::readCells
{
Info<< "star cell " << starCellId << " has "
<< (nFaces - faceI)
<< " empty faces - could cause boundary addressing problems"
<< " empty faces - could cause boundary "
<< "addressing problems"
<< endl;
nFaces = faceI;
@ -633,6 +613,7 @@ void Foam::meshReaders::STARCD::readCells
mapToFoamPointId_.clear();
}
// read in the boundaries from the .bnd file
//
/*---------------------------------------------------------------------------*\
@ -653,10 +634,7 @@ BAFFLE
etc,
\*---------------------------------------------------------------------------*/
void Foam::meshReaders::STARCD::readBoundary
(
const fileName& inputName
)
void Foam::meshReaders::STARCD::readBoundary(const fileName& inputName)
{
const word fileSignature = "PROSTAR_BOUNDARY";
label nPatches = 0, nFaces = 0, nBafflePatches = 0, maxId = 0;
@ -1059,13 +1037,9 @@ void Foam::meshReaders::STARCD::cullPoints()
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
bool Foam::meshReaders::STARCD::readGeometry
(
const scalar scaleFactor
)
bool Foam::meshReaders::STARCD::readGeometry(const scalar scaleFactor)
{
// Info<< "called meshReaders::STARCD::readGeometry" << endl;
@ -1077,9 +1051,9 @@ bool Foam::meshReaders::STARCD::readGeometry
return true;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from reading a file
Foam::meshReaders::STARCD::STARCD
(
const fileName& prefix,
@ -1095,11 +1069,11 @@ Foam::meshReaders::STARCD::STARCD
readAux(registry);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::meshReaders::STARCD::~STARCD()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -67,7 +67,8 @@ class STARCD
protected:
// Private Data
// Protected Data
static const char* defaultBoundaryName;
static const char* defaultSolidBoundaryName;
@ -83,10 +84,11 @@ protected:
//- Cell labels (imported Cell numbering not necessarily contiguous)
labelList mapToFoamCellId_;
//- boundary region data
//- Boundary region data
boundaryRegion boundaryRegion_;
// Private Member Functions
// Protected Member Functions
//- Disallow default bitwise copy construct
STARCD(const STARCD&);
@ -97,27 +99,28 @@ protected:
//- Read the mesh from the file(s)
virtual bool readGeometry(const scalar scaleFactor = 1.0);
//- read points from file
//- Read points from file
void readPoints(const fileName&, const scalar scaleFactor);
//- read cell connectivities from file
//- Read cell connectivities from file
virtual void readCells(const fileName&);
//- remove unused points
//- Remove unused points
void cullPoints();
//- read boundary (cell/face) definitions
//- Read boundary (cell/face) definitions
void readBoundary(const fileName&);
//- read auxiliary data from constant/{boundaryRegion,cellTable}
//- Read auxiliary data from constant/{boundaryRegion,cellTable}
void readAux(const objectRegistry&);
//- read and discard to newline
//- Read and discard to newline
static void readToNewline(IFstream&);
//- read header
//- Read header
static bool readHeader(IFstream&, word fileSignature);
protected:
enum cellType
@ -145,9 +148,12 @@ protected:
public:
//- keep solids (default false)
// Static data
//- Keep solids (default false)
static bool keepSolids;
// Constructors
//- Construct from case name
@ -158,19 +164,19 @@ public:
const scalar scaleFactor = 1.0
);
// Destructor
virtual ~STARCD();
// Member Functions
//- Destructor
virtual ~STARCD();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace meshReaders
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -36,7 +36,6 @@ Foam::boundaryRegion::boundaryRegion()
{}
// read constant/boundaryRegion (IOMap<dictionary>)
Foam::boundaryRegion::boundaryRegion
(
const objectRegistry& registry,
@ -55,6 +54,7 @@ Foam::boundaryRegion::boundaryRegion
Foam::boundaryRegion::~boundaryRegion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::label Foam::boundaryRegion::append(const dictionary& dict)
@ -73,8 +73,7 @@ Foam::label Foam::boundaryRegion::append(const dictionary& dict)
}
Foam::Map<Foam::word>
Foam::boundaryRegion::names() const
Foam::Map<Foam::word> Foam::boundaryRegion::names() const
{
Map<word> lookup;
@ -90,8 +89,7 @@ Foam::boundaryRegion::names() const
}
Foam::Map<Foam::word>
Foam::boundaryRegion::boundaryTypes() const
Foam::Map<Foam::word> Foam::boundaryRegion::boundaryTypes() const
{
Map<word> lookup;
@ -139,7 +137,6 @@ Foam::word Foam::boundaryRegion::boundaryType(const word& name) const
}
// read constant/boundaryRegion (IOMap<dictionary>)
void Foam::boundaryRegion::readDict
(
const objectRegistry& registry,
@ -174,7 +171,6 @@ void Foam::boundaryRegion::readDict
}
// write constant/boundaryRegion for later reuse
void Foam::boundaryRegion::writeDict
(
const objectRegistry& registry,
@ -208,12 +204,12 @@ void Foam::boundaryRegion::writeDict
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::boundaryRegion::operator=(const boundaryRegion& rhs)
{
Map<dictionary>::operator=(rhs);
}
void Foam::boundaryRegion::operator=(const Map<dictionary>& rhs)
{
Map<dictionary>::operator=(rhs);
@ -260,9 +256,5 @@ void Foam::boundaryRegion::rename(const dictionary& dict)
}
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -72,15 +72,13 @@ class boundaryRegion
:
public Map<dictionary>
{
// Private data
// Private Member Functions
//- Disallow default bitwise copy construct
boundaryRegion(const boundaryRegion&);
//- Disallow default bitwise copy construct
boundaryRegion(const boundaryRegion&);
public:
// Static Members
// Constructors
@ -96,8 +94,8 @@ public:
);
// Destructor
~boundaryRegion();
//- Destructor
~boundaryRegion();
// Member Functions
@ -126,7 +124,6 @@ public:
const fileName& instance = "constant"
);
//- Write constant/boundaryRegion for later reuse
void writeDict
(
@ -153,13 +150,14 @@ public:
// newPatchName originalName;
// @endverbatim
void rename(const dictionary&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -37,7 +37,6 @@ const char* const Foam::cellTable::defaultMaterial_ = "fluid";
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
//- map from cellTable Id -> zone number (unmapped = -1)
Foam::labelList Foam::cellTable::zoneMap() const
{
label maxId = 0;
@ -78,7 +77,6 @@ Foam::wordList Foam::cellTable::namesList() const
}
// add required entries - MaterialType
void Foam::cellTable::addDefaults()
{
forAllIter(Map<dictionary>, *this, iter)
@ -115,14 +113,12 @@ void Foam::cellTable::setEntry
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cellTable::cellTable()
:
Map<dictionary>()
{}
// read constant/cellTable (IOMap<dictionary>)
Foam::cellTable::cellTable
(
const objectRegistry& registry,
@ -136,13 +132,12 @@ Foam::cellTable::cellTable
}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cellTable::~cellTable()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::label Foam::cellTable::append(const dictionary& dict)
@ -161,8 +156,7 @@ Foam::label Foam::cellTable::append(const dictionary& dict)
}
Foam::Map<Foam::word>
Foam::cellTable::names() const
Foam::Map<Foam::word> Foam::cellTable::names() const
{
Map<word> lookup;
@ -211,8 +205,10 @@ Foam::label Foam::cellTable::findIndex(const word& name) const
}
Foam::Map<Foam::word>
Foam::cellTable::selectType(const word& materialType) const
Foam::Map<Foam::word> Foam::cellTable::selectType
(
const word& materialType
) const
{
Map<word> lookup;
@ -236,29 +232,25 @@ Foam::cellTable::selectType(const word& materialType) const
}
Foam::Map<Foam::word>
Foam::cellTable::fluids() const
Foam::Map<Foam::word> Foam::cellTable::fluids() const
{
return selectType("fluid");
}
Foam::Map<Foam::word>
Foam::cellTable::solids() const
Foam::Map<Foam::word> Foam::cellTable::solids() const
{
return selectType("solid");
}
Foam::Map<Foam::word>
Foam::cellTable::shells() const
Foam::Map<Foam::word> Foam::cellTable::shells() const
{
return selectType("shell");
}
Foam::Map<Foam::word>
Foam::cellTable::materialTypes() const
Foam::Map<Foam::word> Foam::cellTable::materialTypes() const
{
Map<word> lookup;
@ -275,7 +267,6 @@ Foam::cellTable::materialTypes() const
}
//- assign material Type
void Foam::cellTable::setMaterial(const label& id, const word& matlType)
{
setEntry(id, "MaterialType", matlType);
@ -299,7 +290,6 @@ void Foam::cellTable::setName(const label& id)
}
// read constant/cellTable (IOMap<dictionary>)
void Foam::cellTable::readDict
(
const objectRegistry& registry,
@ -335,7 +325,6 @@ void Foam::cellTable::readDict
}
// write constant/cellTable for later reuse
void Foam::cellTable::writeDict
(
const objectRegistry& registry,
@ -369,19 +358,20 @@ void Foam::cellTable::writeDict
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::cellTable::operator=(const cellTable& rhs)
{
Map<dictionary>::operator=(rhs);
addDefaults();
}
void Foam::cellTable::operator=(const Map<dictionary>& rhs)
{
Map<dictionary>::operator=(rhs);
addDefaults();
}
void Foam::cellTable::operator=(const polyMesh& mesh)
{
Map<dictionary> zoneDict;
@ -430,9 +420,6 @@ void Foam::cellTable::operator=(const polyMesh& mesh)
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// attach cellZones based on the cellTable Id
// - any other values can be extracted later from the cellTable dictionary
void Foam::cellTable::addCellZones
(
polyMesh& mesh,
@ -580,8 +567,5 @@ void Foam::cellTable::combine(const dictionary& dict, labelList& tableIds)
}
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -80,7 +80,9 @@ class cellTable
public Map<dictionary>
{
// Private data
static const char* const defaultMaterial_;
static const char* const defaultMaterial_;
// Private Member Functions
@ -98,8 +100,8 @@ class cellTable
//- Disallow default bitwise copy construct
cellTable(const cellTable&);
public:
// Static Members
// Constructors
@ -115,8 +117,8 @@ public:
);
// Destructor
~cellTable();
//- Destructor
~cellTable();
// Member Functions
@ -175,6 +177,7 @@ public:
const fileName& instance = "constant"
) const;
// Member Operators
//- Assignment
@ -195,13 +198,14 @@ public:
//- Combine tableIds together
// each dictionary entry is a wordList
void combine(const dictionary&, labelList& tableIds);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -29,27 +29,34 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// Pointers to cell shape models
const Foam::cellModel* Foam::meshWriter::unknownModel = Foam::cellModeller::
lookup
(
"unknown"
);
const Foam::cellModel* Foam::meshWriter::tetModel = Foam::cellModeller::
lookup
(
"tet"
);
const Foam::cellModel* Foam::meshWriter::pyrModel = Foam::cellModeller::
lookup
(
"pyr"
);
const Foam::cellModel* Foam::meshWriter::prismModel = Foam::cellModeller::
lookup
(
"prism"
);
const Foam::cellModel* Foam::meshWriter::hexModel = Foam::cellModeller::
lookup
(
@ -61,15 +68,9 @@ Foam::string Foam::meshWriter::defaultMeshName = "meshExport";
Foam::string Foam::meshWriter::defaultSurfaceName = "surfExport";
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::meshWriter::meshWriter
(
const polyMesh& mesh,
const scalar scaleFactor
)
Foam::meshWriter::meshWriter(const polyMesh& mesh, const scalar scaleFactor)
:
mesh_(mesh),
scaleFactor_(scaleFactor),
@ -80,27 +81,10 @@ Foam::meshWriter::meshWriter
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::meshWriter::~meshWriter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -90,8 +90,6 @@ namespace Foam
class meshWriter
{
// Private data
// Private Member Functions
//- Disallow default bitwise copy construct
@ -100,16 +98,18 @@ class meshWriter
//- Disallow default bitwise assignment
void operator=(const meshWriter&);
protected:
// Protected data
//- mesh reference
//- Mesh reference
const polyMesh& mesh_;
//- scaling factor for points (eg, [m] -> [mm])
//- Scaling factor for points (eg, [m] -> [mm])
scalar scaleFactor_;
//- write bnd file
//- Write bnd file
bool writeBoundary_;
//- boundaryRegion persistent data saved as a dictionary
@ -118,7 +118,7 @@ protected:
//- cellTable persistent data saved as a dictionary
cellTable cellTable_;
// cellTable IDs for each cell
//- cellTable IDs for each cell
labelList cellTableId_;
//- Pointers to cell shape models
@ -128,6 +128,7 @@ protected:
static const cellModel* prismModel;
static const cellModel* hexModel;
public:
// Static data members
@ -138,7 +139,7 @@ public:
// Constructors
//- create a writer obejct
//- Ccreate a writer obejct
meshWriter
(
const polyMesh&,
@ -146,60 +147,46 @@ public:
);
// Selectors
// Destructor
virtual ~meshWriter();
//- Destructor
virtual ~meshWriter();
// Member Functions
// Access
// Check
// Edit
//- set points scaling
void scaleFactor(const scalar scaling)
{
scaleFactor_ = scaling;
}
//- Set points scaling
void scaleFactor(const scalar scaling)
{
scaleFactor_ = scaling;
}
//- Suppress writing bnd file
void noBoundary()
{
writeBoundary_ = false;
}
//- suppress writing bnd file
void noBoundary()
{
writeBoundary_ = false;
}
// Write
//- write volume mesh
// subclass must to supply this method
virtual bool write
(
const fileName& timeName = fileName::null
) const = 0;
//- Write volume mesh
// subclass must to supply this method
virtual bool write
(
const fileName& timeName = fileName::null
) const = 0;
//- write surface mesh with optional triangulation
// subclass could supply this information
virtual bool writeSurface
(
const fileName& timeName = fileName::null,
const bool& triangulate = false
) const
{
return false;
}
// Member Operators
// Friend Functions
// Friend Operators
// IOstream Operators
//- Write surface mesh with optional triangulation
// subclass could supply this information
virtual bool writeSurface
(
const fileName& timeName = fileName::null,
const bool& triangulate = false
) const
{
return false;
}
};
@ -209,10 +196,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// #include "meshWriterI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -32,11 +32,9 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// special boundary regions
const char* Foam::meshWriters::STARCD::defaultBoundaryName =
"Default_Boundary_Region";
// face addressing from foam faces -> pro-STAR faces for primitive shapes
const Foam::label Foam::meshWriters::STARCD::foamToStarFaceAddr[4][6] =
{
{ 4, 5, 2, 3, 0, 1 }, // 11 = pro-STAR hex
@ -174,12 +172,7 @@ void Foam::meshWriters::STARCD::getCellTable()
}
// Prostar 4+ header format
void Foam::meshWriters::STARCD::writeHeader
(
Ostream& os,
const char* filetype
)
void Foam::meshWriters::STARCD::writeHeader(Ostream& os, const char* filetype)
{
os << "PROSTAR_" << filetype << nl
<< 4000
@ -194,10 +187,7 @@ void Foam::meshWriters::STARCD::writeHeader
}
void Foam::meshWriters::STARCD::writePoints
(
const fileName& prefix
) const
void Foam::meshWriters::STARCD::writePoints(const fileName& prefix) const
{
OFstream os(prefix + ".vrt");
writeHeader(os, "VERTEX");
@ -227,10 +217,7 @@ void Foam::meshWriters::STARCD::writePoints
}
void Foam::meshWriters::STARCD::writeCells
(
const fileName& prefix
) const
void Foam::meshWriters::STARCD::writeCells(const fileName& prefix) const
{
OFstream os(prefix + ".cel");
writeHeader(os, "CELL");
@ -372,10 +359,7 @@ void Foam::meshWriters::STARCD::writeCells
}
void Foam::meshWriters::STARCD::writeBoundary
(
const fileName& prefix
) const
void Foam::meshWriters::STARCD::writeBoundary(const fileName& prefix) const
{
OFstream os(prefix + ".bnd");
writeHeader(os, "BOUNDARY");
@ -495,9 +479,6 @@ Foam::meshWriters::STARCD::STARCD
}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::meshWriters::STARCD::~STARCD()
@ -506,10 +487,7 @@ Foam::meshWriters::STARCD::~STARCD()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::meshWriters::STARCD::rmFiles
(
const fileName& baseName
) const
void Foam::meshWriters::STARCD::rmFiles(const fileName& baseName) const
{
rm(baseName + ".vrt");
rm(baseName + ".cel");
@ -518,10 +496,7 @@ void Foam::meshWriters::STARCD::rmFiles
}
bool Foam::meshWriters::STARCD::write
(
const fileName& meshName
) const
bool Foam::meshWriters::STARCD::write(const fileName& meshName) const
{
fileName baseName(meshName);
@ -748,10 +723,4 @@ bool Foam::meshWriters::STARCD::writeSurface
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -64,8 +64,10 @@ class STARCD
public meshWriter
{
// Private Data
static const char* defaultBoundaryName;
// Private Member Functions
//- Disallow default bitwise copy construct
@ -74,22 +76,23 @@ class STARCD
//- Disallow default bitwise assignment
void operator=(const STARCD&);
//- pro-STAR 4+ header format
//- Pro-STAR 4+ header format
static void writeHeader(Ostream&, const char* filetype);
//- write points
//- Write points
void writePoints(const fileName& baseName) const;
//- write cells
//- Write cells
void writeCells(const fileName& baseName) const;
//- write boundary
//- Write boundary
void writeBoundary(const fileName& baseName) const;
void getCellTable();
label findDefaultBoundary() const;
public:
// Static data members
@ -100,68 +103,50 @@ public:
// Constructors
//- open a file for writing
//- Open a file for writing
STARCD
(
const polyMesh&,
const scalar scaleFactor = 1.0
);
// Selectors
// Destructor
virtual ~STARCD();
//- Destructor
virtual ~STARCD();
// Member Functions
// Access
// Check
// Edit
//- Remove STAR-CD files for the baseName
void rmFiles(const fileName& baseName) const;
// Write
//- Write volume mesh
virtual bool write
(
const fileName& meshName = fileName::null
) const;
//- Remove STAR-CD files for the baseName
void rmFiles(const fileName& baseName) const;
//- write volume mesh
virtual bool write
(
const fileName& meshName = fileName::null
) const;
//- write surface mesh with optional triangulation
virtual bool writeSurface
(
const fileName& meshName = fileName::null,
const bool& triangulate = false
) const;
// Member Operators
// Friend Functions
// Friend Operators
// IOstream Operators
//- Write surface mesh with optional triangulation
virtual bool writeSurface
(
const fileName& meshName = fileName::null,
const bool& triangulate = false
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace meshWriters
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -474,7 +474,7 @@ Foam::scalar Foam::hexRef8::getLevel0EdgeLength() const
forAll(typEdgeLenSqr, levelI)
{
if (typEdgeLenSqr[levelI] == GREAT2)
if (typEdgeLenSqr[levelI] == GREAT2 && maxEdgeLenSqr[levelI] >= 0)
{
typEdgeLenSqr[levelI] = maxEdgeLenSqr[levelI];
}
@ -496,13 +496,14 @@ Foam::scalar Foam::hexRef8::getLevel0EdgeLength() const
if (lenSqr < GREAT2)
{
level0Size = Foam::sqrt(lenSqr)/(1<<levelI);
level0Size = Foam::sqrt(lenSqr)*(1<<levelI);
if (debug)
{
Pout<< "hexRef8::getLevel0EdgeLength() :"
<< " For level:" << levelI
<< " found edgeLen:" << level0Size
<< " have edgeLen:" << Foam::sqrt(lenSqr)
<< " with equivalent level0 len:" << level0Size
<< endl;
}
break;

View File

@ -137,7 +137,6 @@ void Foam::polyMeshInfo::queryWedge()
void Foam::polyMeshInfo::queryDirections()
{
vector dirVec = vector::zero;
forAll(mesh_.boundaryMesh(), patchi)
@ -147,7 +146,8 @@ void Foam::polyMeshInfo::queryDirections()
if (mesh_.boundaryMesh()[patchi].size())
{
nEmpty_++;
dirVec += sum(cmptMag(mesh_.boundaryMesh()[patchi].faceAreas()));
dirVec +=
sum(cmptMag(mesh_.boundaryMesh()[patchi].faceAreas()));
}
}
}
@ -226,12 +226,6 @@ Foam::polyMeshInfo::~polyMeshInfo()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::Vector<Foam::label>& Foam::polyMesh::directions() const
{
return directions_;
}
Foam::label Foam::polyMeshInfo::nGeometricD() const
{
return nGeometricD_;

View File

@ -114,12 +114,9 @@ void muSgsWallFunctionFvPatchScalarField::evaluate
const LESModel& sgsModel
= db().lookupObject<LESModel>("LESProperties");
scalar kappa = dimensionedScalar(sgsModel.lookup("kappa")).value();
scalar kappa = readScalar(sgsModel.lookup("kappa"));
scalar E = dimensionedScalar
(
sgsModel.subDict("wallFunctionCoeffs").lookup("E")
).value();
scalar E = readScalar(sgsModel.subDict("wallFunctionCoeffs").lookup("E"));
const scalarField& ry = patch().deltaCoeffs();

View File

@ -103,12 +103,9 @@ void nuSgsWallFunctionFvPatchScalarField::evaluate
const LESModel& sgsModel
= db().lookupObject<LESModel>("LESProperties");
scalar kappa = dimensionedScalar(sgsModel.lookup("kappa")).value();
scalar kappa = readScalar(sgsModel.lookup("kappa"));
scalar E = dimensionedScalar
(
sgsModel.subDict("wallFunctionCoeffs").lookup("E")
).value();
scalar E = readScalar(sgsModel.subDict("wallFunctionCoeffs").lookup("E"));
const scalarField& ry = patch().deltaCoeffs();

View File

@ -0,0 +1,52 @@
// The FOAM Project // File: motionProperties
/*
-------------------------------------------------------------------------------
========= | dictionary
\\ / |
\\ / | Name: motionProperties
\\ / | Family: FoamX configuration file
\\/ |
F ield | FOAM version: 2.1
O peration | Product of Nabla Ltd.
A and |
M anipulation | Email: Enquiries@Nabla.co.uk
-------------------------------------------------------------------------------
*/
// FoamX Case Dictionary.
version 1.0;
format ascii;
root "/home/warhol/chris/foam/chris2.1/run/Test";
case "movingCone";
instance "constant";
local "";
class dictionary;
form dictionary;
object motionProperties;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//motionSolverLibs ("libfvMotionSolvers.so");
solver laplacian;
//solver componentLaplacian x;
twoDMotion no;
diffusivity uniform;
//motionPlaneNormal (0 0 1);
//
//movingSurface yes;
//
//twoFluids no;
//
//normalMotionDir no;
//
//motionURF 1.0;
//
//boundaryCorrection yes;
// ************************************************************************* //

View File

@ -0,0 +1,82 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(-2.03 -2.0 0)
( 8.03 -2.0 0)
( 8.03 8.0 0)
(-2.03 8.0 0)
(-2.03 -2.0 5)
( 8.03 -2.0 5)
( 8.03 8.0 5)
(-2.03 8.0 5)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (20 20 20) simpleGrading (1 1 1)
);
edges
(
);
patches
(
patch maxY
(
(3 7 6 2)
)
patch minX
(
(0 4 7 3)
)
patch maxX
(
(2 6 5 1)
)
patch minY
(
(1 5 4 0)
)
patch minZ
(
(0 3 2 1)
)
patch maxZ
(
(4 5 6 7)
)
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu nu [0 2 -1 0 0 0 0] 0.01;
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 100;
deltaT 1;
writeControl timeStep;
writeInterval 1;
purgeWrite 0;
//writeFormat binary;
writeFormat ascii;
writePrecision 7;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
// The FOAM Project // File: decomposeParDict
/*
-------------------------------------------------------------------------------
========= | dictionary
\\ / |
\\ / | Name: decomposeParDict
\\ / | Family: FoamX configuration file
\\/ |
F ield | FOAM version: 2.1
O peration | Product of Nabla Ltd.
A and |
M anipulation | Email: Enquiries@Nabla.co.uk
-------------------------------------------------------------------------------
*/
// FoamX Case Dictionary.
FoamFile
{
version 2.0;
format ascii;
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
case "cavity";
instance "system";
local "";
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
arguments "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam" "cavity";
numberOfSubdomains 6;
method hierarchical;
//method metis;
//method parMetis;
simpleCoeffs
{
n (4 1 1);
delta 0.001;
}
hierarchicalCoeffs
{
n (3 2 1);
delta 0.001;
order xyz;
}
manualCoeffs
{
dataFile "cellDecomposition";
}
metisCoeffs
{
//n (5 1 1);
//cellWeightsFile "constant/cellWeightsFile";
}
// ************************************************************************* //

View File

@ -0,0 +1,71 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
//snGradCorr(cellMotionU) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(nu,U) Gauss linear corrected;
laplacian(1|A(U),p) Gauss linear corrected;
laplacian(diffusivity,cellMotionU) Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
interpolate(HbyA) linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
//p ICCG 1e-06 0;
p AMG 1e-06 0 10;
U BICCG 1e-05 0;
// Meshmotion
cellMotionU ICCG 1e-6 0.0;
cellMotionUx ICCG 1e-6 0.0;
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,338 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
case "cavity";
instance "system";
local "";
class dictionary;
object autoHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Which of the steps to run
castellatedMesh true;
snap true;
addLayers true;
// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
fridgeA
{
type searchableBox;
min (2 2 0);
max (3 3 2);
}
fridgeB
{
type searchableBox;
min (3.5 3 0);
max (4.3 3.8 1.8);
}
igloo
{
type searchableSphere;
centre (3 3 0);
radius 4;
}
};
// Settings for the castellatedMesh generation.
castellatedMeshControls
{
// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~
// While refining maximum number of cells per processor. This is basically
// the number of cells that fit on a processor. If you choose this too small
// it will do just more refinement iterations to obtain a similar mesh.
maxLocalCells 1000000;
// Overall cell limit (approximately). Refinement will stop immediately
// upon reaching this number so a refinement level might not complete.
// Note that this is the number of cells before removing the part which
// is not 'visible' from the keepPoint. The final number of cells might
// actually be a lot less.
maxGlobalCells 2000000;
// The surface refinement loop might spend lots of iterations refining just a
// few cells. This setting will cause refinement to stop if <= minimumRefine
// are selected for refinement. Note: it will at least do one iteration
// (unless the number of cells to refine is 0)
minRefinementCells 0;
// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
nCellsBetweenLevels 1;
// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies a level for any cell intersected by its edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
//{
// file "someLine.eMesh";
// level 2;
//}
);
// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies two levels for every surface. The first is the minimum level,
// every cell intersecting a surface gets refined up to the minimum level.
// The second level is the maximum level. Cells that 'see' multiple
// intersections where the intersections make an
// angle > resolveFeatureAngle get refined up to the maximum level.
refinementSurfaces
{
fridgeA
{
// Surface-wise min and max refinement level
level (2 2);
}
fridgeB
{
// Surface-wise min and max refinement level
level (2 2);
}
igloo
{
// Surface-wise min and max refinement level
level (1 1);
}
}
// Resolve sharp angles on fridges
resolveFeatureAngle 60;
// Region-wise refinement
// ~~~~~~~~~~~~~~~~~~~~~~
// Specifies refinement level for cells in relation to a surface. One of
// three modes
// - distance. 'levels' specifies per distance to the surface the
// wanted refinement level. The distances need to be specified in
// descending order.
// - inside. 'levels' is only one entry and only the level is used. All
// cells inside the surface get refined up to the level. The surface
// needs to be closed for this to be possible.
// - outside. Same but cells outside.
refinementRegions
{
}
// Mesh selection
// ~~~~~~~~~~~~~~
// After refinement patches get added for all refinementSurfaces and
// all cells intersecting the surfaces get put into these patches. The
// section reachable from the locationInMesh is kept.
// NOTE: This point should never be on a face, always inside a cell, even
// after refinement.
locationInMesh (3 0.28 0.43);
}
// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 3;
//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 4.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 30;
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
}
// Settings for the layer addition.
addLayersControls
{
// Per final patch (so not geometry!) the layer information
layers
{
fridgeA_region0
{
nSurfaceLayers 1;
}
fridgeB_region0
{
nSurfaceLayers 1;
}
igloo_region0
{
nSurfaceLayers 1;
}
}
// Expansion factor for layer mesh
expansionRatio 1.0;
//- Wanted thickness of final added cell layer. If multiple layers
// is the
// thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
finalLayerRatio 0.5;
//- Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
// Relative to undistorted size of cell outside layer.
minThickness 0.25;
//- If points get not extruded do nGrow layers of connected faces that are
// also not grown. This helps convergence of the layer addition process
// close to features.
nGrow 0;
// Advanced settings
//- When not to extrude surface. 0 is flat surface, 90 is when two faces
// make straight angle.
featureAngle 60;
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;
// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 3;
// Smooth layer thickness over surface patches
nSmoothThickness 10;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;
// Angle used to pick up medial axis points
minMedianAxisAngle 130;
// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;
}
// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 65;
//- Max skewness allowed. Set to <0 to disable.
maxBoundarySkewness 20;
maxInternalSkewness 4;
//- Max concaveness allowed. Is angle (in degrees) below which concavity
// is allowed. 0 is straight face, <0 would be convex face.
// Set to 180 to disable.
maxConcave 80;
//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;
//- Minimum face area. Set to <0 to disable.
minArea -1;
//- Minimum face twist. Set to <-1 to disable. dot product of face normal
//- and face centre triangles normal
minTwist 0.05;
//- minimum normalised cell determinant
//- 1 = hex, <= 0 = folded or flattened illegal cell
minDeterminant 0.001;
//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.05;
//- minVolRatio (0 -> 1)
minVolRatio 0.01;
//must be >0 for Fluent compatibility
minTriangleTwist -1;
// Advanced
//- Number of error distribution iterations
nSmoothScale 4;
//- amount to scale back displacement at error points
errorReduction 0.75;
}
// Advanced
// Flags for optional output
// 0 : only write final meshes
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current intersections as .obj files
debug 0;
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
// The FOAM Project // File: motionProperties
/*
-------------------------------------------------------------------------------
========= | dictionary
\\ / |
\\ / | Name: motionProperties
\\ / | Family: FoamX configuration file
\\/ |
F ield | FOAM version: 2.1
O peration | Product of Nabla Ltd.
A and |
M anipulation | Email: Enquiries@Nabla.co.uk
-------------------------------------------------------------------------------
*/
// FoamX Case Dictionary.
version 1.0;
format ascii;
root "/home/warhol/chris/foam/chris2.1/run/Test";
case "movingCone";
instance "constant";
local "";
class dictionary;
form dictionary;
object motionProperties;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//motionSolverLibs ("libfvMotionSolvers.so");
solver laplacian;
//solver componentLaplacian x;
twoDMotion no;
diffusivity uniform;
//motionPlaneNormal (0 0 1);
//
//movingSurface yes;
//
//twoFluids no;
//
//normalMotionDir no;
//
//motionURF 1.0;
//
//boundaryCorrection yes;
// ************************************************************************* //

View File

@ -0,0 +1,82 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(-20.29 -10 -4.232e-05)
( 41.71 -10 -4.232e-05)
( 41.71 10 -4.232e-05)
(-20.29 10 -4.232e-05)
(-20.29 -10 20)
( 41.71 -10 20)
( 41.71 10 20)
(-20.29 10 20)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (60 20 20) simpleGrading (1 1 1)
);
edges
(
);
patches
(
patch maxY
(
(3 7 6 2)
)
patch minX
(
(0 4 7 3)
)
patch maxX
(
(2 6 5 1)
)
patch minY
(
(1 5 4 0)
)
patch minZ
(
(0 3 2 1)
)
patch maxZ
(
(4 5 6 7)
)
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu nu [0 2 -1 0 0 0 0] 0.01;
// ************************************************************************* //

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,57 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 100;
deltaT 1;
writeControl timeStep;
writeInterval 1;
purgeWrite 0;
//writeFormat binary;
writeFormat ascii;
writePrecision 7;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
// The FOAM Project // File: decomposeParDict
/*
-------------------------------------------------------------------------------
========= | dictionary
\\ / |
\\ / | Name: decomposeParDict
\\ / | Family: FoamX configuration file
\\/ |
F ield | FOAM version: 2.1
O peration | Product of Nabla Ltd.
A and |
M anipulation | Email: Enquiries@Nabla.co.uk
-------------------------------------------------------------------------------
*/
// FoamX Case Dictionary.
FoamFile
{
version 2.0;
format ascii;
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
case "cavity";
instance "system";
local "";
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
arguments "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam" "cavity";
numberOfSubdomains 6;
method hierarchical;
//method metis;
//method parMetis;
simpleCoeffs
{
n (4 1 1);
delta 0.001;
}
hierarchicalCoeffs
{
n (3 2 1);
delta 0.001;
order xyz;
}
manualCoeffs
{
dataFile "cellDecomposition";
}
metisCoeffs
{
//n (5 1 1);
//cellWeightsFile "constant/cellWeightsFile";
}
// ************************************************************************* //

View File

@ -0,0 +1,71 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
//snGradCorr(cellMotionU) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(nu,U) Gauss linear corrected;
laplacian(1|A(U),p) Gauss linear corrected;
laplacian(diffusivity,cellMotionU) Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
interpolate(HbyA) linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
//p ICCG 1e-06 0;
p AMG 1e-06 0 10;
U BICCG 1e-05 0;
// Meshmotion
cellMotionU ICCG 1e-6 0.0;
cellMotionUx ICCG 1e-6 0.0;
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,585 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
case "cavity";
instance "system";
local "";
class dictionary;
object autoHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Which of the steps to run
castellatedMesh true;
snap true;
addLayers true;
// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
motorBike.stl
{
type triSurfaceMesh;
name motorBike;
}
refinementBox
{
type searchableBox;
min (-0.3 -0.4 -0.1);
max ( 3.0 0.4 1.4);
}
};
// Settings for the castellatedMesh generation.
castellatedMeshControls
{
// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~
// While refining maximum number of cells per processor. This is basically
// the number of cells that fit on a processor. If you choose this too small
// it will do just more refinement iterations to obtain a similar mesh.
maxLocalCells 1000000;
// Overall cell limit (approximately). Refinement will stop immediately
// upon reaching this number so a refinement level might not complete.
// Note that this is the number of cells before removing the part which
// is not 'visible' from the keepPoint. The final number of cells might
// actually be a lot less.
maxGlobalCells 2000000;
// The surface refinement loop might spend lots of iterations refining just a
// few cells. This setting will cause refinement to stop if <= minimumRefine
// are selected for refinement. Note: it will at least do one iteration
// (unless the number of cells to refine is 0)
minRefinementCells 10;
// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
nCellsBetweenLevels 2;
// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies a level for any cell intersected by its edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
//{
// file "someLine.eMesh";
// level 2;
//}
);
// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies two levels for every surface. The first is the minimum level,
// every cell intersecting a surface gets refined up to the minimum level.
// The second level is the maximum level. Cells that 'see' multiple
// intersections where the intersections make an
// angle > resolveFeatureAngle get refined up to the maximum level.
refinementSurfaces
{
motorBike
{
// Surface-wise min and max refinement level
level (5 6);
}
}
// Resolve sharp angles
resolveFeatureAngle 30;
// Region-wise refinement
// ~~~~~~~~~~~~~~~~~~~~~~
// Specifies refinement level for cells in relation to a surface. One of
// three modes
// - distance. 'levels' specifies per distance to the surface the
// wanted refinement level. The distances need to be specified in
// descending order.
// - inside. 'levels' is only one entry and only the level is used. All
// cells inside the surface get refined up to the level. The surface
// needs to be closed for this to be possible.
// - outside. Same but cells outside.
refinementRegions
{
refinementBox
{
mode inside;
levels ((1E15 4));
}
}
// Mesh selection
// ~~~~~~~~~~~~~~
// After refinement patches get added for all refinementSurfaces and
// all cells intersecting the surfaces get put into these patches. The
// section reachable from the locationInMesh is kept.
// NOTE: This point should never be on a face, always inside a cell, even
// after refinement.
locationInMesh (3 3 0.43);
}
// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 3;
//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 4.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 30;
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
}
// Settings for the layer addition.
addLayersControls
{
// Per final patch (so not geometry!) the layer information
layers
{
minZ
{
nSurfaceLayers 1;
}
motorBike_frt-fairing:001%1
{
nSurfaceLayers 1;
}
motorBike_windshield:002%2
{
nSurfaceLayers 1;
}
motorBike_rr-wh-rim:005%5
{
nSurfaceLayers 1;
}
motorBike_rr-wh-rim:010%10
{
nSurfaceLayers 1;
}
motorBike_fr-wh-rim:011%11
{
nSurfaceLayers 1;
}
motorBike_fr-wh-brake-disk:012%12
{
nSurfaceLayers 1;
}
motorBike_frame:016-shadow%13
{
nSurfaceLayers 1;
}
motorBike_rear-susp:014%14
{
nSurfaceLayers 1;
}
motorBike_rear-susp:014-shadow%15
{
nSurfaceLayers 1;
}
motorBike_frame:016%16
{
nSurfaceLayers 1;
}
motorBike_rr-wh-rim:005-shadow%17
{
nSurfaceLayers 1;
}
motorBike_rr-wh-chain-hub:022%22
{
nSurfaceLayers 1;
}
motorBike_rearseat%24
{
nSurfaceLayers 1;
}
motorBike_frt-fairing%25
{
nSurfaceLayers 1;
}
motorBike_windshield%26
{
nSurfaceLayers 1;
}
motorBike_headlights%27
{
nSurfaceLayers 1;
}
motorBike_driversseat%28
{
nSurfaceLayers 1;
}
motorBike_rear-body%29
{
nSurfaceLayers 1;
}
motorBike_fuel-tank%30
{
nSurfaceLayers 1;
}
motorBike_exhaust%31
{
nSurfaceLayers 1;
}
motorBike_rr-wh-rim%32
{
nSurfaceLayers 1;
}
motorBike_fr-mud-guard%33
{
nSurfaceLayers 1;
}
motorBike_fr-wh-rim%34
{
nSurfaceLayers 1;
}
motorBike_fr-wh-brake-disk%35
{
nSurfaceLayers 1;
}
motorBike_fr-brake-caliper%36
{
nSurfaceLayers 1;
}
motorBike_fr-wh-tyre%37
{
nSurfaceLayers 1;
}
motorBike_hbars%38
{
nSurfaceLayers 1;
}
motorBike_fr-forks%39
{
nSurfaceLayers 1;
}
motorBike_chain%40
{
nSurfaceLayers 1;
}
motorBike_rr-wh-tyre%41
{
nSurfaceLayers 1;
}
motorBike_square-dial%42
{
nSurfaceLayers 1;
}
motorBike_round-dial%43
{
nSurfaceLayers 1;
}
motorBike_dial-holder%44
{
nSurfaceLayers 1;
}
motorBike_rear-susp%45
{
nSurfaceLayers 1;
}
motorBike_rear-brake-lights%46
{
nSurfaceLayers 1;
}
motorBike_rear-light-bracket%47
{
nSurfaceLayers 1;
}
motorBike_frame%48
{
nSurfaceLayers 1;
}
motorBike_rear-mud-guard%49
{
nSurfaceLayers 1;
}
motorBike_rear-susp-spring-damp%50
{
nSurfaceLayers 1;
}
motorBike_fairing-inner-plate%51
{
nSurfaceLayers 1;
}
motorBike_clutch-housing%52
{
nSurfaceLayers 1;
}
motorBike_radiator%53
{
nSurfaceLayers 1;
}
motorBike_water-pipe%54
{
nSurfaceLayers 1;
}
motorBike_water-pump%55
{
nSurfaceLayers 1;
}
motorBike_engine%56
{
nSurfaceLayers 1;
}
motorBike_rear-shock-link%57
{
nSurfaceLayers 1;
}
motorBike_rear-brake-fluid-pot-bracket%58
{
nSurfaceLayers 1;
}
motorBike_rear-brake-fluid-pot%59
{
nSurfaceLayers 1;
}
motorBike_footpeg%60
{
nSurfaceLayers 1;
}
motorBike_rr-wh-chain-hub%61
{
nSurfaceLayers 1;
}
motorBike_rear-brake-caliper%62
{
nSurfaceLayers 1;
}
motorBike_rider-helmet%65
{
nSurfaceLayers 1;
}
motorBike_rider-visor%66
{
nSurfaceLayers 1;
}
motorBike_rider-boots%67
{
nSurfaceLayers 1;
}
motorBike_rider-gloves%68
{
nSurfaceLayers 1;
}
motorBike_rider-body%69
{
nSurfaceLayers 1;
}
motorBike_frame:0%70
{
nSurfaceLayers 1;
}
motorBike_frt-fairing:001-shadow%74
{
nSurfaceLayers 1;
}
motorBike_windshield-shadow%75
{
nSurfaceLayers 1;
}
motorBike_fr-mud-guard-shadow%81
{
nSurfaceLayers 1;
}
motorBike_fr-wh-brake-disk-shadow%83
{
nSurfaceLayers 1;
}
motorBike_rear-mud-guard-shadow%84
{
nSurfaceLayers 1;
}
motorBike_rear-susp-spring-damp-shadow%85
{
nSurfaceLayers 1;
}
motorBike_radiator-shadow%86
{
nSurfaceLayers 1;
}
motorBike_rear-shock-link-shadow%87
{
nSurfaceLayers 1;
}
motorBike_rear-brake-fluid-pot-bracket-shadow%88
{
nSurfaceLayers 1;
}
motorBike_rr-wh-chain-hub-shadow%89
{
nSurfaceLayers 1;
}
}
// Expansion factor for layer mesh
expansionRatio 1.0;
//- Wanted thickness of final added cell layer. If multiple layers
// is the
// thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
finalLayerRatio 0.3;
//- Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
// Relative to undistorted size of cell outside layer.
minThickness 0.1;
//- If points get not extruded do nGrow layers of connected faces that are
// also not grown. This helps convergence of the layer addition process
// close to features.
nGrow 1;
// Advanced settings
//- When not to extrude surface. 0 is flat surface, 90 is when two faces
// make straight angle.
featureAngle 30;
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 3;
// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;
// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 3;
// Smooth layer thickness over surface patches
nSmoothThickness 10;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;
// Angle used to pick up medial axis points
minMedianAxisAngle 130;
// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;
}
// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 65;
//- Max skewness allowed. Set to <0 to disable.
maxBoundarySkewness 20;
maxInternalSkewness 4;
//- Max concaveness allowed. Is angle (in degrees) below which concavity
// is allowed. 0 is straight face, <0 would be convex face.
// Set to 180 to disable.
maxConcave 80;
//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;
//- Minimum face area. Set to <0 to disable.
minArea -1;
//- Minimum face twist. Set to <-1 to disable. dot product of face normal
//- and face centre triangles normal
minTwist 0.02;
//- minimum normalised cell determinant
//- 1 = hex, <= 0 = folded or flattened illegal cell
minDeterminant 0.001;
//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.02;
//- minVolRatio (0 -> 1)
minVolRatio 0.01;
//must be >0 for Fluent compatibility
minTriangleTwist -1;
// Advanced
//- Number of error distribution iterations
nSmoothScale 4;
//- amount to scale back displacement at error points
errorReduction 0.75;
}
// Advanced
// Flags for optional output
// 0 : only write final meshes
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current intersections as .obj files
debug 0;
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;
// ************************************************************************* //