Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry
2011-03-18 10:26:04 +00:00
181 changed files with 1727 additions and 2615357 deletions

View File

@ -26,7 +26,9 @@ FoamFile
// - specify where the faces should come from
// - specify the type of cyclic. If a rotational specify the rotationAxis
// and centre to make matching easier
// - pointSync true to guarantee points to line up.
// - always create both halves in one invocation with correct 'neighbourPatch'
// setting.
// - optionally pointSync true to guarantee points to line up.
// 2. Correct incorrect cyclic:
// This will usually fail upon loading:
@ -45,24 +47,23 @@ matchTolerance 1E-3;
// Do a synchronisation of coupled points after creation of any patches.
// Note: this does not work with points that are on multiple coupled patches
// with transformations.
pointSync true;
pointSync false;
// Patches to create.
patches
(
{
// Name of new patch
name sidePatches;
name cyc_half0;
// Type of new patch
// Dictionary to construct new patch from
patchInfo
{
type cyclic;
neighbourPatch cyc_half1;
// Optional: explicitly set transformation tensor.
// Used when matching and synchronising points.
//transform translational;
//separationVector (-2289 0 0);
transform rotational;
rotationAxis (1 0 0);
rotationCentre (0 0 0);
@ -72,28 +73,37 @@ patches
constructFrom patches;
// If constructFrom = patches : names of patches. Wildcards allowed.
patches ("periodic.*");
patches (periodic1);
// If constructFrom = set : name of faceSet
set f0;
}
{
name bottom;
// Name of new patch
name cyc_half1;
// Type of new patch
dictionary
// Dictionary to construct new patch from
patchInfo
{
type wall;
type cyclic;
neighbourPatch cyc_half0;
// Optional: explicitly set transformation tensor.
// Used when matching and synchronising points.
transform rotational;
rotationAxis ( 0 0 1 );
rotationCentre ( 0.3 0 0 );
}
constructFrom set;
// How to construct: either from 'patches' or 'set'
constructFrom patches;
patches ();
// If constructFrom = patches : names of patches. Wildcards allowed.
patches (periodic2);
set bottomFaces;
// If constructFrom = set : name of faceSet
set f0;
}
);
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -63,7 +63,15 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
volVectorField U(Uheader, mesh);
if (isFile(runTime.constantPath()/"thermophysicalProperties"))
if
(
IOobject
(
"thermophysicalProperties",
runTime.constant(),
mesh
).headerOk()
)
{
// thermophysical Mach
autoPtr<basicPsiThermo> thermo

View File

@ -204,15 +204,15 @@ fileName="${1#~OpenFOAM/}"
unset dirList
case "$mode" in
*u*) # user
dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}/$version"
dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}"
userDir="$HOME/.${WM_PROJECT:-OpenFOAM}"
dirList="$dirList $userDir/$version $userDir"
;;
esac
case "$mode" in
*g*) # group
dirList="$dirList $prefixDir/site/$version"
dirList="$dirList $prefixDir/site"
*g*) # group (site)
siteDir="${WM_PROJECT_SITE:-$prefixDir/site}"
dirList="$dirList $siteDir/$version $siteDir"
;;
esac

View File

@ -33,6 +33,8 @@
#------------------------------------------------------------------------------
Script=${0##*/}
toolsDir=${0%/*}/tools
siteDir=${WM_PROJECT_SITE:-${WM_PROJECT_INST_DIR:-<unknown>}/site}
userDir=$HOME/.OpenFOAM
usage() {
exec 1>&2
@ -84,10 +86,10 @@ The value taken will be the first (non-space)word after this column.
The database ($Script.db) will taken from these locations:
.
$HOME/.OpenFOAM/$WM_PROJECT_VERSION
$HOME/.OpenFOAM
$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION
$WM_PROJECT_INST_DIR/site
$userDir/$WM_PROJECT_VERSION
$userDir
$siteDir/$WM_PROJECT_VERSION
$siteDir
$WM_PROJECT_DIR/etc
$toolsDir

View File

@ -30,7 +30,7 @@
# - requires rsync
#
#------------------------------------------------------------------------------
siteDir=${WM_PROJECT_INST_DIR:-unknown}/site
siteDir=${WM_PROJECT_SITE:-${WM_PROJECT_INST_DIR:-<unknown>}/site}
userDir=$HOME/.OpenFOAM
version=${WM_PROJECT_VERSION:-unknown}
templateDir="appTemplates"

25
bin/tools/foamConfigurePaths Normal file → Executable file
View File

@ -37,6 +37,7 @@ usage() {
usage: ${0##*/}
--foamInstall dir specify installation directory (e.g. /opt)
--projectName name specify project name (e.g. openfoam170)
--projectVersion ver specify project version (e.g. 1.7.x)
--archOption arch specify architecture option (only 32 or 64 applicable)
--paraviewInstall dir specify ParaView_DIR (e.g. /opt/paraviewopenfoam380)
@ -76,7 +77,7 @@ _inlineSed()
[ -f etc/bashrc ] || usage "Please run from top-level directory of installation"
unset foamInstall projectName archOption paraviewInstall
unset foamInstall projectName projectVersion archOption paraviewInstall
# parse options
while [ "$#" -gt 0 ]
@ -102,7 +103,17 @@ do
_inlineSed \
etc/bashrc \
'/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" \
"Replacing WM_PROJECT_DIR setting by '$projectName'"
"Replacing WM_PROJECT_DIR setting by $projectName"
shift 2
;;
--projectVersion)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
projectVersion="$2"
# replace WM_PROJECT_VERSION=...
_inlineSed \
etc/bashrc \
'/^[^#]/s@WM_PROJECT_VERSION=.*@WM_PROJECT_VERSION='"$projectVersion@" \
"Replacing WM_PROJECT_VERSION setting by $projectVersion"
shift 2
;;
-archOption | --archOption)
@ -142,10 +153,10 @@ _inlineSed \
'/^[^#]/s@export WM_MPLIB=.*@export WM_MPLIB=SYSTEMOPENMPI@' \
"Replacing WM_MPLIB setting by 'SYSTEMOPENMPI'"
# set foamCompiler=system always
_inlineSed \
etc/bashrc \
'/^[^#]/s@foamCompiler=.*@foamCompiler=system@' \
"Replacing foamCompiler setting by 'system'"
## set foamCompiler=system always
#_inlineSed \
# etc/bashrc \
# '/^[^#]/s@foamCompiler=.*@foamCompiler=system@' \
# "Replacing foamCompiler setting by 'system'"
#------------------------------------------------------------------------------

View File

@ -67,6 +67,11 @@ alias foamSol 'cd $FOAM_SOLVERS'
alias foamTuts 'cd $FOAM_TUTORIALS'
alias foamUtils 'cd $FOAM_UTILITIES'
alias foam3rdParty 'cd $WM_THIRD_PARTY_DIR'
alias foamSite 'cd $WM_PROJECT_INST_DIR/site'
if ( $?WM_PROJECT_SITE ) then
alias foamSite 'cd $WM_PROJECT_SITE'
else
alias foamSite 'cd $WM_PROJECT_INST_DIR/site'
endif
# -----------------------------------------------------------------------------

View File

@ -72,6 +72,12 @@ alias foamSol='cd $FOAM_SOLVERS'
alias foamTuts='cd $FOAM_TUTORIALS'
alias foamUtils='cd $FOAM_UTILITIES'
alias foam3rdParty='cd $WM_THIRD_PARTY_DIR'
alias foamSite='cd $WM_PROJECT_INST_DIR/site'
if [ -n "$WM_PROJECT_SITE" ]
then
alias foamSite='cd $WM_PROJECT_SITE'
else
alias foamSite='cd $WM_PROJECT_INST_DIR/site'
fi
# -----------------------------------------------------------------------------

View File

