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 where the faces should come from
// - specify the type of cyclic. If a rotational specify the rotationAxis // - specify the type of cyclic. If a rotational specify the rotationAxis
// and centre to make matching easier // 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: // 2. Correct incorrect cyclic:
// This will usually fail upon loading: // This will usually fail upon loading:
@ -45,24 +47,23 @@ matchTolerance 1E-3;
// Do a synchronisation of coupled points after creation of any patches. // Do a synchronisation of coupled points after creation of any patches.
// Note: this does not work with points that are on multiple coupled patches // Note: this does not work with points that are on multiple coupled patches
// with transformations. // with transformations.
pointSync true; pointSync false;
// Patches to create. // Patches to create.
patches patches
( (
{ {
// Name of new patch // Name of new patch
name sidePatches; name cyc_half0;
// Type of new patch // Dictionary to construct new patch from
patchInfo patchInfo
{ {
type cyclic; type cyclic;
neighbourPatch cyc_half1;
// Optional: explicitly set transformation tensor. // Optional: explicitly set transformation tensor.
// Used when matching and synchronising points. // Used when matching and synchronising points.
//transform translational;
//separationVector (-2289 0 0);
transform rotational; transform rotational;
rotationAxis (1 0 0); rotationAxis (1 0 0);
rotationCentre (0 0 0); rotationCentre (0 0 0);
@ -72,28 +73,37 @@ patches
constructFrom patches; constructFrom patches;
// If constructFrom = patches : names of patches. Wildcards allowed. // If constructFrom = patches : names of patches. Wildcards allowed.
patches ("periodic.*"); patches (periodic1);
// If constructFrom = set : name of faceSet // If constructFrom = set : name of faceSet
set f0; set f0;
} }
{ {
name bottom; // Name of new patch
name cyc_half1;
// Type of new patch // Dictionary to construct new patch from
dictionary 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 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -63,7 +63,15 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
volVectorField U(Uheader, mesh); volVectorField U(Uheader, mesh);
if (isFile(runTime.constantPath()/"thermophysicalProperties")) if
(
IOobject
(
"thermophysicalProperties",
runTime.constant(),
mesh
).headerOk()
)
{ {
// thermophysical Mach // thermophysical Mach
autoPtr<basicPsiThermo> thermo autoPtr<basicPsiThermo> thermo

View File

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

View File

@ -33,6 +33,8 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
Script=${0##*/} Script=${0##*/}
toolsDir=${0%/*}/tools toolsDir=${0%/*}/tools
siteDir=${WM_PROJECT_SITE:-${WM_PROJECT_INST_DIR:-<unknown>}/site}
userDir=$HOME/.OpenFOAM
usage() { usage() {
exec 1>&2 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: The database ($Script.db) will taken from these locations:
. .
$HOME/.OpenFOAM/$WM_PROJECT_VERSION $userDir/$WM_PROJECT_VERSION
$HOME/.OpenFOAM $userDir
$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION $siteDir/$WM_PROJECT_VERSION
$WM_PROJECT_INST_DIR/site $siteDir
$WM_PROJECT_DIR/etc $WM_PROJECT_DIR/etc
$toolsDir $toolsDir

View File

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

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

@ -37,6 +37,7 @@ usage() {
usage: ${0##*/} usage: ${0##*/}
--foamInstall dir specify installation directory (e.g. /opt) --foamInstall dir specify installation directory (e.g. /opt)
--projectName name specify project name (e.g. openfoam170) --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) --archOption arch specify architecture option (only 32 or 64 applicable)
--paraviewInstall dir specify ParaView_DIR (e.g. /opt/paraviewopenfoam380) --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" [ -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 # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
@ -102,7 +103,17 @@ do
_inlineSed \ _inlineSed \
etc/bashrc \ etc/bashrc \
'/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" \ '/^[^#]/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 shift 2
;; ;;
-archOption | --archOption) -archOption | --archOption)
@ -142,10 +153,10 @@ _inlineSed \
'/^[^#]/s@export WM_MPLIB=.*@export WM_MPLIB=SYSTEMOPENMPI@' \ '/^[^#]/s@export WM_MPLIB=.*@export WM_MPLIB=SYSTEMOPENMPI@' \
"Replacing WM_MPLIB setting by 'SYSTEMOPENMPI'" "Replacing WM_MPLIB setting by 'SYSTEMOPENMPI'"
# set foamCompiler=system always ## set foamCompiler=system always
_inlineSed \ #_inlineSed \
etc/bashrc \ # etc/bashrc \
'/^[^#]/s@foamCompiler=.*@foamCompiler=system@' \ # '/^[^#]/s@foamCompiler=.*@foamCompiler=system@' \
"Replacing foamCompiler setting by 'system'" # "Replacing foamCompiler setting by 'system'"
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -67,6 +67,11 @@ alias foamSol 'cd $FOAM_SOLVERS'
alias foamTuts 'cd $FOAM_TUTORIALS' alias foamTuts 'cd $FOAM_TUTORIALS'
alias foamUtils 'cd $FOAM_UTILITIES' alias foamUtils 'cd $FOAM_UTILITIES'
alias foam3rdParty 'cd $WM_THIRD_PARTY_DIR' 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 foamTuts='cd $FOAM_TUTORIALS'
alias foamUtils='cd $FOAM_UTILITIES' alias foamUtils='cd $FOAM_UTILITIES'
alias foam3rdParty='cd $WM_THIRD_PARTY_DIR' 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 fi
# Location of site/user files # Location of installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_INST_DIR=$FOAM_INST_DIR export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION 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 # Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION 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 # Source files, possibly with some verbosity
_foamSource() _foamSource()
@ -169,99 +177,6 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
export FOAM_SETTINGS="$@" export FOAM_SETTINGS="$@"
_foamEval $@ _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) # Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath foamClean=$WM_PROJECT_DIR/bin/foamCleanPath

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fixedValueFvPatchScalarFieldTemplate.H" #include "fixedValueFvPatchFieldTemplate.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "volFields.H" #include "volFields.H"
@ -71,24 +71,25 @@ extern "C"
makeRemovablePatchTypeField makeRemovablePatchTypeField
( (
fvPatchScalarField, fvPatch${FieldType},
${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
); );
const char* ${typeName}FixedValueFvPatchScalarField::SHA1sum = "${SHA1sum}"; const char* const ${typeName}FixedValueFvPatch${FieldType}::SHA1sum =
"${SHA1sum}";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
${typeName}FixedValueFvPatchScalarField:: ${typeName}FixedValueFvPatch${FieldType}::
${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF const DimensionedField<${TemplateType}, volMesh>& iF
) )
: :
fixedValueFvPatchScalarField(p, iF) fixedValueFvPatchField<${TemplateType}>(p, iF)
{ {
if (${verbose:-false}) if (${verbose:-false})
{ {
@ -98,16 +99,16 @@ ${typeName}FixedValueFvPatchScalarField
} }
${typeName}FixedValueFvPatchScalarField:: ${typeName}FixedValueFvPatch${FieldType}::
${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
( (
const ${typeName}FixedValueFvPatchScalarField& ptf, const ${typeName}FixedValueFvPatch${FieldType}& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<${TemplateType}, volMesh>& iF,
const fvPatchFieldMapper& mapper const fvPatchFieldMapper& mapper
) )
: :
fixedValueFvPatchScalarField(ptf, p, iF, mapper) fixedValueFvPatchField<${TemplateType}>(ptf, p, iF, mapper)
{ {
if (${verbose:-false}) if (${verbose:-false})
{ {
@ -117,15 +118,15 @@ ${typeName}FixedValueFvPatchScalarField
} }
${typeName}FixedValueFvPatchScalarField:: ${typeName}FixedValueFvPatch${FieldType}::
${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<${TemplateType}, volMesh>& iF,
const dictionary& dict const dictionary& dict
) )
: :
fixedValueFvPatchScalarField(p, iF, dict) fixedValueFvPatchField<${TemplateType}>(p, iF, dict)
{ {
if (${verbose:-false}) if (${verbose:-false})
{ {
@ -135,13 +136,13 @@ ${typeName}FixedValueFvPatchScalarField
} }
${typeName}FixedValueFvPatchScalarField:: ${typeName}FixedValueFvPatch${FieldType}::
${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
( (
const ${typeName}FixedValueFvPatchScalarField& ptf const ${typeName}FixedValueFvPatch${FieldType}& ptf
) )
: :
fixedValueFvPatchScalarField(ptf) fixedValueFvPatchField<${TemplateType}>(ptf)
{ {
if (${verbose:-false}) if (${verbose:-false})
{ {
@ -151,14 +152,14 @@ ${typeName}FixedValueFvPatchScalarField
} }
${typeName}FixedValueFvPatchScalarField:: ${typeName}FixedValueFvPatch${FieldType}::
${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
( (
const ${typeName}FixedValueFvPatchScalarField& ptf, const ${typeName}FixedValueFvPatch${FieldType}& ptf,
const DimensionedField<scalar, volMesh>& iF const DimensionedField<${TemplateType}, volMesh>& iF
) )
: :
fixedValueFvPatchScalarField(ptf, iF) fixedValueFvPatchField<${TemplateType}>(ptf, iF)
{ {
if (${verbose:-false}) if (${verbose:-false})
{ {
@ -170,8 +171,8 @@ ${typeName}FixedValueFvPatchScalarField
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
${typeName}FixedValueFvPatchScalarField:: ${typeName}FixedValueFvPatch${FieldType}::
~${typeName}FixedValueFvPatchScalarField() ~${typeName}FixedValueFvPatch${FieldType}()
{ {
if (${verbose:-false}) if (${verbose:-false})
{ {
@ -182,7 +183,7 @@ ${typeName}FixedValueFvPatchScalarField::
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void ${typeName}FixedValueFvPatchScalarField::updateCoeffs() void ${typeName}FixedValueFvPatch${FieldType}::updateCoeffs()
{ {
if (this->updated()) if (this->updated())
{ {
@ -198,7 +199,7 @@ void ${typeName}FixedValueFvPatchScalarField::updateCoeffs()
${code} ${code}
//}}} end 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 You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fixedValueFvPatchScalarFieldTemplate
Description Description
Template for use with onTheFlyFixedValue. Template for use with dynamic code generation of a
- fixedValueFvPatchScalarField fixedValue fvPatchField.
- without state - without state
SourceFiles SourceFiles
fixedValueFvPatchScalarFieldTemplate.C fixedValueFvPatchFieldTemplate.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef fixedValueFvPatchScalarFieldTemplate_H #ifndef fixedValueFvPatchTemplate${FieldType}_H
#define fixedValueFvPatchScalarFieldTemplate_H #define fixedValueFvPatchTemplate${FieldType}_H
#include "fixedValueFvPatchFields.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: public:
//- Information about the SHA1 of the code itself //- Information about the SHA1 of the code itself
static const char* SHA1sum; static const char* const SHA1sum;
//- Runtime type information //- Runtime type information
TypeName("${typeName}"); TypeName("${typeName}");
@ -65,75 +62,72 @@ public:
// Constructors // Constructors
//- Construct from patch and internal field //- Construct from patch and internal field
${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
( (
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>& const DimensionedField<${TemplateType}, volMesh>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary
${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
( (
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<${TemplateType}, volMesh>&,
const dictionary& const dictionary&
); );
//- Construct by mapping given //- Construct by mapping a copy onto a new patch
// ${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
// onto a new patch
${typeName}FixedValueFvPatchScalarField
( (
const ${typeName}FixedValueFvPatchScalarField&, const ${typeName}FixedValueFvPatch${FieldType}&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<${TemplateType}, volMesh>&,
const fvPatchFieldMapper& const fvPatchFieldMapper&
); );
//- Construct as copy //- Construct as copy
${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
( (
const ${typeName}FixedValueFvPatchScalarField& const ${typeName}FixedValueFvPatch${FieldType}&
); );
//- Construct and return a clone //- 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 //- Construct as copy setting internal field reference
${typeName}FixedValueFvPatchScalarField ${typeName}FixedValueFvPatch${FieldType}
( (
const ${typeName}FixedValueFvPatchScalarField&, const ${typeName}FixedValueFvPatch${FieldType}&,
const DimensionedField<scalar, volMesh>& const DimensionedField<${TemplateType}, volMesh>&
); );
//- Construct and return a clone setting internal field reference //- 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 ) const
{ {
return tmp<fvPatchScalarField> return tmp< fvPatch${FieldType} >
( (
new ${typeName}FixedValueFvPatchScalarField(*this, iF) new ${typeName}FixedValueFvPatch${FieldType}(*this, iF)
); );
} }
//- Destructor //- Destructor
virtual ~${typeName}FixedValueFvPatchScalarField(); virtual ~${typeName}FixedValueFvPatch${FieldType}();
// Member functions // 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. # - remove anything under top-level directory.
# NB: the WM_PROJECT_INST_DIR might not be identical between versions # NB: the WM_PROJECT_INST_DIR might not be identical between versions
set foamOldDirs="$FOAM_INST_DIR $HOME/$WM_PROJECT/$LOGNAME" 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_INST_DIR $FOAM_INST_DIR
setenv WM_PROJECT_DIR $WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION 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 # Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION 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 # Source files, possibly with some verbosity
alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*' alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*'
@ -127,10 +141,12 @@ while ( $#argv > 0 )
switch ($argv[1]) switch ($argv[1])
case *=: case *=:
# name= -> unsetenv name # name= -> unsetenv name
if ($?FOAM_VERBOSE && $?prompt) echo "unsetenv $argv[1]:s/=//"
eval "unsetenv $argv[1]:s/=//" eval "unsetenv $argv[1]:s/=//"
breaksw breaksw
case *=*: case *=*:
# name=value -> setenv name value # name=value -> setenv name value
if ($?FOAM_VERBOSE && $?prompt) echo "setenv $argv[1]:s/=/ /"
eval "setenv $argv[1]:s/=/ /" eval "setenv $argv[1]:s/=/ /"
breaksw breaksw
default: default:
@ -146,100 +162,6 @@ while ( $#argv > 0 )
end 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) # Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath 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 # prefix to MANPATH
alias _foamAddMan 'setenv MANPATH \!*\:${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 # 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 # shared site executables/libraries
# similar naming convention as ~OpenFOAM expansion # similar naming convention as ~OpenFOAM expansion
setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin if ( $?WM_PROJECT_SITE ) then
setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib 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 # user executables/libraries
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin

View File

@ -60,6 +60,98 @@ _foamAddMan()
done 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 # 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 # shared site executables/libraries
# similar naming convention as ~OpenFOAM expansion # similar naming convention as ~OpenFOAM expansion
export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin if [ -n "$WM_PROJECT_SITE" ]
export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib 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 # user executables/libraries
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin 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) Foam::fileName Foam::findEtcFile(const fileName& name, bool mandatory)
{ {
// Search user files: //
// ~~~~~~~~~~~~~~~~~~ // search for user files in
// * ~/.OpenFOAM/VERSION
// * ~/.OpenFOAM
//
fileName searchDir = home()/".OpenFOAM"; fileName searchDir = home()/".OpenFOAM";
if (isDir(searchDir)) if (isDir(searchDir))
{ {
// Check for user file in ~/.OpenFOAM/VERSION
fileName fullName = searchDir/FOAMversion/name; fileName fullName = searchDir/FOAMversion/name;
if (isFile(fullName)) if (isFile(fullName))
{ {
return fullName; return fullName;
} }
// Check for version-independent user file in ~/.OpenFOAM
fullName = searchDir/name; fullName = searchDir/name;
if (isFile(fullName)) if (isFile(fullName))
{ {
@ -274,32 +275,61 @@ Foam::fileName Foam::findEtcFile(const fileName& name, bool mandatory)
} }
// Search site files: //
// ~~~~~~~~~~~~~~~~~~ // search for group (site) files in
searchDir = getEnv("WM_PROJECT_INST_DIR"); // * $WM_PROJECT_SITE/VERSION
if (isDir(searchDir)) // * $WM_PROJECT_SITE
//
searchDir = getEnv("WM_PROJECT_SITE");
if (searchDir.size())
{ {
// Check for site file in $WM_PROJECT_INST_DIR/site/VERSION if (isDir(searchDir))
fileName fullName = searchDir/"site"/FOAMversion/name;
if (isFile(fullName))
{ {
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/name;
fullName = searchDir/"site"/name; if (isFile(fullName))
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"); searchDir = getEnv("WM_PROJECT_DIR");
if (isDir(searchDir)) if (isDir(searchDir))
{ {
// Check for shipped OpenFOAM file in $WM_PROJECT_DIR/etc
fileName fullName = searchDir/"etc"/name; fileName fullName = searchDir/"etc"/name;
if (isFile(fullName)) 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 // abort if the file is mandatory, otherwise return null
if (mandatory) if (mandatory)
{ {
std::cerr<< "--> FOAM FATAL ERROR in Foam::findEtcFile() :" std::cerr
<< "--> FOAM FATAL ERROR in Foam::findEtcFile() :"
" could not find mandatory file\n '" " could not find mandatory file\n '"
<< name.c_str() << "'\n\n" << std::endl; << name.c_str() << "'\n\n" << std::endl;
::exit(1); ::exit(1);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License 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 const Foam::dimensionedScalar Foam::constant::physicoChemical::R

View File

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

View File

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

View File

@ -93,22 +93,22 @@ fileName cwd();
// else return false // else return false
bool chDir(const fileName& dir); bool chDir(const fileName& dir);
//- Search for \em name //- Search for a file from user/group/shipped directories.
// in the following hierarchy: // The search scheme allows for version-specific and
// -# personal settings: // version-independent files using the following hierarchy:
// - ~/.OpenFOAM/\<VERSION\>/ // - \b user settings:
// <em>for version-specific files</em> // - ~/.OpenFOAM/\<VERSION\>
// - ~/.OpenFOAM/ // - ~/.OpenFOAM/
// <em>for version-independent files</em> // - \b group (site) settings (when $WM_PROJECT_SITE is set):
// -# site-wide settings: // - $WM_PROJECT_SITE/\<VERSION\>
// - $WM_PROJECT_SITE
// - \b group (site) settings (when $WM_PROJECT_SITE is not set):
// - $WM_PROJECT_INST_DIR/site/\<VERSION\> // - $WM_PROJECT_INST_DIR/site/\<VERSION\>
// <em>for version-specific files</em>
// - $WM_PROJECT_INST_DIR/site/ // - $WM_PROJECT_INST_DIR/site/
// <em>for version-independent files</em> // - \b other (shipped) settings:
// -# shipped settings:
// - $WM_PROJECT_DIR/etc/ // - $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 // Optionally abort if the file cannot be found
fileName findEtcFile(const fileName&, bool mandatory=false); 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 //- 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. //- Are the planes separated.
virtual bool separated() const virtual bool separated() const
@ -297,12 +300,12 @@ public:
virtual void calcGeometry virtual void calcGeometry
( (
const primitivePatch& referPatch, const primitivePatch& referPatch,
const UList<point>& thisCtrs, const pointField& thisCtrs,
const UList<point>& thisAreas, const vectorField& thisAreas,
const UList<point>& thisCc, const pointField& thisCc,
const UList<point>& nbrCtrs, const pointField& nbrCtrs,
const UList<point>& nbrAreas, const vectorField& nbrAreas,
const UList<point>& nbrCc const pointField& nbrCc
) = 0; ) = 0;
//- Initialize ordering for primitivePatch. Does not //- Initialize ordering for primitivePatch. Does not

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -81,12 +81,12 @@ protected:
virtual void calcGeometry virtual void calcGeometry
( (
const primitivePatch& referPatch, const primitivePatch& referPatch,
const UList<point>& thisCtrs, const pointField& thisCtrs,
const UList<point>& thisAreas, const vectorField& thisAreas,
const UList<point>& thisCc, const pointField& thisCc,
const UList<point>& nbrCtrs, const pointField& nbrCtrs,
const UList<point>& nbrAreas, const vectorField& nbrAreas,
const UList<point>& nbrCc const pointField& nbrCc
) )
{ {
notImplemented("processorCyclicPolyPatch::calcGeometry(..)"); notImplemented("processorCyclicPolyPatch::calcGeometry(..)");
@ -279,6 +279,12 @@ public:
referPatch().transformPosition(l); 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. //- Are the planes separated.
virtual bool separated() const virtual bool separated() const
{ {

View File

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

View File

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

View File

@ -114,7 +114,8 @@ derivedFvPatchFields = $(fvPatchFields)/derived
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C $(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C $(derivedFvPatchFields)/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/advective/advectiveFvPatchFields.C $(derivedFvPatchFields)/advective/advectiveFvPatchFields.C
$(derivedFvPatchFields)/codedFixedValue/codedFixedValueFvPatchScalarField.C /* $(derivedFvPatchFields)/codedFixedValue/codedFixedValueFvPatchScalarField.C */
$(derivedFvPatchFields)/codedFixedValue/codedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/directMappedField/directMappedFieldFvPatchFields.C $(derivedFvPatchFields)/directMappedField/directMappedFieldFvPatchFields.C
$(derivedFvPatchFields)/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C $(derivedFvPatchFields)/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.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 "dynamicCode.H"
#include "dynamicCodeContext.H" #include "dynamicCodeContext.H"
#include "stringOps.H" #include "stringOps.H"
#include <cstring>
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateC const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateC
= "fixedValueFvPatchScalarFieldTemplate.C"; = "fixedValueFvPatchFieldTemplate.C";
const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateH const Foam::word Foam::codedFixedValueFvPatchScalarField::codeTemplateH
= "fixedValueFvPatchScalarFieldTemplate.H"; = "fixedValueFvPatchFieldTemplate.H";
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * * 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 * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
const Foam::IOdictionary& Foam::codedFixedValueFvPatchScalarField::dict() const const Foam::IOdictionary& Foam::codedFixedValueFvPatchScalarField::dict() const
@ -216,19 +236,24 @@ void Foam::codedFixedValueFvPatchScalarField::createLibrary
// filter with this context // filter with this context
dynCode.reset(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 // compile filtered C template
dynCode.addCompileFile(codeTemplateC); dynCode.addCompileFile(codeTemplateC);
// copy filtered H template // copy filtered H template
dynCode.addCopyFile(codeTemplateH); dynCode.addCopyFile(codeTemplateH);
// take no chances - typeName must be identical to redirectType_
dynCode.setFilterVariable("typeName", redirectType_);
// debugging: make BC verbose // debugging: make BC verbose
// dynCode.setFilterVariable("verbose", "true"); // dynCode.setFilterVariable("verbose", "true");
// Info<<"compile " << redirectType_ << " sha1: " // Info<<"compile " << redirectType_ << " sha1: "
// << context.sha1() << endl; // << context.sha1() << endl;
// define Make/options // define Make/options
dynCode.setMakeOptions 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 //- Create library based on the dynamicCodeContext
void createLibrary(dynamicCode&, const dynamicCodeContext&) const; void createLibrary(dynamicCode&, const dynamicCodeContext&) const;

View File

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

View File

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

View File

@ -491,10 +491,6 @@ public:
// Transformations // 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 //- Transform the physical properties of the particle
// according to the given transformation tensor // according to the given transformation tensor
virtual void transformProperties(const tensor& T); virtual void transformProperties(const tensor& T);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -134,63 +134,6 @@ greyMeanAbsorptionEmissionCoeffs
0 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; scatterModel constantScatter;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -135,63 +135,6 @@ greyMeanAbsorptionEmissionCoeffs
0 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; scatterModel constantScatter;

View File

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

View File

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

View File

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

View File

@ -13,7 +13,6 @@ FoamFile
location "system"; location "system";
object fvSolution; object fvSolution;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers 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