@ -108,16 +108,24 @@ then
fi
# Location of site/user files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Location of installation
# ~~~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
# Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
# Location of site-specific templates etc
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# unset is equivalent to $WM_PROJECT_INST_DIR/site
unset WM_PROJECT_SITE
# Location of user files
# ~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
# Source files, possibly with some verbosity
_foamSource()
@ -169,99 +177,6 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
export FOAM_SETTINGS="$@"
_foamEval $@
# Detect system type and set environment variables appropriately
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_ARCH=`uname -s`
case $WM_ARCH in
Linux)
WM_ARCH=linux
# compiler specifics
case `uname -m` in
i686)
;;
x86_64)
case "$WM_ARCH_OPTION" in
32)
export WM_COMPILER_ARCH='-64'
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m32 -fPIC'
export WM_CXXFLAGS='-m32 -fPIC'
export WM_LDFLAGS='-m32'
;;
64)
WM_ARCH=linux64
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m64 -fPIC'
export WM_CXXFLAGS='-m64 -fPIC'
export WM_LDFLAGS='-m64'
;;
*)
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"
;;
esac
;;
ia64)
WM_ARCH=linuxIA64
export WM_COMPILER=I64
;;
mips64)
WM_ARCH=SiCortex64
WM_MPLIB=MPI
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'
;;
ppc64)
WM_ARCH=linuxPPC64
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m64 -fPIC'
export WM_CXXFLAGS='-m64 -fPIC'
export WM_LDFLAGS='-m64'
;;
*)
echo Unknown processor type `uname -m` for Linux
;;
esac
;;
SunOS)
WM_ARCH=SunOS64
WM_MPLIB=FJMPI
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'
;;
*) # an unsupported operating system
cat <<USAGE
Your "$WM_ARCH" operating system is not supported by this release
of OpenFOAM. For further assistance, please contact www.OpenFOAM.com
USAGE
;;
esac
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "fixedValueFvPatchScalarFieldTemplate.H"
#include "fixedValueFvPatchFieldTemplate.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
@ -71,24 +71,25 @@ extern "C"
makeRemovablePatchTypeField
(
fvPatchScalarField,
${typeName}FixedValueFvPatchScalarField
fvPatch${FieldType},
${typeName}FixedValueFvPatch${FieldType}
);
const char* ${typeName}FixedValueFvPatchScalarField::SHA1sum = "${SHA1sum}";
const char* const ${typeName}FixedValueFvPatch${FieldType}::SHA1sum =
"${SHA1sum}";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
${typeName}FixedValueFvPatchScalarField::
${typeName}FixedValueFvPatchScalarField
${typeName}FixedValueFvPatch${FieldType}::
${typeName}FixedValueFvPatch${FieldType}
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
const DimensionedField<${TemplateType}, volMesh>& iF
)
:
fixedValueFvPatchScalarField(p, iF)
fixedValueFvPatchField<${TemplateType}>(p, iF)
{
if (${verbose:-false})
{
@ -98,16 +99,16 @@ ${typeName}FixedValueFvPatchScalarField
}
${typeName}FixedValueFvPatchScalarField::
${typeName}FixedValueFvPatchScalarField
${typeName}FixedValueFvPatch${FieldType}::
${typeName}FixedValueFvPatch${FieldType}
(
const ${typeName}FixedValueFvPatchScalarField& ptf,
const ${typeName}FixedValueFvPatch${FieldType}& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const DimensionedField<${TemplateType}, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper)
fixedValueFvPatchField<${TemplateType}>(ptf, p, iF, mapper)
{
if (${verbose:-false})
{
@ -117,15 +118,15 @@ ${typeName}FixedValueFvPatchScalarField
}
${typeName}FixedValueFvPatchScalarField::
${typeName}FixedValueFvPatchScalarField
${typeName}FixedValueFvPatch${FieldType}::
${typeName}FixedValueFvPatch${FieldType}
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const DimensionedField<${TemplateType}, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF, dict)
fixedValueFvPatchField<${TemplateType}>(p, iF, dict)
{
if (${verbose:-false})
{
@ -135,13 +136,13 @@ ${typeName}FixedValueFvPatchScalarField
}
${typeName}FixedValueFvPatchScalarField::
${typeName}FixedValueFvPatchScalarField
${typeName}FixedValueFvPatch${FieldType}::
${typeName}FixedValueFvPatch${FieldType}
(
const ${typeName}FixedValueFvPatchScalarField& ptf
const ${typeName}FixedValueFvPatch${FieldType}& ptf
)
:
fixedValueFvPatchScalarField(ptf)
fixedValueFvPatchField<${TemplateType}>(ptf)
{
if (${verbose:-false})
{
@ -151,14 +152,14 @@ ${typeName}FixedValueFvPatchScalarField
}
${typeName}FixedValueFvPatchScalarField::
${typeName}FixedValueFvPatchScalarField
${typeName}FixedValueFvPatch${FieldType}::
${typeName}FixedValueFvPatch${FieldType}
(
const ${typeName}FixedValueFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
const ${typeName}FixedValueFvPatch${FieldType}& ptf,
const DimensionedField<${TemplateType}, volMesh>& iF
)
:
fixedValueFvPatchScalarField(ptf, iF)
fixedValueFvPatchField<${TemplateType}>(ptf, iF)
{
if (${verbose:-false})
{
@ -170,8 +171,8 @@ ${typeName}FixedValueFvPatchScalarField
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
${typeName}FixedValueFvPatchScalarField::
~${typeName}FixedValueFvPatchScalarField()
${typeName}FixedValueFvPatch${FieldType}::
~${typeName}FixedValueFvPatch${FieldType}()
{
if (${verbose:-false})
{
@ -182,7 +183,7 @@ ${typeName}FixedValueFvPatchScalarField::
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void ${typeName}FixedValueFvPatchScalarField::updateCoeffs()
void ${typeName}FixedValueFvPatch${FieldType}::updateCoeffs()
{
if (this->updated())
{
@ -198,7 +199,7 @@ void ${typeName}FixedValueFvPatchScalarField::updateCoeffs()
${code}
//}}} end code
fixedValueFvPatchScalarField::updateCoeffs();
this->fixedValueFvPatchField<${TemplateType}>::updateCoeffs();
}

View File

@ -21,21 +21,19 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fixedValueFvPatchScalarFieldTemplate
Description
Template for use with onTheFlyFixedValue.
- fixedValueFvPatchScalarField
Template for use with dynamic code generation of a
fixedValue fvPatchField.
- without state
SourceFiles
fixedValueFvPatchScalarFieldTemplate.C
fixedValueFvPatchFieldTemplate.C
\*---------------------------------------------------------------------------*/
#ifndef fixedValueFvPatchScalarFieldTemplate_H
#define fixedValueFvPatchScalarFieldTemplate_H
#ifndef fixedValueFvPatchTemplate${FieldType}_H
#define fixedValueFvPatchTemplate${FieldType}_H
#include "fixedValueFvPatchFields.H"
@ -45,18 +43,17 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedValueFvPatchScalarField Declaration
A templated FixedValueFvPatch
\*---------------------------------------------------------------------------*/
class ${typeName}FixedValueFvPatchScalarField
class ${typeName}FixedValueFvPatch${FieldType}
:
public fixedValueFvPatchScalarField
public fixedValueFvPatchField<${TemplateType}>
{
public:
//- Information about the SHA1 of the code itself
static const char* SHA1sum;
static const char* const SHA1sum;
//- Runtime type information
TypeName("${typeName}");
@ -65,75 +62,72 @@ public:
// Constructors
//- Construct from patch and internal field
${typeName}FixedValueFvPatchScalarField
${typeName}FixedValueFvPatch${FieldType}
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
const DimensionedField<${TemplateType}, volMesh>&
);
//- Construct from patch, internal field and dictionary
${typeName}FixedValueFvPatchScalarField
${typeName}FixedValueFvPatch${FieldType}
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const DimensionedField<${TemplateType}, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// ${typeName}FixedValueFvPatchScalarField
// onto a new patch
${typeName}FixedValueFvPatchScalarField
//- Construct by mapping a copy onto a new patch
${typeName}FixedValueFvPatch${FieldType}
(
const ${typeName}FixedValueFvPatchScalarField&,
const ${typeName}FixedValueFvPatch${FieldType}&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const DimensionedField<${TemplateType}, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
${typeName}FixedValueFvPatchScalarField
${typeName}FixedValueFvPatch${FieldType}
(
const ${typeName}FixedValueFvPatchScalarField&
const ${typeName}FixedValueFvPatch${FieldType}&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
virtual tmp< fvPatch${FieldType} > clone() const
{
return tmp<fvPatchScalarField>
return tmp< fvPatch${FieldType} >
(
new ${typeName}FixedValueFvPatchScalarField(*this)
new ${typeName}FixedValueFvPatch${FieldType}(*this)
);
}
//- Construct as copy setting internal field reference
${typeName}FixedValueFvPatchScalarField
${typeName}FixedValueFvPatch${FieldType}
(
const ${typeName}FixedValueFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
const ${typeName}FixedValueFvPatch${FieldType}&,
const DimensionedField<${TemplateType}, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
virtual tmp< fvPatch${FieldType} > clone
(
const DimensionedField<scalar, volMesh>& iF
const DimensionedField<${TemplateType}, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
return tmp< fvPatch${FieldType} >
(
new ${typeName}FixedValueFvPatchScalarField(*this, iF)
new ${typeName}FixedValueFvPatch${FieldType}(*this, iF)
);
}
//- Destructor
virtual ~${typeName}FixedValueFvPatchScalarField();
virtual ~${typeName}FixedValueFvPatch${FieldType}();
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
};

116
etc/cshrc
View File

@ -102,17 +102,31 @@ setenv FOAM_SIGFPE
# - remove anything under top-level directory.
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
set foamOldDirs="$FOAM_INST_DIR $HOME/$WM_PROJECT/$LOGNAME"
if ( $?WM_PROJECT_INST_DIR ) then
if ( "$WM_PROJECT_INST_DIR" != "$FOAM_INST_DIR" ) then
set foamOldDirs="$WM_PROJECT_INST_DIR $foamOldDirs"
endif
endif
# Location of site/user files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Location of installation
# ~~~~~~~~~~~~~~~~~~~~~~~~
setenv WM_PROJECT_INST_DIR $FOAM_INST_DIR
setenv WM_PROJECT_DIR $WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION
# Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
# Location of site-specific templates etc
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# unset is equivalent to $WM_PROJECT_INST_DIR/site
unsetenv WM_PROJECT_SITE
# Location of user files
# ~~~~~~~~~~~~~~~~~~~~~~
setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION
# Source files, possibly with some verbosity
alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*'
@ -127,10 +141,12 @@ while ( $#argv > 0 )
switch ($argv[1])
case *=:
# name= -> unsetenv name
if ($?FOAM_VERBOSE && $?prompt) echo "unsetenv $argv[1]:s/=//"
eval "unsetenv $argv[1]:s/=//"
breaksw
case *=*:
# name=value -> setenv name value
if ($?FOAM_VERBOSE && $?prompt) echo "setenv $argv[1]:s/=/ /"
eval "setenv $argv[1]:s/=/ /"
breaksw
default:
@ -146,100 +162,6 @@ while ( $#argv > 0 )
end
# Detect system type and set environment variables
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv WM_ARCH `uname -s`
switch ($WM_ARCH)
case Linux:
setenv WM_ARCH linux
switch (`uname -m`)
case i686:
breaksw
case x86_64:
switch ($WM_ARCH_OPTION)
case 32:
setenv WM_COMPILER_ARCH '-64'
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m32 -fPIC'
setenv WM_CXXFLAGS '-m32 -fPIC'
setenv WM_LDFLAGS '-m32'
breaksw
case 64:
setenv WM_ARCH linux64
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m64 -fPIC'
setenv WM_CXXFLAGS '-m64 -fPIC'
setenv WM_LDFLAGS '-m64'
breaksw
default:
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"
breaksw
endsw
breaksw
case ia64:
setenv WM_ARCH linuxIA64
setenv WM_COMPILER I64
breaksw
case mips64:
setenv WM_ARCH SiCortex64
setenv WM_MPLIB MPI
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-mabi=64 -fPIC'
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
setenv WM_LDFLAGS '-mabi=64 -G0'
breaksw
case ppc64:
setenv WM_ARCH linuxPPC64
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m64 -fPIC'
setenv WM_CXXFLAGS '-m64 -fPIC'
setenv WM_LDFLAGS '-m64'
breaksw
default:
echo Unknown processor type `uname -m` for Linux
breaksw
endsw
breaksw
case SunOS:
setenv WM_ARCH SunOS64
setenv WM_MPLIB FJMPI
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-mabi=64 -fPIC'
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
setenv WM_LDFLAGS '-mabi=64 -G0'
breaksw
default:
echo
echo "Your '$WM_ARCH' operating system is not supported by this release"
echo "of OpenFOAM. For further assistance, please contact www.OpenFOAM.com"
echo
breaksw
endsw
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath

View File

@ -37,6 +37,100 @@ alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
# prefix to MANPATH
alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}'
#------------------------------------------------------------------------------
# Set environment variables according to system type
setenv WM_ARCH `uname -s`
switch ($WM_ARCH)
case Linux:
setenv WM_ARCH linux
switch (`uname -m`)
case i686:
breaksw
case x86_64:
switch ($WM_ARCH_OPTION)
case 32:
setenv WM_COMPILER_ARCH '-64'
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m32 -fPIC'
setenv WM_CXXFLAGS '-m32 -fPIC'
setenv WM_LDFLAGS '-m32'
breaksw
case 64:
setenv WM_ARCH linux64
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m64 -fPIC'
setenv WM_CXXFLAGS '-m64 -fPIC'
setenv WM_LDFLAGS '-m64'
breaksw
default:
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"
breaksw
endsw
breaksw
case ia64:
setenv WM_ARCH linuxIA64
setenv WM_COMPILER I64
breaksw
case mips64:
setenv WM_ARCH SiCortex64
setenv WM_MPLIB MPI
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-mabi=64 -fPIC'
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
setenv WM_LDFLAGS '-mabi=64 -G0'
breaksw
case ppc64:
setenv WM_ARCH linuxPPC64
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m64 -fPIC'
setenv WM_CXXFLAGS '-m64 -fPIC'
setenv WM_LDFLAGS '-m64'
breaksw
default:
echo Unknown processor type `uname -m` for Linux
breaksw
endsw
breaksw
case SunOS:
setenv WM_ARCH SunOS64
setenv WM_MPLIB FJMPI
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-mabi=64 -fPIC'
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
setenv WM_LDFLAGS '-mabi=64 -G0'
breaksw
default:
echo
echo "Your '$WM_ARCH' operating system is not supported by this release"
echo "of OpenFOAM. For further assistance, please contact www.OpenFOAM.com"
echo
breaksw
endsw
#------------------------------------------------------------------------------
# location of the jobControl directory
@ -56,8 +150,13 @@ setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib
# shared site executables/libraries
# similar naming convention as ~OpenFOAM expansion
setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
if ( $?WM_PROJECT_SITE ) then
setenv FOAM_SITE_APPBIN $WM_PROJECT_SITE/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
setenv FOAM_SITE_LIBBIN $WM_PROJECT_SITE/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
else
setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
endif
# user executables/libraries
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin

View File

@ -60,6 +60,98 @@ _foamAddMan()
done
}
#------------------------------------------------------------------------------
# Set environment variables according to system type
export WM_ARCH=`uname -s`
case "$WM_ARCH" in
Linux)
WM_ARCH=linux
# compiler specifics
case `uname -m` in
i686)
;;
x86_64)
case "$WM_ARCH_OPTION" in
32)
export WM_COMPILER_ARCH='-64'
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m32 -fPIC'
export WM_CXXFLAGS='-m32 -fPIC'
export WM_LDFLAGS='-m32'
;;
64)
WM_ARCH=linux64
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m64 -fPIC'
export WM_CXXFLAGS='-m64 -fPIC'
export WM_LDFLAGS='-m64'
;;
*)
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"
;;
esac
;;
ia64)
WM_ARCH=linuxIA64
export WM_COMPILER=I64
;;
mips64)
WM_ARCH=SiCortex64
WM_MPLIB=MPI
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'
;;
ppc64)
WM_ARCH=linuxPPC64
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m64 -fPIC'
export WM_CXXFLAGS='-m64 -fPIC'
export WM_LDFLAGS='-m64'
;;
*)
echo Unknown processor type `uname -m` for Linux
;;
esac
;;
SunOS)
WM_ARCH=SunOS64
WM_MPLIB=FJMPI
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'
;;
*) # an unsupported operating system
cat <<USAGE
Your "$WM_ARCH" operating system is not supported by this release
of OpenFOAM. For further assistance, please contact www.OpenFOAM.com
USAGE
;;
esac
#------------------------------------------------------------------------------
# location of the jobControl directory
@ -79,8 +171,14 @@ export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib
# shared site executables/libraries
# similar naming convention as ~OpenFOAM expansion
export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
if [ -n "$WM_PROJECT_SITE" ]
then
export FOAM_SITE_APPBIN=$WM_PROJECT_SITE/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
export FOAM_SITE_LIBBIN=$WM_PROJECT_SITE/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
else
export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
fi
# user executables/libraries
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin

View File

@ -253,19 +253,20 @@ bool Foam::chDir(const fileName& dir)
Foam::fileName Foam::findEtcFile(const fileName& name, bool mandatory)
{
// Search user files:
// ~~~~~~~~~~~~~~~~~~
//
// search for user files in
// * ~/.OpenFOAM/VERSION
// * ~/.OpenFOAM
//
fileName searchDir = home()/".OpenFOAM";
if (isDir(searchDir))
{
// Check for user file in ~/.OpenFOAM/VERSION
fileName fullName = searchDir/FOAMversion/name;
if (isFile(fullName))
{
return fullName;
}
// Check for version-independent user file in ~/.OpenFOAM
fullName = searchDir/name;
if (isFile(fullName))
{
@ -274,32 +275,61 @@ Foam::fileName Foam::findEtcFile(const fileName& name, bool mandatory)
}
// Search site files:
// ~~~~~~~~~~~~~~~~~~
searchDir = getEnv("WM_PROJECT_INST_DIR");
if (isDir(searchDir))
//
// search for group (site) files in
// * $WM_PROJECT_SITE/VERSION
// * $WM_PROJECT_SITE
//
searchDir = getEnv("WM_PROJECT_SITE");
if (searchDir.size())
{
// Check for site file in $WM_PROJECT_INST_DIR/site/VERSION
fileName fullName = searchDir/"site"/FOAMversion/name;
if (isFile(fullName))
if (isDir(searchDir))
{
return fullName;
}
fileName fullName = searchDir/FOAMversion/name;
if (isFile(fullName))
{
return fullName;
}
// Check for version-independent site file in $WM_PROJECT_INST_DIR/site
fullName = searchDir/"site"/name;
if (isFile(fullName))
fullName = searchDir/name;
if (isFile(fullName))
{
return fullName;
}
}
}
else
{
//
// OR search for group (site) files in
// * $WM_PROJECT_INST_DIR/site/VERSION
// * $WM_PROJECT_INST_DIR/site
//
searchDir = getEnv("WM_PROJECT_INST_DIR");
if (isDir(searchDir))
{
return fullName;
fileName fullName = searchDir/"site"/FOAMversion/name;
if (isFile(fullName))
{
return fullName;
}
fullName = searchDir/"site"/name;
if (isFile(fullName))
{
return fullName;
}
}
}
// Search installation files:
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// search for other (shipped) files in
// * $WM_PROJECT_DIR/etc
//
searchDir = getEnv("WM_PROJECT_DIR");
if (isDir(searchDir))
{
// Check for shipped OpenFOAM file in $WM_PROJECT_DIR/etc
fileName fullName = searchDir/"etc"/name;
if (isFile(fullName))
{
@ -311,7 +341,8 @@ Foam::fileName Foam::findEtcFile(const fileName& name, bool mandatory)
// abort if the file is mandatory, otherwise return null
if (mandatory)
{
std::cerr<< "--> FOAM FATAL ERROR in Foam::findEtcFile() :"
std::cerr
<< "--> FOAM FATAL ERROR in Foam::findEtcFile() :"
" could not find mandatory file\n '"
<< name.c_str() << "'\n\n" << std::endl;
::exit(1);

View File

@ -48,10 +48,10 @@ const Foam::word Foam::dynamicCode::codeTemplateEnvName
const Foam::fileName Foam::dynamicCode::codeTemplateDirName
= "codeTemplates/dynamicCode";
const char* Foam::dynamicCode::libTargetRoot =
const char* const Foam::dynamicCode::libTargetRoot =
"LIB = $(PWD)/../platforms/$(WM_OPTIONS)/lib/lib";
const char* Foam::dynamicCode::topDirName = "dynamicCode";
const char* const Foam::dynamicCode::topDirName = "dynamicCode";
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //

View File

@ -106,10 +106,10 @@ protected:
// Static data members
//- Root of the LIB target for Make/files
static const char* libTargetRoot;
static const char* const libTargetRoot;
//- Top-level directory name for copy/compiling
static const char* topDirName;
static const char* const topDirName;
// Protected Member Functions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,7 +32,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const char* Foam::constant::atomic::group = "atomic";
const char* const Foam::constant::atomic::group = "atomic";
const Foam::dimensionedScalar Foam::constant::atomic::alpha
@ -129,6 +129,3 @@ const Foam::dimensionedScalar Foam::constant::atomic::Eh
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,7 +46,7 @@ namespace atomic
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Group name for atomic constants
extern const char* group;
extern const char* const group;
//- Fine-structure constant: default SI units: []
extern const dimensionedScalar alpha;
@ -75,6 +75,3 @@ namespace atomic
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,7 +32,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const char* Foam::constant::electromagnetic::group = "electromagnetic";
const char* const Foam::constant::electromagnetic::group = "electromagnetic";
const Foam::dimensionedScalar Foam::constant::electromagnetic::mu0
@ -164,5 +164,3 @@ const Foam::dimensionedScalar Foam::constant::electromagnetic::RK
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,7 +46,7 @@ namespace electromagnetic
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Group name for electromagnetic constants
extern const char* group;
extern const char* const group;
//- Magnetic constant/permeability of free space: default SI units: [H/m]
extern const dimensionedScalar mu0;
@ -84,5 +84,3 @@ namespace electromagnetic
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,7 +45,7 @@ namespace mathematical
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
static word group = "mathematical";
static const char* const group = "mathematical";
const scalar e(M_E);
const scalar pi(M_PI);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,7 +32,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const char* Foam::constant::physicoChemical::group = "physicoChemical";
const char* const Foam::constant::physicoChemical::group = "physicoChemical";
const Foam::dimensionedScalar Foam::constant::physicoChemical::R

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,7 +46,7 @@ namespace physicoChemical
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Group name for physico-chemical constants
extern const char* group;
extern const char* const group;
//- Universal gas constant: default SI units: [J/mol/K]
extern const dimensionedScalar R;
@ -78,7 +78,3 @@ namespace physicoChemical
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,7 +30,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const char* Foam::constant::universal::group = "universal";
const char* const Foam::constant::universal::group = "universal";
const Foam::dimensionedScalar Foam::constant::universal::hr
@ -49,4 +49,3 @@ const Foam::dimensionedScalar Foam::constant::universal::hr
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,7 +46,7 @@ namespace universal
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Group name for universal constants
extern const char* group;
extern const char* const group;
//- Reduced Planck constant: default SI units: [J/s]
extern const dimensionedScalar hr;
@ -62,4 +62,3 @@ namespace universal
#endif
// ************************************************************************* //

View File

@ -93,22 +93,22 @@ fileName cwd();
// else return false
bool chDir(const fileName& dir);
//- Search for \em name
// in the following hierarchy:
// -# personal settings:
// - ~/.OpenFOAM/\<VERSION\>/
// <em>for version-specific files</em>
//- Search for a file from user/group/shipped directories.
// The search scheme allows for version-specific and
// version-independent files using the following hierarchy:
// - \b user settings:
// - ~/.OpenFOAM/\<VERSION\>
// - ~/.OpenFOAM/
// <em>for version-independent files</em>
// -# site-wide settings:
// - \b group (site) settings (when $WM_PROJECT_SITE is set):
// - $WM_PROJECT_SITE/\<VERSION\>
// - $WM_PROJECT_SITE
// - \b group (site) settings (when $WM_PROJECT_SITE is not set):
// - $WM_PROJECT_INST_DIR/site/\<VERSION\>
// <em>for version-specific files</em>
// - $WM_PROJECT_INST_DIR/site/
// <em>for version-independent files</em>
// -# shipped settings:
// - \b other (shipped) settings:
// - $WM_PROJECT_DIR/etc/
//
// \return the full path name or fileName() if the name cannot be found
// \return The full path name or fileName() if the name cannot be found
// Optionally abort if the file cannot be found
fileName findEtcFile(const fileName&, bool mandatory=false);

View File

@ -254,7 +254,10 @@ public:
}
//- Transform a patch-based position from other side to this side
virtual void transformPosition(pointField& l) const = 0;
virtual void transformPosition(pointField&) const = 0;
//- Transform a patch-based position from other side to this side
virtual void transformPosition(point&, const label facei) const = 0;
//- Are the planes separated.
virtual bool separated() const
@ -297,12 +300,12 @@ public:
virtual void calcGeometry
(
const primitivePatch& referPatch,
const UList<point>& thisCtrs,
const UList<point>& thisAreas,
const UList<point>& thisCc,
const UList<point>& nbrCtrs,
const UList<point>& nbrAreas,
const UList<point>& nbrCc
const pointField& thisCtrs,
const vectorField& thisAreas,
const pointField& thisCc,
const pointField& nbrCtrs,
const vectorField& nbrAreas,
const pointField& nbrCc
) = 0;
//- Initialize ordering for primitivePatch. Does not

View File

@ -77,7 +77,6 @@ void Foam::cyclicPolyPatch::calcTransforms()
if (size())
{
// Half0
const cyclicPolyPatch& half0 = *this;
vectorField half0Areas(half0.size());
forAll(half0, facei)
@ -108,10 +107,10 @@ void Foam::cyclicPolyPatch::calcTransforms()
void Foam::cyclicPolyPatch::calcTransforms
(
const primitivePatch& half0,
const UList<point>& half0Ctrs,
const UList<point>& half0Areas,
const UList<point>& half1Ctrs,
const UList<point>& half1Areas
const pointField& half0Ctrs,
const vectorField& half0Areas,
const pointField& half1Ctrs,
const vectorField& half1Areas
)
{
if (debug && owner())
@ -165,23 +164,9 @@ void Foam::cyclicPolyPatch::calcTransforms
if (half0Ctrs.size() > 0)
{
scalarField half0Tols
(
calcFaceTol
(
half0,
half0.points(),
static_cast<const pointField&>(half0Ctrs)
)
);
vectorField half0Normals(half0Areas.size());
vectorField half1Normals(half1Areas.size());
//- Additional warning about faces non-aligned with rotation axis
//scalar maxCos = -GREAT;
//label maxFacei = -1;
forAll(half0, facei)
{
scalar magSf = mag(half0Areas[facei]);
@ -221,75 +206,74 @@ void Foam::cyclicPolyPatch::calcTransforms
{
half0Normals[facei] = half0Areas[facei] / magSf;
half1Normals[facei] = half1Areas[facei] / nbrMagSf;
//if (transform_ == ROTATIONAL)
//{
// scalar cos = mag(half0Normals[facei] & rotationAxis_);
// if (cos > maxCos)
// {
// maxCos = cos;
// maxFacei = facei;
// }
//}
}
}
//if (maxCos > sqrt(SMALL))
//{
// WarningIn
// (
// "cyclicPolyPatch::calcTransforms()"
// ) << "on patch " << name()
// << " face:" << maxFacei << " fc:" << half0Ctrs[maxFacei]
// << " is not perpendicular to the rotationAxis." << endl
// << "This will cause problems with topology changes." << endl
// << "rotation axis : " << rotationAxis_ << endl
// << "face normal : " << half0Normals[maxFacei] << endl
// << "cosine of angle : " << maxCos << endl;
//}
// Calculate transformation tensors
calcTransformTensors
(
static_cast<const pointField&>(half0Ctrs),
static_cast<const pointField&>(half1Ctrs),
half0Normals,
half1Normals,
half0Tols,
matchTol,
transform_
);
if (transform_ == ROTATIONAL && !parallel() && forwardT().size() > 1)
if (transform_ == ROTATIONAL)
{
// Get index of maximum area face to minimise truncation errors.
label max0I = findMaxArea(half0.points(), half0);
// Calculate using the given rotation axis and centre. Do not
// use calculated normals.
label face0 = getConsistentRotationFace(half0Ctrs);
label face1 = face0;
const tensor fwdT = forwardT()[max0I];
const_cast<tensorField&>(forwardT()) = tensorField(1, fwdT);
const tensor revT = reverseT()[max0I];
const_cast<tensorField&>(reverseT()) = tensorField(1, revT);
const bool coll = collocated()[max0I];
const_cast<boolList&>(collocated()).setSize(1);
const_cast<boolList&>(collocated())[0] = coll;
vector n0 = ((half0Ctrs[face0] - rotationCentre_) ^ rotationAxis_);
vector n1 = ((half1Ctrs[face1] - rotationCentre_) ^ -rotationAxis_);
n0 /= mag(n0) + VSMALL;
n1 /= mag(n1) + VSMALL;
WarningIn
if (debug)
{
Pout<< "cyclicPolyPatch::calcTransforms :"
<< " Specified rotation :"
<< " n0:" << n0 << " n1:" << n1 << endl;
}
// Extended tensor from two local coordinate systems calculated
// using normal and rotation axis
const tensor E0
(
"cyclicPolyPatch::calcTransforms\n"
" (\n"
" const primitivePatch&,\n"
" const UList<point>&,\n"
" const UList<point>&,\n"
" const UList<point>&,\n"
" const UList<point>&\n"
" )"
) << "For patch " << name()
<< " calculated non-uniform transform tensor even though"
<< " the transform type is " << transformTypeNames[transform_]
<< "." << nl
<< " Setting the transformation tensor to be a uniform"
<< " rotation calculated from face " << max0I
<< endl;
rotationAxis_,
(n0 ^ rotationAxis_),
n0
);
const tensor E1
(
rotationAxis_,
(-n1 ^ rotationAxis_),
-n1
);
const tensor revT(E1.T() & E0);
const_cast<tensorField&>(forwardT()) = tensorField(1, revT.T());
const_cast<tensorField&>(reverseT()) = tensorField(1, revT);
const_cast<vectorField&>(separation()).setSize(0);
const_cast<boolList&>(collocated()) = boolList(1, false);
}
else
{
scalarField half0Tols
(
calcFaceTol
(
half0,
half0.points(),
static_cast<const pointField&>(half0Ctrs)
)
);
calcTransformTensors
(
static_cast<const pointField&>(half0Ctrs),
static_cast<const pointField&>(half1Ctrs),
half0Normals,
half1Normals,
half0Tols,
matchTol,
transform_
);
}
}
}
@ -333,14 +317,39 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
<< " n0:" << n0 << " n1:" << n1 << endl;
}
// Rotation (around origin)
const tensor reverseT(rotationTensor(n0, -n1));
// Extended tensor from two local coordinate systems calculated
// using normal and rotation axis
const tensor E0
(
rotationAxis_,
(n0 ^ rotationAxis_),
n0
);
const tensor E1
(
rotationAxis_,
(-n1 ^ rotationAxis_),
-n1
);
const tensor revT(E1.T() & E0);
// Rotation
forAll(half0Ctrs, faceI)
{
half0Ctrs[faceI] = Foam::transform(reverseT, half0Ctrs[faceI]);
anchors0[faceI] = Foam::transform(reverseT, anchors0[faceI]);
half0Ctrs[faceI] =
Foam::transform
(
revT,
half0Ctrs[faceI] - rotationCentre_
)
+ rotationCentre_;
anchors0[faceI] =
Foam::transform
(
revT,
anchors0[faceI] - rotationCentre_
)
+ rotationCentre_;
}
break;
@ -387,19 +396,19 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
}
// Rotation (around origin)
const tensor reverseT(rotationTensor(n0, -n1));
const tensor revT(rotationTensor(n0, -n1));
// Rotation
forAll(half0Ctrs, faceI)
{
half0Ctrs[faceI] = Foam::transform
(
reverseT,
revT,
half0Ctrs[faceI]
);
anchors0[faceI] = Foam::transform
(
reverseT,
revT,
anchors0[faceI]
);
}
@ -437,41 +446,20 @@ Foam::label Foam::cyclicPolyPatch::getConsistentRotationFace
const pointField& faceCentres
) const
{
const scalarField magRadSqr
(
magSqr((faceCentres - rotationCentre_) ^ rotationAxis_)
);
scalarField axisLen
(
(faceCentres - rotationCentre_) & rotationAxis_
);
axisLen -= min(axisLen);
const scalarField magLenSqr
(
magRadSqr + axisLen*axisLen
);
// Determine a face furthest away from the axis
label rotFace = -1;
scalar maxMagLenSqr = -GREAT;
scalar maxMagRadSqr = -GREAT;
forAll(faceCentres, i)
{
if (magLenSqr[i] >= maxMagLenSqr)
{
if (magRadSqr[i] > maxMagRadSqr)
{
rotFace = i;
maxMagLenSqr = magLenSqr[i];
maxMagRadSqr = magRadSqr[i];
}
}
}
const scalarField magRadSqr =
magSqr((faceCentres - rotationCentre_) ^ rotationAxis_);
label rotFace = findMax(magRadSqr);
if (debug)
{
Pout<< "getConsistentRotationFace(const pointField&)" << nl
<< " rotFace = " << rotFace << nl
<< " point = " << faceCentres[rotFace] << endl;
Info<< "getConsistentRotationFace(const pointField&)" << nl
<< " rotFace = " << rotFace << nl
<< " point = " << faceCentres[rotFace] << nl
<< " distance = " << Foam::sqrt(magRadSqr[rotFace])
<< endl;
}
return rotFace;
@ -586,6 +574,17 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
{
dict.lookup("rotationAxis") >> rotationAxis_;
dict.lookup("rotationCentre") >> rotationCentre_;
scalar magRot = mag(rotationAxis_);
if (magRot < SMALL)
{
FatalIOErrorIn("cyclicPolyPatch::cyclicPolyPatch(..)", dict)
<< "Illegal rotationAxis " << rotationAxis_ << endl
<< "Please supply a non-zero vector."
<< exit(FatalIOError);
}
rotationAxis_ /= magRot;
break;
}
case TRANSLATIONAL:
@ -730,7 +729,16 @@ void Foam::cyclicPolyPatch::transformPosition(pointField& l) const
{
if (!parallel())
{
l = Foam::transform(forwardT(), l);
if (transform_ == ROTATIONAL)
{
l =
Foam::transform(forwardT(), l-rotationCentre_)
+ rotationCentre_;
}
else
{
l = Foam::transform(forwardT(), l);
}
}
else if (separated())
{
@ -750,6 +758,40 @@ void Foam::cyclicPolyPatch::transformPosition(pointField& l) const
}
void Foam::cyclicPolyPatch::transformPosition(point& l, const label facei) const
{
if (!parallel())
{
const tensor& T =
(
forwardT().size() == 1
? forwardT()[0]
: forwardT()[facei]
);
if (transform_ == ROTATIONAL)
{
l = Foam::transform(T, l-rotationCentre_) + rotationCentre_;
}
else
{
l = Foam::transform(T, l);
}
}
else if (separated())
{
const vector& s =
(
separation().size() == 1
? separation()[0]
: separation()[facei]
);
l -= s;
}
}
void Foam::cyclicPolyPatch::initGeometry(PstreamBuffers& pBufs)
{
polyPatch::initGeometry(pBufs);
@ -759,9 +801,9 @@ void Foam::cyclicPolyPatch::initGeometry(PstreamBuffers& pBufs)
void Foam::cyclicPolyPatch::initGeometry
(
const primitivePatch& referPatch,
UList<point>& nbrCtrs,
UList<point>& nbrAreas,
UList<point>& nbrCc
pointField& nbrCtrs,
vectorField& nbrAreas,
pointField& nbrCc
)
{}
@ -769,12 +811,12 @@ void Foam::cyclicPolyPatch::initGeometry
void Foam::cyclicPolyPatch::calcGeometry
(
const primitivePatch& referPatch,
const UList<point>& thisCtrs,
const UList<point>& thisAreas,
const UList<point>& thisCc,
const UList<point>& nbrCtrs,
const UList<point>& nbrAreas,
const UList<point>& nbrCc
const pointField& thisCtrs,
const vectorField& thisAreas,
const pointField& thisCc,
const pointField& nbrCtrs,
const vectorField& nbrAreas,
const pointField& nbrCc
)
{
calcTransforms

View File

@ -110,10 +110,10 @@ class cyclicPolyPatch
void calcTransforms
(
const primitivePatch& half0,
const UList<point>& half0Ctrs,
const UList<point>& half0Areas,
const UList<point>& half1Ctrs,
const UList<point>& half1Areas
const pointField& half0Ctrs,
const vectorField& half0Areas,
const pointField& half1Ctrs,
const vectorField& half1Areas
);
// Face ordering
@ -149,9 +149,9 @@ protected:
virtual void initGeometry
(
const primitivePatch& referPatch,
UList<point>& nbrCtrs,
UList<point>& nbrAreas,
UList<point>& nbrCc
pointField& nbrCtrs,
vectorField& nbrAreas,
pointField& nbrCc
);
//- Calculate the patch geometry
@ -161,12 +161,12 @@ protected:
virtual void calcGeometry
(
const primitivePatch& referPatch,
const UList<point>& thisCtrs,
const UList<point>& thisAreas,
const UList<point>& thisCc,
const UList<point>& nbrCtrs,
const UList<point>& nbrAreas,
const UList<point>& nbrCc
const pointField& thisCtrs,
const vectorField& thisAreas,
const pointField& thisCc,
const pointField& nbrCtrs,
const vectorField& nbrAreas,
const pointField& nbrCc
);
//- Initialise the patches for moving points
@ -342,6 +342,9 @@ public:
//- Transform a patch-based position from other side to this side
virtual void transformPosition(pointField& l) const;
//- Transform a patch-based position from other side to this side
virtual void transformPosition(point&, const label facei) const;
// Transformation

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -711,12 +711,12 @@ void Foam::oldCyclicPolyPatch::initGeometry(PstreamBuffers& pBufs)
void Foam::oldCyclicPolyPatch::calcGeometry
(
const primitivePatch& referPatch,
const UList<point>& thisCtrs,
const UList<point>& thisAreas,
const UList<point>& thisCc,
const UList<point>& nbrCtrs,
const UList<point>& nbrAreas,
const UList<point>& nbrCc
const pointField& thisCtrs,
const vectorField& thisAreas,
const pointField& thisCc,
const pointField& nbrCtrs,
const vectorField& nbrAreas,
const pointField& nbrCc
)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -269,16 +269,22 @@ public:
notImplemented("transformPosition(pointField&)");
}
//- Transform a patch-based position from other side to this side
virtual void transformPosition(point&, const label facei) const
{
notImplemented("transformPosition(point&, const label)");
}
//- Calculate the patch geometry
virtual void calcGeometry
(
const primitivePatch& referPatch,
const UList<point>& thisCtrs,
const UList<point>& thisAreas,
const UList<point>& thisCc,
const UList<point>& nbrCtrs,
const UList<point>& nbrAreas,
const UList<point>& nbrCc
const pointField& thisCtrs,
const vectorField& thisAreas,
const pointField& thisCc,
const pointField& nbrCtrs,
const vectorField& nbrAreas,
const pointField& nbrCc
);
//- Initialize ordering for primitivePatch. Does not

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -93,12 +93,12 @@ protected:
virtual void calcGeometry
(
const primitivePatch& referPatch,
const UList<point>& thisCtrs,
const UList<point>& thisAreas,
const UList<point>& thisCc,
const UList<point>& nbrCtrs,
const UList<point>& nbrAreas,
const UList<point>& nbrCc
const pointField& thisCtrs,
const vectorField& thisAreas,
const pointField& thisCc,
const pointField& nbrCtrs,
const vectorField& nbrAreas,
const pointField& nbrCc
)
{
notImplemented("processorPolyPatch::calcGeometry(..)");
@ -300,6 +300,10 @@ public:
virtual void transformPosition(pointField& l) const
{}
//- Transform a patch-based position from other side to this side
virtual void transformPosition(point&, const label facei) const
{}
//- Initialize ordering for primitivePatch. Does not
// refer to *this (except for name() and type() etc.)
virtual void initOrder(PstreamBuffers&, const primitivePatch&) const;

View File

@ -81,12 +81,12 @@ protected:
virtual void calcGeometry
(
const primitivePatch& referPatch,
const UList<point>& thisCtrs,
const UList<point>& thisAreas,
const UList<point>& thisCc,
const UList<point>& nbrCtrs,
const UList<point>& nbrAreas,
const UList<point>& nbrCc
const pointField& thisCtrs,
const vectorField& thisAreas,
const pointField& thisCc,
const pointField& nbrCtrs,
const vectorField& nbrAreas,
const pointField& nbrCc
)
{
notImplemented("processorCyclicPolyPatch::calcGeometry(..)");
@ -279,6 +279,12 @@ public:
referPatch().transformPosition(l);
}
//- Transform a patch-based position from other side to this side
virtual void transformPosition(point& l, const label facei) const
{
referPatch().transformPosition(l, facei);
}
//- Are the planes separated.
virtual bool separated() const
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,10 +35,10 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const char* Foam::meshReaders::STARCD::defaultBoundaryName =
const char* const Foam::meshReaders::STARCD::defaultBoundaryName =
"Default_Boundary_Region";
const char* Foam::meshReaders::STARCD::defaultSolidBoundaryName =
const char* const Foam::meshReaders::STARCD::defaultSolidBoundaryName =
"Default_Boundary_Solid";
bool Foam::meshReaders::STARCD::keepSolids = false;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -68,8 +68,8 @@ protected:
// Protected Data
static const char* defaultBoundaryName;
static const char* defaultSolidBoundaryName;
static const char* const defaultBoundaryName;
static const char* const defaultSolidBoundaryName;
//- Face addressing from pro-STAR faces -> OpenFOAM faces
static const int starToFoamFaceAddr[4][6];

View File

@ -114,7 +114,8 @@ derivedFvPatchFields = $(fvPatchFields)/derived
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/advective/advectiveFvPatchFields.C
$(derivedFvPatchFields)/codedFixedValue/codedFixedValueFvPatchScalarField.C
/* $(derivedFvPatchFields)/codedFixedValue/codedFixedValueFvPatchScalarField.C */
$(derivedFvPatchFields)/codedFixedValue/codedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/directMappedField/directMappedFieldFvPatchFields.C
$(derivedFvPatchFields)/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C

View File

@ -0,0 +1,532 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
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 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "codedFixedValueFvPatchField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "surfaceFields.H"
#include "volFields.H"
#include "dlLibraryTable.H"
#include "IFstream.H"
#include "OFstream.H"
#include "SHA1Digest.H"
#include "dynamicCode.H"
#include "dynamicCodeContext.H"
#include "stringOps.H"
#include "IOdictionary.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class Type>
const Foam::word Foam::codedFixedValueFvPatchField<Type>::codeTemplateC
= "fixedValueFvPatchFieldTemplate.C";
template<class Type>
const Foam::word Foam::codedFixedValueFvPatchField<Type>::codeTemplateH
= "fixedValueFvPatchFieldTemplate.H";
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
template<class Type>
void* Foam::codedFixedValueFvPatchField<Type>::loadLibrary
(
const fileName& libPath,
const string& globalFuncName,
const dictionary& contextDict
)
{
void* lib = 0;
// avoid compilation by loading an existing library
if (!libPath.empty() && dlLibraryTable::open(libPath, false))
{
lib = dlLibraryTable::findLibrary(libPath);
// verify the loaded version and unload if needed
if (lib)
{
// provision for manual execution of code after loading
if (dlSymFound(lib, globalFuncName))
{
loaderFunctionType function =
reinterpret_cast<loaderFunctionType>
(
dlSym(lib, globalFuncName)
);
if (function)
{
(*function)(true); // force load
}
else
{
FatalIOErrorIn
(
"codedFixedValueFvPatchField<Type>::updateLibrary()",
contextDict
) << "Failed looking up symbol " << globalFuncName << nl
<< "from " << libPath << exit(FatalIOError);
}
}
else
{
FatalIOErrorIn
(
"codedFixedValueFvPatchField<Type>::loadLibrary()",
contextDict
) << "Failed looking up symbol " << globalFuncName << nl
<< "from " << libPath << exit(FatalIOError);
lib = 0;
if (!dlLibraryTable::close(libPath, false))
{
FatalIOErrorIn
(
"codedFixedValueFvPatchField<Type>::loadLibrary()",
contextDict
) << "Failed unloading library "
<< libPath
<< exit(FatalIOError);
}
}
}
}
return lib;
}
template<class Type>
void Foam::codedFixedValueFvPatchField<Type>::unloadLibrary
(
const fileName& libPath,
const string& globalFuncName,
const dictionary& contextDict
)
{
void* lib = 0;
if (!libPath.empty())
{
lib = dlLibraryTable::findLibrary(libPath);
}
if (!lib)
{
return;
}
// provision for manual execution of code before unloading
if (dlSymFound(lib, globalFuncName))
{
loaderFunctionType function =
reinterpret_cast<loaderFunctionType>
(
dlSym(lib, globalFuncName)
);
if (function)
{
(*function)(false); // force unload
}
else
{
FatalIOErrorIn
(
"codedFixedValueFvPatchField<Type>::unloadLibrary()",
contextDict
) << "Failed looking up symbol " << globalFuncName << nl
<< "from " << libPath << exit(FatalIOError);
}
}
if (!dlLibraryTable::close(libPath, false))
{
FatalIOErrorIn
(
"codedFixedValueFvPatchField<Type>::"
"updateLibrary()",
contextDict
) << "Failed unloading library " << libPath
<< exit(FatalIOError);
}
}
template<class Type>
void Foam::codedFixedValueFvPatchField<Type>::setFieldTemplates
(
dynamicCode& dynCode
)
{
word fieldType(pTraits<Type>::typeName);
// template type for fvPatchField
dynCode.setFilterVariable("TemplateType", fieldType);
// Name for fvPatchField - eg, ScalarField, VectorField, ...
fieldType[0] = toupper(fieldType[0]);
dynCode.setFilterVariable("FieldType", fieldType + "Field");
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
const Foam::IOdictionary& Foam::codedFixedValueFvPatchField<Type>::dict() const
{
const objectRegistry& obr = this->db();
if (obr.foundObject<IOdictionary>("codeDict"))
{
return obr.lookupObject<IOdictionary>("codeDict");
}
else
{
return obr.store
(
new IOdictionary
(
IOobject
(
"codeDict",
this->db().time().system(),
this->db(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
)
);
}
}
template<class Type>
void Foam::codedFixedValueFvPatchField<Type>::createLibrary
(
dynamicCode& dynCode,
const dynamicCodeContext& context
) const
{
bool create = Pstream::master();
if (create)
{
// Write files for new library
if (!dynCode.upToDate(context))
{
// filter with this context
dynCode.reset(context);
// take no chances - typeName must be identical to redirectType_
dynCode.setFilterVariable("typeName", redirectType_);
// set TemplateType and FieldType filter variables
// (for fvPatchField)
setFieldTemplates(dynCode);
// compile filtered C template
dynCode.addCompileFile(codeTemplateC);
// copy filtered H template
dynCode.addCopyFile(codeTemplateH);
// debugging: make BC verbose
// dynCode.setFilterVariable("verbose", "true");
// Info<<"compile " << redirectType_ << " sha1: "
// << context.sha1() << endl;
// define Make/options
dynCode.setMakeOptions
(
"EXE_INC = -g \\\n"
"-I$(LIB_SRC)/finiteVolume/lnInclude\\\n"
+ context.options()
+ "\n\nLIB_LIBS = "
);
if (!dynCode.copyOrCreateFiles(true))
{
FatalIOErrorIn
(
"codedFixedValueFvPatchField<Type>::createLibrary(..)",
context.dict()
) << "Failed writing files for" << nl
<< dynCode.libRelPath() << nl
<< exit(FatalIOError);
}
}
if (!dynCode.wmakeLibso())
{
FatalIOErrorIn
(
"codedFixedValueFvPatchField<Type>::createLibrary(..)",
context.dict()
) << "Failed wmake " << dynCode.libRelPath() << nl
<< exit(FatalIOError);
}
}
// all processes must wait for compile to finish
reduce(create, orOp<bool>());
}
template<class Type>
void Foam::codedFixedValueFvPatchField<Type>::updateLibrary() const
{
dynamicCode::checkSecurity
(
"codedFixedValueFvPatchField<Type>::updateLibrary()",
dict_
);
// use system/codeDict or in-line
const dictionary& codeDict =
(
dict_.found("code")
? dict_
: this->dict().subDict(redirectType_)
);
dynamicCodeContext context(codeDict);
// codeName: redirectType + _<sha1>
// codeDir : redirectType
dynamicCode dynCode
(
redirectType_ + context.sha1().str(true),
redirectType_
);
const fileName libPath = dynCode.libPath();
// the correct library was already loaded => we are done
if (dlLibraryTable::findLibrary(libPath))
{
return;
}
// remove instantiation of fvPatchField provided by library
redirectPatchFieldPtr_.clear();
// may need to unload old library
unloadLibrary
(
oldLibPath_,
dynamicCode::libraryBaseName(oldLibPath_),
context.dict()
);
// try loading an existing library (avoid compilation when possible)
if (!loadLibrary(libPath, dynCode.codeName(), context.dict()))
{
createLibrary(dynCode, context);
loadLibrary(libPath, dynCode.codeName(), context.dict());
}
// retain for future reference
oldLibPath_ = libPath;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
fixedValueFvPatchField<Type>(p, iF),
oldLibPath_(),
redirectPatchFieldPtr_()
{}
template<class Type>
Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
(
const codedFixedValueFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
dict_(ptf.dict_),
redirectType_(ptf.redirectType_),
oldLibPath_(ptf.oldLibPath_),
redirectPatchFieldPtr_()
{}
template<class Type>
Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchField<Type>(p, iF, dict),
dict_(dict),
redirectType_(dict.lookup("redirectType")),
oldLibPath_(),
redirectPatchFieldPtr_()
{
updateLibrary();
}
template<class Type>
Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
(
const codedFixedValueFvPatchField<Type>& ptf
)
:
fixedValueFvPatchField<Type>(ptf),
dict_(ptf.dict_),
redirectType_(ptf.redirectType_),
oldLibPath_(ptf.oldLibPath_),
redirectPatchFieldPtr_()
{}
template<class Type>
Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
(
const codedFixedValueFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
fixedValueFvPatchField<Type>(ptf, iF),
dict_(ptf.dict_),
redirectType_(ptf.redirectType_),
oldLibPath_(ptf.oldLibPath_),
redirectPatchFieldPtr_()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
const Foam::fvPatchField<Type>&
Foam::codedFixedValueFvPatchField<Type>::redirectPatchField() const
{
if (!redirectPatchFieldPtr_.valid())
{
// Construct a patch
// Make sure to construct the patchfield with up-to-date value
OStringStream os;
os.writeKeyword("type") << redirectType_ << token::END_STATEMENT
<< nl;
static_cast<const Field<Type>&>(*this).writeEntry("value", os);
IStringStream is(os.str());
dictionary dict(is);
redirectPatchFieldPtr_.set
(
fvPatchField<Type>::New
(
this->patch(),
this->dimensionedInternalField(),
dict
).ptr()
);
}
return redirectPatchFieldPtr_();
}
template<class Type>
void Foam::codedFixedValueFvPatchField<Type>::updateCoeffs()
{
if (this->updated())
{
return;
}
// Make sure library containing user-defined fvPatchField is up-to-date
updateLibrary();
const fvPatchField<Type>& fvp = redirectPatchField();
const_cast<fvPatchField<Type>&>(fvp).updateCoeffs();
// Copy through value
this->operator==(fvp);
fixedValueFvPatchField<Type>::updateCoeffs();
}
template<class Type>
void Foam::codedFixedValueFvPatchField<Type>::evaluate
(
const Pstream::commsTypes commsType
)
{
// Make sure library containing user-defined fvPatchField is up-to-date
updateLibrary();
const fvPatchField<Type>& fvp = redirectPatchField();
const_cast<fvPatchField<Type>&>(fvp).evaluate(commsType);
fixedValueFvPatchField<Type>::evaluate(commsType);
}
template<class Type>
void Foam::codedFixedValueFvPatchField<Type>::write(Ostream& os) const
{
fixedValueFvPatchField<Type>::write(os);
os.writeKeyword("redirectType") << redirectType_
<< token::END_STATEMENT << nl;
if (dict_.found("code"))
{
os.writeKeyword("code")
<< token::HASH << token::BEGIN_BLOCK;
os.writeQuoted(string(dict_["code"]), false)
<< token::HASH << token::END_BLOCK
<< token::END_STATEMENT << nl;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -0,0 +1,260 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
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 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::codedFixedValueFvPatchField
Description
Constructs on-the-fly a new boundary condition (derived from
fixedValueFvPatchField) which is then used to evaluate.
Example:
\verbatim
movingWall
{
type codedFixedValue;
value uniform 0;
redirectType rampedFixedValue; // name of generated bc
code
#{
operator==(min(10, 0.1*this->db().time().value()));
#};
//codeInclude
//#{
// #include "fvCFD.H"
//#};
//codeOptions
//#{
// -I$(LIB_SRC)/finiteVolume/lnInclude
//#};
}
\endverbatim
A special form is if the 'code' section is not supplied. In this case
the code gets read from a (runTimeModifiable!) dictionary system/codeDict
which would have a corresponding entry
\verbatim
rampedFixedValue
{
code
#{
operator==(min(10, 0.1*this->db().time().value()));
#};
}
\endverbatim
SeeAlso
Foam::dynamicCode and Foam::functionEntries::codeStream
SourceFiles
codedFixedValueFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef codedFixedValueFvPatchField_H
#define codedFixedValueFvPatchField_H
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class dynamicCode;
class dynamicCodeContext;
class IOdictionary;
/*---------------------------------------------------------------------------*\
Class codedFixedValueFvPatch Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class codedFixedValueFvPatchField
:
public fixedValueFvPatchField<Type>
{
// Private data
//- Dictionary contents for the boundary condition
mutable dictionary dict_;
const word redirectType_;
//- Previously loaded library
mutable fileName oldLibPath_;
mutable autoPtr<fvPatchField<Type> > redirectPatchFieldPtr_;
// Private Member Functions
const IOdictionary& dict() const;
//- Global loader/unloader function type
typedef void (*loaderFunctionType)(bool);
//- Load specified library and execute globalFuncName(true)
static void* loadLibrary
(
const fileName& libPath,
const string& globalFuncName,
const dictionary& contextDict
);
//- Execute globalFuncName(false) and unload specified library
static void unloadLibrary
(
const fileName& libPath,
const string& globalFuncName,
const dictionary& contextDict
);
//- Set the rewrite vars controlling the Type
static void setFieldTemplates(dynamicCode& dynCode);
//- Create library based on the dynamicCodeContext
void createLibrary(dynamicCode&, const dynamicCodeContext&) const;
//- Update library as required
void updateLibrary() const;
public:
// Static data members
//- Name of the C code template to be used
static const word codeTemplateC;
//- Name of the H code template to be used
static const word codeTemplateH;
//- Runtime type information
TypeName("codedFixedValue");
// Constructors
//- Construct from patch and internal field
codedFixedValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
codedFixedValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given codedFixedValueFvPatchField
// onto a new patch
codedFixedValueFvPatchField
(
const codedFixedValueFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
codedFixedValueFvPatchField
(
const codedFixedValueFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new codedFixedValueFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
codedFixedValueFvPatchField
(
const codedFixedValueFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new codedFixedValueFvPatchField<Type>(*this, iF)
);
}
// Member functions
//- Get reference to the underlying patch
const fvPatchField<Type>& redirectPatchField() const;
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Evaluate the patch field, sets Updated to false
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::blocking
);
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "codedFixedValueFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
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 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "codedFixedValueFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(codedFixedValue);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
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 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef codedFixedValueFvPatchFields_H
#define codedFixedValueFvPatchFields_H
#include "codedFixedValueFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(codedFixedValue);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
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 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef codedFixedValueFvPatchFieldsFwd_H
#define codedFixedValueFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class codedFixedValueFvPatchField;
makePatchTypeFieldTypedefs(codedFixedValue);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -36,14 +36,16 @@ License
#include "dynamicCode.H"
#include "dynamicCodeContext.H"
#include "stringOps.H"
#include <cstring>
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateC
= "fixedValueFvPatchScalarFieldTemplate.C";
= "fixedValueFvPatchFieldTemplate.C";
const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateH
= "fixedValueFvPatchScalarFieldTemplate.H";
= "fixedValueFvPatchFieldTemplate.H";
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
@ -172,6 +174,24 @@ void Foam::codedFixedValueFvPatchScalarField::unloadLibrary
}
template<class Type>
void Foam::codedFixedValueFvPatchScalarField::setFieldTemplates
(
dynamicCode& dynCode
)
{
word fieldType(pTraits<Type>::typeName);
// template type for fvPatchField
dynCode.setFilterVariable("TemplateType", fieldType);
// Name for fvPatchField - eg, ScalarField, VectorField, ...
fieldType[0] = toupper(fieldType[0]);
dynCode.setFilterVariable("FieldType", fieldType + "Field");
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
const Foam::IOdictionary& Foam::codedFixedValueFvPatchScalarField::dict() const
@ -216,19 +236,24 @@ void Foam::codedFixedValueFvPatchScalarField::createLibrary
// filter with this context
dynCode.reset(context);
// take no chances - typeName must be identical to redirectType_
dynCode.setFilterVariable("typeName", redirectType_);
// set TemplateType and FieldType filter variables
// (for fvPatchField)
setFieldTemplates<scalar>(dynCode);
// compile filtered C template
dynCode.addCompileFile(codeTemplateC);
// copy filtered H template
dynCode.addCopyFile(codeTemplateH);
// take no chances - typeName must be identical to redirectType_
dynCode.setFilterVariable("typeName", redirectType_);
// debugging: make BC verbose
// dynCode.setFilterVariable("verbose", "true");
// Info<<"compile " << redirectType_ << " sha1: "
// << context.sha1() << endl;
// dynCode.setFilterVariable("verbose", "true");
// Info<<"compile " << redirectType_ << " sha1: "
// << context.sha1() << endl;
// define Make/options
dynCode.setMakeOptions

View File

@ -136,6 +136,11 @@ class codedFixedValueFvPatchScalarField
);
//- Set TemplateType and FieldType filter variables
template<class Type>
static void setFieldTemplates(dynamicCode&);
//- Create library based on the dynamicCodeContext
void createLibrary(dynamicCode&, const dynamicCodeContext&) const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -116,12 +116,6 @@ Foam::particle::particle(const particle& p, const polyMesh& mesh)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::particle::transformPosition(const tensor& T)
{
position_ = transform(T, position_);
}
void Foam::particle::transformProperties(const tensor&)
{}

View File

@ -491,10 +491,6 @@ public:
// Transformations
//- Transform the position the particle
// according to the given transformation tensor
virtual void transformPosition(const tensor& T);
//- Transform the physical properties of the particle
// according to the given transformation tensor
virtual void transformProperties(const tensor& T);

View File

@ -52,11 +52,15 @@ void Foam::particle::correctAfterParallelTransfer
TrackData& td
)
{
const processorPolyPatch& ppp =
refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
const coupledPolyPatch& ppp =
refCast<const coupledPolyPatch>(mesh_.boundaryMesh()[patchI]);
cellI_ = ppp.faceCells()[faceI_];
// Have patch transform the position
ppp.transformPosition(position_, faceI_);
// Transform the properties
if (!ppp.parallel())
{
const tensor& T =
@ -65,8 +69,6 @@ void Foam::particle::correctAfterParallelTransfer
? ppp.forwardT()[0]
: ppp.forwardT()[faceI_]
);
transformPosition(T);
transformProperties(T);
}
else if (ppp.separated())
@ -77,7 +79,6 @@ void Foam::particle::correctAfterParallelTransfer
? ppp.separation()[0]
: ppp.separation()[faceI_]
);
position_ -= s;
transformProperties(-s);
}
@ -958,19 +959,22 @@ void Foam::particle::hitCyclicPatch
tetPtI_ = mesh_.faces()[tetFaceI_].size() - 1 - tetPtI_;
const cyclicPolyPatch& receiveCpp = cpp.neighbPatch();
label patchFacei = receiveCpp.whichFace(faceI_);
// Now the particle is on the receiving side
// Have patch transform the position
receiveCpp.transformPosition(position_, patchFacei);
// Transform the properties
if (!receiveCpp.parallel())
{
const tensor& T =
(
receiveCpp.forwardT().size() == 1
? receiveCpp.forwardT()[0]
: receiveCpp.forwardT()[receiveCpp.whichFace(faceI_)]
: receiveCpp.forwardT()[patchFacei]
);
transformPosition(T);
transformProperties(T);
}
else if (receiveCpp.separated())
@ -979,9 +983,8 @@ void Foam::particle::hitCyclicPatch
(
(receiveCpp.separation().size() == 1)
? receiveCpp.separation()[0]
: receiveCpp.separation()[receiveCpp.whichFace(faceI_)]
: receiveCpp.separation()[patchFacei]
);
position_ -= s;
transformProperties(-s);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -111,12 +111,14 @@ void Foam::regionModels::singleLayerRegion::initialise()
if (nBoundaryFaces != regionMesh().nCells())
{
/*
FatalErrorIn("singleLayerRegion::initialise()")
<< "Number of primary region coupled boundary faces not equal to "
<< "the number of cells in the local region" << nl << nl
<< "Number of cells = " << regionMesh().nCells() << nl
<< "Boundary faces = " << nBoundaryFaces << nl
<< abort(FatalError);
*/
}
scalarField passiveMagSf(magSf.size(), 0.0);
@ -176,11 +178,12 @@ Foam::regionModels::singleLayerRegion::singleLayerRegion
bool readFields
)
:
regionModel(mesh, regionType, modelName, false),
regionModel(mesh, regionType, modelName, readFields),
nHatPtr_(NULL),
magSfPtr_(NULL),
passivePatchIDs_()
{
Info << "singleLayerRegion" << endl;
if (active_)
{
constructMeshObjects();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -208,14 +208,7 @@ Foam::tmp<Foam::scalarField> Foam::constSolidThermo::K
const label patchI
) const
{
return tmp<scalarField>
(
new scalarField
(
T_.boundaryField()[patchI].size(),
constK_.value()
)
);
return (K_.boundaryField()[patchI]);
}

View File

@ -5,7 +5,6 @@
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
@ -14,7 +13,6 @@ FoamFile
location "constant";
object LESProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
LESModel oneEqEddy;

View File

@ -134,63 +134,6 @@ greyMeanAbsorptionEmissionCoeffs
0
);
}
N2
{
Tcommon 300;
invTemp false;
Tlow 200;
Thigh 2500;
loTcoeffs
(
0.01
0
0
0
0
0
);
hiTcoeffs
(
0.01
0
0
0
0
0
);
}
O2
{
Tcommon 300;
invTemp false;
Tlow 200;
Thigh 2500;
loTcoeffs
(
0.01
0
0
0
0
0
);
hiTcoeffs
(
0.01
0
0
0
0
0
);
}
}
scatterModel constantScatter;

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

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

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

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

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -135,63 +135,6 @@ greyMeanAbsorptionEmissionCoeffs
0
);
}
N2
{
Tcommon 300;
invTemp false;
Tlow 200;
Thigh 2500;
loTcoeffs
(
0.01
0
0
0
0
0
);
hiTcoeffs
(
0.01
0
0
0
0
0
);
}
O2
{
Tcommon 300;
invTemp false;
Tlow 200;
Thigh 2500;
loTcoeffs
(
0.01
0
0
0
0
0
);
hiTcoeffs
(
0.01
0
0
0
0
0
);
}
}
scatterModel constantScatter;

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -13,7 +13,6 @@ FoamFile
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers

View File

@ -1,47 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (25.75 3.62 0);
boundaryField
{
inlet
{
type freestream;
freestreamValue uniform (25.75 3.62 0);
}
outlet
{
type freestream;
freestreamValue uniform (25.75 3.62 0);
}
wall
{
type fixedValue;
value uniform (0 0 0);
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,47 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0.14;
boundaryField
{
inlet
{
type freestream;
freestreamValue uniform 0.14;
}
outlet
{
type freestream;
freestreamValue uniform 0.14;
}
wall
{
type fixedValue;
value uniform 0;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,47 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0.14;
boundaryField
{
inlet
{
type freestream;
freestreamValue uniform 0.14;
}
outlet
{
type freestream;
freestreamValue uniform 0.14;
}
wall
{
type nutUSpaldingWallFunction;
value uniform 0;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,44 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type freestreamPressure;
}
outlet
{
type freestreamPressure;
}
wall
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,9 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Clean time folders only
rm -rf *[1-9]*
rm -f log.* 2>/dev/null
# ----------------------------------------------------------------- end-of-file

View File

@ -1,11 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
application=`getApplication`
runApplication $application
# ----------------------------------------------------------------- end-of-file

View File

@ -1,25 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel SpalartAllmaras;
turbulence on;
printCoeffs on;
// ************************************************************************* //

View File

@ -1,51 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
4
(
inlet
{
type patch;
physicalType inlet;
nFaces 134;
startFace 21254;
}
outlet
{
type patch;
physicalType outlet;
nFaces 160;
startFace 21388;
}
wall
{
type wall;
physicalType wall;
nFaces 78;
startFace 21548;
}
frontAndBack
{
type empty;
physicalType empty;
nFaces 21440;
startFace 21626;
}
)
// ************************************************************************* //

View File

@ -1,41 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
rho rho [ 1 -3 0 0 0 0 0 ] 1;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-05;
CrossPowerLawCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
m m [ 0 0 1 0 0 0 0 ] 1;
n n [ 0 0 0 0 0 0 0 ] 1;
}
BirdCarreauCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [ 0 0 1 0 0 0 0 ] 0;
n n [ 0 0 0 0 0 0 0 ] 1;
}
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application simpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 500;
deltaT 1;
writeControl timeStep;
writeInterval 50;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //

View File

@ -1,65 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss linearUpwind Gauss linear;
div(phi,nuTilda) Gauss linearUpwind Gauss linear;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
laplacian(1,p) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
interpolate(U) linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //

View File

@ -1,69 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver GAMG;
tolerance 1e-06;
relTol 0.1;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
U
{
solver smoothSolver;
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-08;
relTol 0.1;
}
nuTilda
{
solver smoothSolver;
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-08;
relTol 0.1;
}
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
relaxationFactors
{
default 0;
p 0.3;
U 0.7;
nuTilda 0.7;
}
// ************************************************************************* //

View File

@ -1,51 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 1 -1 0 0 0 0];
internalField uniform $flowVelocity;
boundaryField
{
#include "include/fixedInlet"
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value $internalField;
}
lowerWall
{
type fixedValue;
value uniform (20 0 0);
}
"motorBike_.*"
{
type fixedValue;
value uniform (0 0 0);
}
#include "include/frontBackUpperPatches"
}
// ************************************************************************* //

View File

@ -1,19 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
upperWall
{
type slip;
}
frontAndBack
{
type slip;
}
// ************************************************************************* //

View File

@ -1,15 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
flowVelocity (20 0 0);
pressure 0;
turbulentKE 0.24;
turbulentOmega 1.78;
#inputMode merge
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 2 -2 0 0 0 0];
internalField uniform $turbulentKE;
boundaryField
{
#include "include/fixedInlet"
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
lowerWall
{
type kqRWallFunction;
}
"motorBike_.*"
{
type kqRWallFunction;
}
#include "include/frontBackUpperPatches"
}
// ************************************************************************* //

View File

@ -1,62 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
frontAndBack
{
type calculated;
value uniform 0;
}
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
lowerWall
{
type nutkWallFunction;
value uniform 0;
}
upperWall
{
type calculated;
value uniform 0;
}
"motorBike_.*"
{
type nutkWallFunction;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 0 -1 0 0 0 0];
internalField uniform $turbulentOmega;
boundaryField
{
#include "include/fixedInlet"
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
lowerWall
{
type omegaWallFunction;
}
"motorBike_.*"
{
type omegaWallFunction;
}
#include "include/frontBackUpperPatches"
}
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 2 -2 0 0 0 0];
internalField uniform $pressure;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value $internalField;
}
lowerWall
{
type zeroGradient;
}
"motorBike_.*"
{
type zeroGradient;
}
#include "include/frontBackUpperPatches"
}
// ************************************************************************* //

View File

@ -1,9 +0,0 @@
#!/bin/sh
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -f system/fvSolution
rm -rf 0 > /dev/null 2>&1
cleanCase

Some files were not shown because too many files have changed in this diff Show More