Merge branch 'master' into lagrangianDev

This commit is contained in:
andy
2009-05-18 17:10:02 +01:00
383 changed files with 3512 additions and 1684 deletions

View File

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

View File

@ -7,8 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
EXE_LIBS = \
-linterfaceProperties \
@ -18,5 +17,4 @@ EXE_LIBS = \
-lfiniteVolume \
-ldynamicMesh \
-lmeshTools \
-ldynamicFvMesh \
-lsampling
-ldynamicFvMesh

View File

@ -116,34 +116,23 @@
pd + rho*(g & mesh.C())
);
autoPtr<probes> pRefProbe;
label pdRefCell = 0;
scalar pdRefValue = 0.0;
setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
scalar pRefValue = 0.0;
if (pd.needReference())
{
pRefProbe.set
(
new probes
(
"pRefProbe",
mesh,
mesh.solutionDict().subDict("PISO").subDict("pRefProbe")
)
);
pRefValue = readScalar
(
mesh.solutionDict().subDict("PISO").lookup("pRefValue")
);
pdRefCell = pRefProbe->cells()[0];
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - pRefProbe->sample<scalar>("p")()[0]
pRefValue - getRefCellValue(p, pdRefCell)
);
}

View File

@ -40,7 +40,6 @@ Description
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "probes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -123,7 +122,7 @@ int main(int argc, char *argv[])
(
"p",
p.dimensions(),
pRefValue - pRefProbe->sample<scalar>("p")()[0]
pRefValue - getRefCellValue(p, pdRefCell)
);
}

View File

@ -106,6 +106,23 @@
scalar pdRefValue = 0.0;
setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
scalar pRefValue = 0.0;
if (pd.needReference())
{
pRefValue = readScalar
(
mesh.solutionDict().subDict("PISO").lookup("pRefValue")
);
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pdRefCell)
);
}
// Construct interface from alpha1 distribution
interfaceProperties interface(alpha1, U, twoPhaseProperties);

View File

@ -91,6 +91,16 @@ int main(int argc, char *argv[])
p = pd + rho*gh;
if (pd.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pdRefCell)
);
}
turbulence->correct();
runTime.write();

View File

@ -68,6 +68,23 @@
scalar pdRefValue = 0.0;
setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
scalar pRefValue = 0.0;
if (pd.needReference())
{
pRefValue = readScalar
(
mesh.solutionDict().subDict("PISO").lookup("pRefValue")
);
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pdRefCell)
);
}
// Construct incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence

View File

@ -83,6 +83,16 @@ int main(int argc, char *argv[])
p = pd + rho*gh;
if (pd.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pdRefCell)
);
}
turbulence->correct();
runTime.write();

View File

@ -95,6 +95,23 @@
scalar pdRefValue = 0.0;
setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
scalar pRefValue = 0.0;
if (pd.needReference())
{
pRefValue = readScalar
(
mesh.solutionDict().subDict("PISO").lookup("pRefValue")
);
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pdRefCell)
);
}
// Construct incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence

View File

@ -75,6 +75,16 @@ int main(int argc, char *argv[])
p = pd + rho*gh;
if (pd.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pdRefCell)
);
}
turbulence->correct();
runTime.write();

View File

@ -160,18 +160,33 @@ int main(int argc, char *argv[])
<< " " << lstB.size() << endl;
Info<< "<dlD>" << dlD << "</dlD>" << nl << "sizes: "
<< " " << dlD.size() << "/" << dlD.capacity() << endl;
DynamicList<label,10> dlE1(10);
DynamicList<label> dlE2(dlE1);
DynamicList<label> dlE2(dlE1); // construct dissimilar
Info<< "<dlE1>" << dlE1 << "</dlE1>" << nl << "sizes: "
<< " " << dlE1.size() << "/" << dlE1.capacity() << endl;
Info<< "<dlE2>" << dlE2 << "</dlE2>" << nl << "sizes: "
<< " " << dlE2.size() << "/" << dlE2.capacity() << endl;
dlE2.append(100);
for (label elemI=0; elemI < 5; ++elemI)
{
dlE1.append(4 - elemI);
dlE2.append(elemI);
}
Info<< "<dlE2>" << dlE2 << "</dlE2>" << endl;
DynamicList<label> dlE3(dlE2); // construct identical
Info<< "<dlE3>" << dlE3 << "</dlE3>" << endl;
dlE3 = dlE1; // assign dissimilar
Info<< "<dlE3>" << dlE3 << "</dlE3>" << endl;
dlE3 = dlE2; // assign identical
Info<< "<dlE3>" << dlE3 << "</dlE3>" << endl;
Info<< "\nEnd\n";
return 0;

View File

@ -39,7 +39,7 @@ using namespace Foam;
int main()
{
HASHTABLE_CLASS<double> table1(100);
HASHTABLE_CLASS<double> table1(13);
table1.insert("aaa", 1.0);
table1.insert("aba", 2.0);
@ -56,7 +56,8 @@ int main()
table1.erase("abs");
Info<< "\ntable1 toc: " << table1.toc() << endl;
Info<< "\ntable1 [" << table1.size() << "] " << endl;
table1.printInfo(Info)
<< "table1 [" << table1.size() << "] " << endl;
forAllIter(HASHTABLE_CLASS<double>, table1, iter)
{
Info<< iter.key() << " => " << iter() << nl;
@ -97,7 +98,7 @@ int main()
<< "transfer table1 -> table3 via the xfer() method" << nl;
Info<< "\ntable1" << table1 << nl
<< "\ntable2" << table1 << nl
<< "\ntable2" << table2 << nl
<< "\ntable3" << table3 << nl;
Info<< "\nerase table2 by iterator" << nl;
@ -113,10 +114,14 @@ int main()
<< "\ntable3" << table3 << nl;
table3.resize(1);
Info<< "\nresize(1) table3" << table3 << nl;
Info<< "\nresize(1) table3" << nl;
table3.printInfo(Info)
<< table3 << nl;
table3.resize(10000);
Info<< "\nresize(10000) table3" << table3 << nl;
Info<< "\nresize(10000) table3" << nl;
table3.printInfo(Info)
<< table3 << nl;
HASHTABLE_CLASS<double> table4;
@ -134,26 +139,27 @@ int main()
table1.erase(table1.begin());
Info<< "removed an element - test table1 != table3 : "
<< (table1 != table3) << nl;
// insert a few things into table2
table2.set("ada", 14.0);
table2.set("aeq", 15.0);
table2.set("aaw", 16.0);
table2.set("abs", 17.0);
table2.set("adx", 20.0);
Info<< "\ntable1" << table1 << nl
<< "\ntable2" << table2 << nl;
label nErased = table1.erase(table2);
Info<< "\nerase table2 keys from table1 (removed "
<< nErased << " elements)" << nl
<< "\ntable1" << table1 << nl
<< "\ntable2" << table2 << nl;
Info<< "\nclearStorage table3 ... ";
Info<< "\ntable3" << table3
<< "\nclearStorage table3 ... ";
table3.clearStorage();
Info<< table3 << nl;

View File

@ -39,7 +39,7 @@ using namespace Foam;
int main()
{
HASHTABLE_CLASS<double> table1(100);
HASHTABLE_CLASS<double> table1(13);
table1.insert("aaa", 1.0);
table1.insert("aba", 2.0);
@ -56,7 +56,8 @@ int main()
table1.erase("abs");
Info<< "\ntable1 toc: " << table1.toc() << endl;
Info<< "\ntable1 [" << table1.size() << "] " << endl;
table1.printInfo(Info)
<< "table1 [" << table1.size() << "] " << endl;
forAllIter(HASHTABLE_CLASS<double>, table1, iter)
{
Info<< iter.key() << " => " << iter() << nl;
@ -97,7 +98,7 @@ int main()
<< "transfer table1 -> table3 via the xfer() method" << nl;
Info<< "\ntable1" << table1 << nl
<< "\ntable2" << table1 << nl
<< "\ntable2" << table2 << nl
<< "\ntable3" << table3 << nl;
Info<< "\nerase table2 by iterator" << nl;
@ -113,10 +114,14 @@ int main()
<< "\ntable3" << table3 << nl;
table3.resize(1);
Info<< "\nresize(1) table3" << table3 << nl;
Info<< "\nresize(1) table3" << nl;
table3.printInfo(Info)
<< table3 << nl;
table3.resize(10000);
Info<< "\nresize(10000) table3" << table3 << nl;
Info<< "\nresize(10000) table3" << nl;
table3.printInfo(Info)
<< table3 << nl;
HASHTABLE_CLASS<double> table4;
@ -134,26 +139,27 @@ int main()
table1.erase(table1.begin());
Info<< "removed an element - test table1 != table3 : "
<< (table1 != table3) << nl;
// insert a few things into table2
table2.set("ada", 14.0);
table2.set("aeq", 15.0);
table2.set("aaw", 16.0);
table2.set("abs", 17.0);
table2.set("adx", 20.0);
Info<< "\ntable1" << table1 << nl
<< "\ntable2" << table2 << nl;
label nErased = table1.erase(table2);
Info<< "\nerase table2 keys from table1 (removed "
<< nErased << " elements)" << nl
<< "\ntable1" << table1 << nl
<< "\ntable2" << table2 << nl;
Info<< "\nclearStorage table3 ... ";
Info<< "\ntable3" << table3
<< "\nclearStorage table3 ... ";
table3.clearStorage();
Info<< table3 << nl;
@ -162,4 +168,5 @@ int main()
return 0;
}
// ************************************************************************* //

View File

@ -27,6 +27,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "UIndirectList.H"
#include "DynamicList.H"
#include "IOstreams.H"
#include "ListOps.H"
#include "OFstream.H"
@ -58,11 +59,11 @@ int main(int argc, char *argv[])
idl[1] = -666;
Info<< "idl[1] changed:" << idl << endl;
Info<< "idl[1] changed: " << idl << endl;
idl = -999;
Info<< "idl changed:" << idl << endl;
Info<< "idl changed: " << idl << endl;
UIndirectList<double> idl2(idl);
@ -79,17 +80,26 @@ int main(int argc, char *argv[])
idl = ident;
}
Info<< "idl assigned from UList:" << idl << endl;
Info<< "idl assigned from UList: " << idl << endl;
List<double> realList = UIndirectList<double>(completeList, addresses);
// test List operations
Info<< "realList:" << realList << endl;
List<double> flatList = UIndirectList<double>(completeList, addresses);
Info<< "List assigned from UIndirectList: " << flatList << endl;
List<double> realList2(UIndirectList<double>(completeList, addresses));
List<double> flatList2(UIndirectList<double>(completeList, addresses));
Info<< "List constructed from UIndirectList: " << flatList2 << endl;
Info<< "realList2:" << realList2 << endl;
flatList.append(UIndirectList<double>(completeList, addresses));
Info<< "List::append(UIndirectList): " << flatList << endl;
DynamicList<double> dynList(UIndirectList<double>(completeList, addresses));
Info<< "DynamicList constructed from UIndirectList: " << dynList << endl;
dynList.append(UIndirectList<double>(completeList, addresses));
Info<< "DynamicList::append(UIndirectList): " << dynList << endl;
Info << "\nEnd\n" << endl;
return 0;

View File

@ -52,10 +52,17 @@ int main(int argc, char *argv[])
Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() << nl
<< "dict2.toc(): " << dict2.name() << " " << dict2.toc() << endl;
// copy back
dict1 = dict2;
Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() << endl;
dictionary dict3(dict2.subDictPtr("boundaryField"));
dictionary dict4(dict2.subDictPtr("NONEXISTENT"));
Info<< "dictionary construct from pointer" << nl
<< "ok = " << dict3.name() << " " << dict3.toc() << nl
<< "no = " << dict4.name() << " " << dict4.toc() << endl;
}

View File

@ -1,23 +1,28 @@
/*-------------------------------*- C++ -*---------------------------------*\
| ========= |
| \\ / OpenFOAM |
| \\ / |
| \\ / The Open Source CFD Toolbox |
| \\/ http://www.OpenFOAM.org |
\*-------------------------------------------------------------------------*/
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: Any |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object testDict;
version 2.0;
format ascii;
class dictionary;
object testDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#inputMode merge
dimensions [ 0 2 -2 0 0 0 0 ];
internalField uniform 1;
// use 'protect' to supply defaults
#inputMode protect
internalField uniform 10;
dimensions [ 0 2 -2 0 0 0 0 ];
#inputMode merge
active
{
type turbulentIntensityKineticEnergyInlet;
@ -31,6 +36,7 @@ inactive
type zeroGradient;
}
boundaryField
{
Default_Boundary_Region
@ -101,4 +107,4 @@ baz
// this should work too
#remove ( bar baz )
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,19 +1,18 @@
/*-------------------------------*- C++ -*---------------------------------*\
| ========= |
| \\ / OpenFOAM |
| \\ / |
| \\ / The Open Source CFD Toolbox |
| \\/ http://www.OpenFOAM.org |
\*-------------------------------------------------------------------------*/
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: Any |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object testDict;
version 2.0;
format ascii;
class dictionary;
object testDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
boundaryField
{
@ -27,4 +26,4 @@ boundaryField
}
#inputMode overwrite
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

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

View File

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

View File

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

View File

@ -77,11 +77,11 @@ int main(int argc, char *argv[])
// Patches to put baffles into
labelList newPatches(1);
DynamicList<label> newPatches(1);
word patchName(args.additionalArgs()[1]);
newPatches[0] = patches.findPatchID(patchName);
Info<< "Using patch " << patchName
newPatches.append(patches.findPatchID(patchName));
Pout<< "Using patch " << patchName
<< " at index " << newPatches[0] << endl;
if (newPatches[0] == -1)
@ -100,6 +100,7 @@ int main(int argc, char *argv[])
IStringStream(args.options()["additionalPatches"])()
);
newPatches.reserve(patchNames.size() + 1);
forAll(patchNames, i)
{
label patchI = patches.findPatchID(patchNames[i]);
@ -171,7 +172,7 @@ int main(int argc, char *argv[])
// since otherwise it will have trouble matching baffles.
label nBaffled = 0;
forAll(newPatches, i)
{
label newPatchI = newPatches[i];

View File

@ -540,6 +540,16 @@ int main(int argc, char *argv[])
processorDb.setTime(runTime);
// remove files remnants that can cause horrible problems
// - mut and nut are used to mark the new turbulence models,
// their existence prevents old models from being upgraded
{
fileName timeDir(processorDb.path()/processorDb.timeName());
rm(timeDir/"mut");
rm(timeDir/"nut");
}
// read the mesh
fvMesh procMesh
(

View File

@ -38,8 +38,8 @@
#
#------------------------------------------------------------------------------
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] <application> ...
@ -50,16 +50,17 @@ options:
* run a particular OpenFOAM version of <application>
USAGE
exit 1
exit 1
}
# This script should exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# extract the <foamInstall> and <version> elements
# using a function preserves the command args
getDefaults() {
set -- $(echo $0 | sed -e 's@/OpenFOAM-\([^/]*\)/bin/[^/]*$@ \1@')
foamInstall=$1
version=$2
set -- $(echo $0 | sed -e 's@/OpenFOAM-\([^/]*\)/bin/[^/]*$@ \1@')
foamInstall=$1
version=$2
}
getDefaults
@ -67,72 +68,60 @@ getDefaults
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-v)
shift
version=$1
shift
;;
--)
shift
break
;;
-*)
usage "invalid option '$1'"
;;
*)
break
;;
esac
case "$1" in
-h | -help)
usage
;;
-v)
shift
version=$1
shift
;;
--)
shift
break
;;
-*)
usage "invalid option '$1'"
;;
*)
break
;;
esac
done
if [ "$#" -lt 1 ]; then
usage "no application specified"
if [ "$#" -lt 1 ]
then
usage "no application specified"
fi
unset foamDotFile
# Check user-specific OpenFOAM bashrc file
for subDir in \
$HOME/.OpenFOAM-$version \
$HOME/.OpenFOAM/$version \
;
do
foamDotFile="$subDir/bashrc"
if [ -f $foamDotFile ]; then
. $foamDotFile
foamDotFile=okay
break
fi
done
# Use the FOAM_INST_DIR variable for locating the installed version
if [ "$foamDotFile" != okay ]
foamDotFile="$HOME/.OpenFOAM/$version/bashrc"
if [ -f $foamDotFile ]
then
for FOAM_INST_DIR in $foamInstall $WM_PROJECT_INST_DIR
do
for subDir in \
OpenFOAM-$version/etc \
OpenFOAM-$version/.OpenFOAM-$version \
;
do
foamDotFile="$FOAM_INST_DIR/$subDir/bashrc"
if [ -f $foamDotFile ]; then
. $foamDotFile
foamDotFile=okay
break 2
. $foamDotFile
foamDotFile=okay
else
# Use the FOAM_INST_DIR variable for locating the installed version
for FOAM_INST_DIR in $foamInstall $WM_PROJECT_INST_DIR
do
foamDotFile="$FOAM_INST_DIR/OpenFOAM-$version/etc/bashrc"
if [ -f $foamDotFile ]
then
. $foamDotFile
foamDotFile=okay
break
fi
done
done
done
fi
if [ "$foamDotFile" != okay ];
if [ "$foamDotFile" != okay ]
then
echo "Error : bashrc file could not be found for OpenFOAM-$version" 1>&2
exit 1
echo "Error : bashrc file could not be found for OpenFOAM-$version" 1>&2
exit 1
fi
# Pass on the rest of the arguments

View File

@ -41,7 +41,7 @@ do
export CINTSYSDIR
export PATH=$PATH:$CINTSYSDIR/bin
export MANPATH=$MANPATH:$CINTSYSDIR/doc
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$CINTSYSDIR/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CINTSYSDIR/lib
break
fi
done

View File

@ -256,7 +256,7 @@ cleanEnv=`$cleanProg "$PATH"` && PATH="$cleanEnv"
cleanEnv=`$cleanProg "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleanEnv"
#- Clean MANPATH
cleanEnv=`$cleanProg "$MANPATH"` && MANPATH="$cleanEnv"
cleanEnv=`$cleanProg "$MANPATH"` && MANPATH="$cleanEnv:"
export PATH LD_LIBRARY_PATH MANPATH

235
etc/constant/RASProperties Normal file
View File

@ -0,0 +1,235 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
note "default coefficients for RAS models";
location "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
wallFunctionCoeffs
{
kappa 0.4187;
E 9;
}
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33; // only for compressible
alphak 1.0; // only for compressible
alphaEps 0.76923;
alphah 1.0; // only for compressible
}
RNGkEpsilonCoeffs
{
Cmu 0.0845;
C1 1.42;
C2 1.68;
C3 -0.33; // only for compressible
alphak 1.39;
alphaEps 1.39;
alphah 1.0; // only for compressible
eta0 4.38;
beta 0.012;
}
realizableKECoeffs
{
Cmu 0.09;
A0 4.0;
C2 1.9;
alphak 1.0;
alphaEps 0.833333;
alphah 1.0; // only for compressible
}
kOmegaSSTCoeffs
{
alphaK1 0.85034;
alphaK2 1.0;
alphaOmega1 0.5;
alphaOmega2 0.85616;
alphah 1.0; // only for compressible
beta1 0.075;
beta2 0.0828;
betaStar 0.09;
gamma1 0.5532;
gamma2 0.4403;
a1 0.31;
c1 10.0;
}
LaunderGibsonRSTMCoeffs
{
Cmu 0.09;
Clg1 1.8;
Clg2 0.6;
C1 1.44;
C2 1.92;
C1Ref 0.5;
C2Ref 0.3;
Cs 0.25;
Ceps 0.15;
alphah 1.0; // only for compressible
alphaEps 0.76923;
alphaR 1.22;
couplingFactor 0.0;
}
LaunderSharmaKECoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33;
alphah 1.0; // only for compressible
alphahk 1.0; // only for compressible
alphaEps 0.76923;
}
LRRCoeffs
{
Cmu 0.09;
Clrr1 1.8;
Clrr2 0.6;
C1 1.44;
C2 1.92;
Cs 0.25;
Ceps 0.15;
alphah 1.0; // only for compressible
alphaEps 0.76923;
alphaR 1.22; // only for compressible
couplingFactor 0.0; // only for incompressible
}
SpalartAllmarasCoeffs
{
Cb1 0.1355;
Cb2 0.622;
Cw2 0.3;
Cw3 2.0;
Cv1 7.1;
Cv2 5.0;
alphaNut 1.5;
alphah 1.0; // only for compressible
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// incompressible only:
kOmegaCoeffs
{
betaStar 0.09;
alpha 0.52;
beta 0.072;
alphak 0.5;
alphaOmega 0.5;
Cmu $betaStar; // equivalent to betaStar
}
LamBremhorstKECoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphaEps 0.76923;
}
LienCubicKECoeffs
{
C1 1.44;
C2 1.92;
alphak 1;
alphaEps 0.76923;
A1 1.25;
A2 1000;
Ctau1 -4;
Ctau2 13;
Ctau3 -2;
alphaKsi 0.9;
}
LienCubicKELowReCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphak 1;
alphaEps 0.76923;
A1 1.25;
A2 1000;
Ctau1 -4;
Ctau2 13;
Ctau3 -2;
alphaKsi 0.9;
Am 0.016;
Aepsilon 0.263;
Amu 0.00222;
}
LienLeschzinerLowReCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphak 1;
alphaEps 0.76923;
Am 0.016;
Aepsilon 0.263;
Amu 0.00222;
}
NonlinearKEShihCoeffs
{
Cmu 0.09; // only for boundary conditions?
C1 1.44;
C2 1.92;
alphak 1;
alphaEps 0.76932;
A1 1.25;
A2 1000;
Ctau1 -4;
Ctau2 13;
Ctau3 -2;
alphaKsi 0.9;
}
QZetaCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphaZeta 0.76923;
anisotropic false;
}
// ************************************************************************* //

View File

@ -257,7 +257,7 @@ endif
setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH"`
#- Clean MANPATH
setenv MANPATH `$cleanProg "$MANPATH"`
setenv MANPATH `$cleanProg "$MANPATH"`:
#- Clean LD_PRELOAD
if ( $?LD_PRELOAD ) then

View File

@ -83,6 +83,11 @@ case OpenFOAM:
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
breaksw
case Gcc43:
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
breaksw
case Gcc42:
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
breaksw
@ -113,7 +118,7 @@ unset MPI_ARCH_PATH
switch ("$WM_MPLIB")
case OPENMPI:
set mpi_version=openmpi-1.3
set mpi_version=openmpi-1.3.2
setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS

View File

@ -93,7 +93,7 @@ unset compilerBin compilerLib
# compilerInstall = OpenFOAM | System
compilerInstall=OpenFOAM
case "$compilerInstall" in
case "${compilerInstall:-OpenFOAM}" in
OpenFOAM)
case "$WM_COMPILER" in
Gcc)
@ -101,6 +101,11 @@ OpenFOAM)
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
;;
Gcc43)
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
;;
Gcc42)
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
;;
@ -137,7 +142,7 @@ unset MPI_ARCH_PATH
case "$WM_MPLIB" in
OPENMPI)
mpi_version=openmpi-1.3
mpi_version=openmpi-1.3.2
export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version
export MPI_ARCH_PATH=$MPI_HOME/platforms/$WM_OPTIONS

View File

@ -50,7 +50,7 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("HashPtrTable<T, Key, Hash>");
char delimiter = is.readBeginList("HashPtrTable<T, Key, Hash>");
if (s)
{
@ -59,7 +59,7 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
this->resize(2*s);
}
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (label i=0; i<s; i++)
{

View File

@ -28,6 +28,13 @@ Class
Description
An STL-conforming hash table.
Note
Hashing index collisions are handled via chaining using a singly-linked
list with the colliding entry being added to the head of the linked
list. Thus copying the hash table (or indeed even resizing it) will
often result in a different hash order. Use a sorted table-of-contents
when the hash order is important.
SourceFiles
HashTableI.H
HashTable.C

View File

@ -81,7 +81,7 @@ Foam::HashTable<T, Key, Hash>::printInfo(Ostream& os) const
os << "HashTable<T,Key,Hash>"
<< " elements:" << size() << " slots:" << used << "/" << tableSize_
<< " chaining(avg/max):" << (used ? float(avgChain/used) : 0)
<< " chaining(avg/max):" << (used ? (float(avgChain)/used) : 0)
<< "/" << maxChain << endl;
return os;
@ -91,7 +91,11 @@ Foam::HashTable<T, Key, Hash>::printInfo(Ostream& os) const
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class T, class Key, class Hash>
Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
Foam::Istream& Foam::operator>>
(
Istream& is,
HashTable<T, Key, Hash>& L
)
{
is.fatalCheck("operator>>(Istream&, HashTable<T, Key, Hash>&)");
@ -113,7 +117,7 @@ Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("HashTable<T, Key, Hash>");
char delimiter = is.readBeginList("HashTable<T, Key, Hash>");
if (s)
{
@ -122,7 +126,7 @@ Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
L.resize(2*s);
}
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (label i=0; i<s; i++)
{
@ -209,7 +213,11 @@ Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
template<class T, class Key, class Hash>
Foam::Ostream& Foam::operator<<(Ostream& os, const HashTable<T, Key, Hash>& L)
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const HashTable<T, Key, Hash>& L
)
{
// Write size and start delimiter
os << nl << L.size() << nl << token::BEGIN_LIST << nl;

View File

@ -117,7 +117,7 @@ Foam::Istream& Foam::operator>>(Istream& is, StaticHashTable<T, Key, Hash>& L)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("StaticHashTable<T, Key, Hash>");
char delimiter = is.readBeginList("StaticHashTable<T, Key, Hash>");
if (s)
{
@ -126,7 +126,7 @@ Foam::Istream& Foam::operator>>(Istream& is, StaticHashTable<T, Key, Hash>& L)
L.resize(2*s);
}
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (label i=0; i<s; i++)
{

View File

@ -50,11 +50,11 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("ILList<LListBase, T>");
char delimiter = is.readBeginList("ILList<LListBase, T>");
if (s)
{
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (label i=0; i<s; i++)
{

View File

@ -61,11 +61,11 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("LList<LListBase, T>");
char delimiter = is.readBeginList("LList<LListBase, T>");
if (s)
{
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (register label i=0; i<s; i++)
{

View File

@ -53,11 +53,11 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("LPtrList<LListBase, T>");
char delimiter = is.readBeginList("LPtrList<LListBase, T>");
if (s)
{
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (label i=0; i<s; i++)
{

View File

@ -111,8 +111,11 @@ public:
// Also constructs from DynamicList with different sizing parameters.
explicit inline DynamicList(const UList<T>&);
//- Construct from UIndirectList. Size set to UIndirectList size.
explicit inline DynamicList(const UIndirectList<T>&);
//- Construct by transferring the parameter contents
explicit inline DynamicList(const Xfer<List<T> >&);
explicit inline DynamicList(const Xfer< List<T> >&);
//- Construct from Istream. Size set to size of read list.
explicit DynamicList(Istream&);
@ -173,16 +176,19 @@ public:
inline void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>&);
//- Transfer contents to the Xfer container as a plain List
inline Xfer<List<T> > xfer();
inline Xfer< List<T> > xfer();
// Member Operators
//- Append an element at the end of the list
inline void append(const T& e);
inline void append(const T&);
//- Append a List at the end of this list
inline void append(const UList<T>&);
//- Append a UIndirectList at the end of this list
inline void append(const UIndirectList<T>&);
//- Remove and return the top element
inline T remove();
@ -198,7 +204,7 @@ public:
const DynamicList<T, SizeInc, SizeMult, SizeDiv>&
);
//- Assignment from List<T>.
//- Assignment from UList
inline void operator=(const UList<T>&);
// IOstream operators

View File

@ -72,6 +72,17 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
{}
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
(
const UIndirectList<T>& lst
)
:
List<T>(lst),
capacity_(lst.size())
{}
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
(
@ -287,10 +298,10 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::Xfer<Foam::List<T> >
inline Foam::Xfer< Foam::List<T> >
Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::xfer()
{
return xferMoveTo<List<T> >(*this);
return xferMoveTo< List<T> >(*this);
}
@ -313,8 +324,6 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
const UList<T>& lst
)
{
label nextFree = List<T>::size();
if (this == &lst)
{
FatalErrorIn
@ -324,6 +333,23 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
) << "attempted appending to self" << abort(FatalError);
}
label nextFree = List<T>::size();
setSize(nextFree + lst.size());
forAll(lst, elemI)
{
this->operator[](nextFree++) = lst[elemI];
}
}
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
(
const UIndirectList<T>& lst
)
{
label nextFree = List<T>::size();
setSize(nextFree + lst.size());
forAll(lst, elemI)

View File

@ -82,9 +82,9 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L)
}
// Read beginning of contents
char listDelimiter = is.readBeginList("FixedList");
char delimiter = is.readBeginList("FixedList");
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (register unsigned i=0; i<Size; i++)
{

View File

@ -404,61 +404,6 @@ void Foam::List<T>::clear()
}
template<class T>
void Foam::List<T>::append(const UList<T>& lst)
{
if (this == &lst)
{
FatalErrorIn
(
"List<T>::append(const UList<T>&)"
) << "attempted appending to self" << abort(FatalError);
}
label nextFree = this->size_;
setSize(nextFree + lst.size());
forAll(lst, elemI)
{
this->operator[](nextFree++) = lst[elemI];
}
}
template<class T>
void Foam::List<T>::append(const UIndirectList<T>& lst)
{
label nextFree = this->size_;
setSize(nextFree + lst.size());
forAll(lst, elemI)
{
this->operator[](nextFree++) = lst[elemI];
}
}
template<class T>
void Foam::List<T>::append(const SLList<T>& lst)
{
if (lst.size())
{
label nextFree = this->size_;
setSize(nextFree + lst.size());
for
(
typename SLList<T>::const_iterator iter = lst.begin();
iter != lst.end();
++iter
)
{
this->operator[](nextFree++) = iter();
}
}
}
// Transfer the contents of the argument List into this List
// and anull the argument list
template<class T>

View File

@ -182,24 +182,21 @@ public:
void clear();
//- Append a List at the end of this list
void append(const UList<T>&);
inline void append(const UList<T>&);
//- Append a UIndirectList at the end of this list
void append(const UIndirectList<T>&);
inline void append(const UIndirectList<T>&);
//- Append a SLList at the end of this list
void append(const SLList<T>&);
//- Transfer the contents of the argument List into this List
//- Transfer the contents of the argument List into this list
// and annull the argument list.
void transfer(List<T>&);
//- Transfer the contents of the argument List into this List
//- Transfer the contents of the argument List into this list
// and annull the argument list.
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>&);
//- Transfer the contents of the argument List into this List
//- Transfer the contents of the argument List into this list
// and annull the argument list.
void transfer(SortableList<T>&);

View File

@ -88,12 +88,46 @@ inline Foam::label Foam::List<T>::size() const
template<class T>
inline Foam::Xfer<Foam::List<T> > Foam::List<T>::xfer()
inline Foam::Xfer< Foam::List<T> > Foam::List<T>::xfer()
{
return xferMove(*this);
}
template<class T>
inline void Foam::List<T>::append(const UList<T>& lst)
{
if (this == &lst)
{
FatalErrorIn
(
"List<T>::append(const UList<T>&)"
) << "attempted appending to self" << abort(FatalError);
}
label nextFree = this->size();
setSize(nextFree + lst.size());
forAll(lst, elemI)
{
this->operator[](nextFree++) = lst[elemI];
}
}
template<class T>
inline void Foam::List<T>::append(const UIndirectList<T>& lst)
{
label nextFree = this->size();
setSize(nextFree + lst.size());
forAll(lst, elemI)
{
this->operator[](nextFree++) = lst[elemI];
}
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T>

View File

@ -76,11 +76,11 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& L)
if (is.format() == IOstream::ASCII || !contiguous<T>())
{
// Read beginning of contents
char listDelimiter = is.readBeginList("List");
char delimiter = is.readBeginList("List");
if (s)
{
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (register label i=0; i<s; i++)
{

View File

@ -54,11 +54,11 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
setSize(s);
// Read beginning of contents
char listDelimiter = is.readBeginList("PtrList");
char delimiter = is.readBeginList("PtrList");
if (s)
{
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
forAll(*this, i)
{

View File

@ -53,7 +53,8 @@ bool Foam::dictionary::findInPatterns
{
if
(
patternMatch ? reLink()->match(Keyword)
patternMatch
? reLink()->match(Keyword)
: wcLink()->keyword() == Keyword
)
{
@ -83,7 +84,8 @@ bool Foam::dictionary::findInPatterns
{
if
(
patternMatch ? reLink()->match(Keyword)
patternMatch
? reLink()->match(Keyword)
: wcLink()->keyword() == Keyword
)
{
@ -158,6 +160,20 @@ Foam::dictionary::dictionary
}
Foam::dictionary::dictionary
(
const dictionary* dictPtr
)
:
parent_(dictionary::null)
{
if (dictPtr)
{
operator=(*dictPtr);
}
}
Foam::dictionary::dictionary
(
const dictionary& parentDict,

View File

@ -168,6 +168,10 @@ public:
//- Construct top-level dictionary as copy
dictionary(const dictionary&);
//- Construct top-level dictionary as copy from pointer to dictionary.
// A null pointer is treated like an empty dictionary.
dictionary(const dictionary*);
//- Construct by transferring parameter contents given parent dictionary
dictionary(const dictionary& parentDict, const Xfer<dictionary>&);

View File

@ -73,7 +73,7 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
{
cerr<< "--> FOAM Warning : " << std::endl
<< " From function "
<< "entry::getKeyword(keyType& keyword, Istream& is)" << std::endl
<< "entry::getKeyword(keyType&, Istream&)" << std::endl
<< " in file " << __FILE__
<< " at line " << __LINE__ << std::endl
<< " Reading " << is.name().c_str() << std::endl
@ -88,7 +88,7 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
bool Foam::entry::New(dictionary& parentDict, Istream& is)
{
is.fatalCheck("entry::New(const dictionary& parentDict, Istream& is)");
is.fatalCheck("entry::New(const dictionary& parentDict, Istream&)");
keyType keyword;
@ -97,9 +97,9 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
{
return false;
}
else // Keyword starts entry ...
else // Keyword starts entry ...
{
if (keyword[0] == '#') // ... Function entry
if (keyword[0] == '#') // ... Function entry
{
word functionName = keyword(1, keyword.size()-1);
return functionEntry::execute(functionName, parentDict, is);
@ -128,9 +128,14 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
false,
false
);
if (existingPtr)
{
if (functionEntries::inputModeEntry::overwrite())
if (functionEntries::inputModeEntry::merge())
{
mergeEntry = true;
}
else if (functionEntries::inputModeEntry::overwrite())
{
// clear dictionary so merge acts like overwrite
if (existingPtr->isDict())
@ -139,9 +144,30 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
}
mergeEntry = true;
}
else if (functionEntries::inputModeEntry::merge())
else if (functionEntries::inputModeEntry::protect())
{
mergeEntry = true;
// read and discard the entry
if (nextToken == token::BEGIN_BLOCK)
{
dictionaryEntry dummy(keyword, parentDict, is);
}
else
{
primitiveEntry dummy(keyword, parentDict, is);
}
return true;
}
else if (functionEntries::inputModeEntry::error())
{
FatalIOErrorIn
(
"entry::New(const dictionary& parentDict, Istream&)",
is
)
<< "ERROR! duplicate entry: " << keyword
<< exit(FatalIOError);
return false;
}
}
@ -168,7 +194,7 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
Foam::autoPtr<Foam::entry> Foam::entry::New(Istream& is)
{
is.fatalCheck("entry::New(Istream& is)");
is.fatalCheck("entry::New(Istream&)");
keyType keyword;

View File

@ -58,7 +58,7 @@ bool Foam::functionEntry::execute
is.fatalCheck
(
"functionEntry::execute"
"(const word& functionName, dictionary& parentDict, Istream& is)"
"(const word& functionName, dictionary& parentDict, Istream&)"
);
if (!executedictionaryIstreamMemberFunctionTablePtr_)

View File

@ -131,7 +131,7 @@ bool Foam::functionEntries::includeEntry::execute
FatalIOErrorIn
(
"functionEntries::includeEntry::includeEntry"
"(dictionary& parentDict, primitiveEntry& entry, Istream&)",
"(dictionary& parentDict, primitiveEntry&, Istream&)",
is
) << "Cannot open include file " << ifs.name()
<< " while reading dictionary " << parentDict.name()

View File

@ -34,8 +34,8 @@ Description
#include "includeFile"
@endverbatim
The usual expansion of environment variables and other constructs (eg,
the @c ~OpenFOAM/ expansion) is retained.
The usual expansion of environment variables and other constructs
(eg, the @c ~OpenFOAM/ expansion) is retained.
See Also
fileName, string::expand()

View File

@ -72,6 +72,14 @@ void Foam::functionEntries::inputModeEntry::setMode(Istream& is)
{
mode_ = OVERWRITE;
}
else if (mode == "protect")
{
mode_ = PROTECT;
}
else if (mode == "warn")
{
mode_ = WARN;
}
else if (mode == "error")
{
mode_ = ERROR;
@ -79,7 +87,8 @@ void Foam::functionEntries::inputModeEntry::setMode(Istream& is)
else
{
WarningIn("Foam::functionEntries::inputModeEntry::setMode(Istream&)")
<< "unsupported input mode " << mode
<< "unsupported input mode '" << mode
<< "' ... defaulting to 'merge'"
<< endl;
}
}
@ -116,4 +125,15 @@ bool Foam::functionEntries::inputModeEntry::overwrite()
}
bool Foam::functionEntries::inputModeEntry::protect()
{
return mode_ == PROTECT;
}
bool Foam::functionEntries::inputModeEntry::error()
{
return mode_ == ERROR;
}
// ************************************************************************* //

View File

@ -37,8 +37,10 @@ Description
The possible input modes:
@param merge merge sub-dictionaries when possible
@param overwrite keep last entry and silently remove previous ones
@param error flag duplicate entry as an error
@param default currently the same as merge
@param protect keep initial entry and silently ignore subsequent ones
@param warn keep initial entry and warn about subsequent ones
@param error issue a FatalError for duplicate entries
@param default currently identical to merge
SourceFiles
inputModeEntry.C
@ -65,15 +67,17 @@ class inputModeEntry
:
public functionEntry
{
//- input mode options
//- The input mode options
enum inputMode
{
ERROR,
MERGE,
OVERWRITE
OVERWRITE,
PROTECT,
WARN,
ERROR
};
//- current input mode
//- The current input mode
static inputMode mode_;
@ -100,7 +104,7 @@ public:
//- Execute the functionEntry in a sub-dict context
static bool execute(dictionary& parentDict, Istream&);
//- Reset the inputMode to %default
//- Reset the inputMode to %default (ie, %merge)
static void clear();
//- Return true if the inputMode is %merge
@ -109,6 +113,12 @@ public:
//- Return true if the inputMode is %overwrite
static bool overwrite();
//- Return true if the inputMode is %protect
static bool protect();
//- Return true if the inputMode is %error
static bool error();
};

View File

@ -83,7 +83,7 @@ bool Foam::primitiveEntry::expandVariable
// lookup the variable name in the given dictionary....
const entry* ePtr = dict.lookupEntryPtr(varName, true, true);
// ...if defined insert its tokens into this
// ...if defined insert its tokens into this
if (ePtr != NULL)
{
append(ePtr->stream());
@ -91,7 +91,7 @@ bool Foam::primitiveEntry::expandVariable
}
else
{
// if not in the dictionary see if it is an environment
// if not in the dictionary see if it is an environment
// variable
string enVarString = getEnv(varName);
@ -123,7 +123,7 @@ bool Foam::primitiveEntry::read(const dictionary& dict, Istream& is)
{
is.fatalCheck
(
"primitiveEntry::readData(const dictionary& dict, Istream& is)"
"primitiveEntry::readData(const dictionary&, Istream&)"
);
label blockCount = 0;
@ -177,7 +177,7 @@ bool Foam::primitiveEntry::read(const dictionary& dict, Istream& is)
is.fatalCheck
(
"primitiveEntry::readData(const dictionary& dict, Istream& is)"
"primitiveEntry::readData(const dictionary&, Istream&)"
);
if (currToken.good())
@ -205,7 +205,7 @@ void Foam::primitiveEntry::readEntry(const dictionary& dict, Istream& is)
{
FatalIOErrorIn
(
"primitiveEntry::readEntry(const dictionary& dict,Istream& is)",
"primitiveEntry::readEntry(const dictionary&, Istream&)",
is
) << "ill defined primitiveEntry starting at keyword '"
<< keyword() << '\''
@ -266,7 +266,7 @@ void Foam::primitiveEntry::write(Ostream& os) const
os << token::SPACE;
}
}
os << token::END_STATEMENT << endl;
}
@ -297,7 +297,7 @@ Foam::Ostream& Foam::operator<<
{
os << " ...";
}
os << endl;
return os;

View File

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

View File

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

View File

@ -129,7 +129,7 @@ void Foam::processorLduInterface::compressedSend
const UList<Type>& f
) const
{
if (sizeof(scalar) != sizeof(float) && f.size() && Pstream::floatTransfer)
if (sizeof(scalar) != sizeof(float) && Pstream::floatTransfer && f.size())
{
static const label nCmpts = sizeof(Type)/sizeof(scalar);
label nm1 = (f.size() - 1)*nCmpts;
@ -199,7 +199,7 @@ void Foam::processorLduInterface::compressedReceive
UList<Type>& f
) const
{
if (sizeof(scalar) != sizeof(float) && f.size() && Pstream::floatTransfer)
if (sizeof(scalar) != sizeof(float) && Pstream::floatTransfer && f.size())
{
static const label nCmpts = sizeof(Type)/sizeof(scalar);
label nm1 = (f.size() - 1)*nCmpts;

View File

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

View File

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

View File

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

View File

@ -177,7 +177,7 @@ inline Cmpt det(const SphericalTensor<Cmpt>& st)
}
//- Return the inverse of a symmetric tensor
//- Return the inverse of a spherical tensor
template <class Cmpt>
inline SphericalTensor<Cmpt> inv(const SphericalTensor<Cmpt>& st)
{

View File

@ -256,7 +256,7 @@ inline Cmpt magSqr(const SymmTensor<Cmpt>& st)
}
//- Return the strace of a symmetric tensor
//- Return the trace of a symmetric tensor
template <class Cmpt>
inline Cmpt tr(const SymmTensor<Cmpt>& st)
{
@ -280,7 +280,7 @@ inline const SymmTensor<Cmpt>& symm(const SymmTensor<Cmpt>& st)
}
//- Return the stwice the symmetric part of a symmetric tensor
//- Return twice the symmetric part of a symmetric tensor
template <class Cmpt>
inline SymmTensor<Cmpt> twoSymm(const SymmTensor<Cmpt>& st)
{
@ -361,7 +361,7 @@ inline SymmTensor<Cmpt> inv(const SymmTensor<Cmpt>& st)
}
//- Return the 1spt invariant of a symmetric tensor
//- Return the 1st invariant of a symmetric tensor
template <class Cmpt>
inline Cmpt invariantI(const SymmTensor<Cmpt>& st)
{
@ -453,14 +453,9 @@ operator&(const SphericalTensor<Cmpt>& spt1, const SymmTensor<Cmpt>& st2)
{
return SymmTensor<Cmpt>
(
spt1.ii()*st2.xx(),
spt1.ii()*st2.xy(),
spt1.ii()*st2.xz(),
spt1.ii()*st2.yy(),
spt1.ii()*st2.yz(),
spt1.ii()*st2.zz()
spt1.ii()*st2.xx(), spt1.ii()*st2.xy(), spt1.ii()*st2.xz(),
spt1.ii()*st2.yy(), spt1.ii()*st2.yz(),
spt1.ii()*st2.zz()
);
}
@ -472,14 +467,9 @@ operator&(const SymmTensor<Cmpt>& st1, const SphericalTensor<Cmpt>& spt2)
{
return SymmTensor<Cmpt>
(
st1.xx()*spt2.ii(),
st1.xy()*spt2.ii(),
st1.xz()*spt2.ii(),
st1.yy()*spt2.ii(),
st1.yz()*spt2.ii(),
st1.zz()*spt2.ii()
st1.xx()*spt2.ii(), st1.xy()*spt2.ii(), st1.xz()*spt2.ii(),
st1.yy()*spt2.ii(), st1.yz()*spt2.ii(),
st1.zz()*spt2.ii()
);
}

View File

@ -25,7 +25,6 @@ License
\*---------------------------------------------------------------------------*/
#include "symmTensor.H"
#include "mathematicalConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,16 +64,16 @@ template<>
const symmTensor symmTensor::max
(
VGREAT, VGREAT, VGREAT,
VGREAT, VGREAT,
VGREAT
VGREAT, VGREAT,
VGREAT
);
template<>
const symmTensor symmTensor::min
(
-VGREAT, -VGREAT, -VGREAT,
-VGREAT, -VGREAT,
-VGREAT
-VGREAT, -VGREAT,
-VGREAT
);

View File

@ -402,7 +402,7 @@ inline SymmTensor<Cmpt> symm(const Tensor<Cmpt>& t)
}
//- Return the twice the symmetric part of a tensor
//- Return twice the symmetric part of a tensor
template <class Cmpt>
inline SymmTensor<Cmpt> twoSymm(const Tensor<Cmpt>& t)
{
@ -609,17 +609,9 @@ operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
{
return Tensor<Cmpt>
(
st1.ii()*t2.xx(),
st1.ii()*t2.xy(),
st1.ii()*t2.xz(),
st1.ii()*t2.yx(),
st1.ii()*t2.yy(),
st1.ii()*t2.yz(),
st1.ii()*t2.zx(),
st1.ii()*t2.zy(),
st1.ii()*t2.zz()
st1.ii()*t2.xx(), st1.ii()*t2.xy(), st1.ii()*t2.xz(),
st1.ii()*t2.yx(), st1.ii()*t2.yy(), st1.ii()*t2.yz(),
st1.ii()*t2.zx(), st1.ii()*t2.zy(), st1.ii()*t2.zz()
);
}
@ -631,17 +623,9 @@ operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2)
{
return Tensor<Cmpt>
(
t1.xx()*st2.ii(),
t1.xy()*st2.ii(),
t1.xz()*st2.ii(),
t1.yx()*st2.ii(),
t1.yy()*st2.ii(),
t1.yz()*st2.ii(),
t1.zx()*st2.ii(),
t1.zy()*st2.ii(),
t1.zz()*st2.ii()
t1.xx()*st2.ii(), t1.xy()*st2.ii(), t1.xz()*st2.ii(),
t1.yx()*st2.ii(), t1.yy()*st2.ii(), t1.yz()*st2.ii(),
t1.zx()*st2.ii(), t1.zy()*st2.ii(), t1.zz()*st2.ii()
);
}

View File

@ -51,13 +51,13 @@ namespace Foam
typedef Tensor<scalar> tensor;
vector eigenValues(const tensor& t);
vector eigenVector(const tensor& t, const scalar lambda);
tensor eigenVectors(const tensor& t);
vector eigenValues(const tensor&);
vector eigenVector(const tensor&, const scalar lambda);
tensor eigenVectors(const tensor&);
vector eigenValues(const symmTensor& t);
vector eigenVector(const symmTensor& t, const scalar lambda);
tensor eigenVectors(const symmTensor& t);
vector eigenValues(const symmTensor&);
vector eigenVector(const symmTensor&, const scalar lambda);
tensor eigenVectors(const symmTensor&);
//- Data associated with tensor type are contiguous
template<>

View File

@ -208,7 +208,7 @@ Foam::label Foam::scotchDecomp::decompose
//SCOTCH_graphMapCompute(&grafdat, &mapdat, &stradat); /* Perform mapping */
//SCOTCH_graphMapExit(&grafdat, &mapdat);
finalDecomp.setSize(xadj.size()-1);
finalDecomp = 0;
check
@ -217,7 +217,7 @@ Foam::label Foam::scotchDecomp::decompose
(
&grafdat,
&archdat,
&stradat, // const SCOTCH_Strat *
&stradat, // const SCOTCH_Strat *
finalDecomp.begin() // parttab
),
"SCOTCH_graphMap"
@ -231,7 +231,7 @@ Foam::label Foam::scotchDecomp::decompose
// (
// &grafdat,
// nProcessors_, // partnbr
// &stradat, // const SCOTCH_Strat *
// &stradat, // const SCOTCH_Strat *
// finalDecomp.begin() // parttab
// ),
// "SCOTCH_graphPart"

View File

@ -189,6 +189,7 @@ $(schemes)/outletStabilised/outletStabilised.C
$(schemes)/reverseLinear/reverseLinear.C
$(schemes)/clippedLinear/clippedLinear.C
$(schemes)/harmonic/harmonic.C
$(schemes)/fixedBlended/fixedBlended.C
$(schemes)/localBlended/localBlended.C
$(schemes)/localMax/localMax.C
$(schemes)/localMin/localMin.C
@ -207,7 +208,7 @@ $(limitedSchemes)/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationS
$(limitedSchemes)/upwind/upwind.C
$(limitedSchemes)/blended/blended.C
$(limitedSchemes)/linearUpwind/linearUpwind.C
$(limitedSchemes)/linearUpwindV/linearUpwindV.C
$(limitedSchemes)/linearUpwind/linearUpwindV.C
$(limitedSchemes)/Gamma/Gamma.C
$(limitedSchemes)/SFCD/SFCD.C
$(limitedSchemes)/Minmod/Minmod.C

View File

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

View File

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

View File

@ -34,7 +34,7 @@ void Foam::setRefCell
const dictionary& dict,
label& refCelli,
scalar& refValue,
bool forceReference
const bool forceReference
)
{
if (field.needReference() || forceReference)
@ -119,4 +119,15 @@ void Foam::setRefCell
}
Foam::scalar Foam::getRefCellValue
(
const volScalarField& field,
const label refCelli
)
{
scalar refCellValue = (refCelli >= 0 ? field[refCelli] : 0.0);
return returnReduce<label>(refCellValue, sumOp<scalar>());
}
// ************************************************************************* //

View File

@ -49,11 +49,18 @@ namespace Foam
// but which is not on a cyclic, symmetry or processor patch.
void setRefCell
(
const volScalarField&,
const dictionary&,
label& refCellI,
const volScalarField& field,
const dictionary& dict,
label& refCelli,
scalar& refValue,
bool forceReference = false
const bool forceReference = false
);
//- Return the current value of field in the reference cell
scalar getRefCellValue
(
const volScalarField& field,
const label refCelli
);
}

View File

@ -62,7 +62,7 @@ directMappedVelocityFluxFixedValueFvPatchField
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
phiName_(ptf.phiName_)
{
if (!isType<directMappedPatchBase>(this->patch().patch()))
if (!isA<directMappedPatchBase>(this->patch().patch()))
{
FatalErrorIn
(
@ -95,7 +95,7 @@ directMappedVelocityFluxFixedValueFvPatchField
fixedValueFvPatchVectorField(p, iF, dict),
phiName_(dict.lookup("phi"))
{
if (!isType<directMappedPatchBase>(this->patch().patch()))
if (!isA<directMappedPatchBase>(this->patch().patch()))
{
FatalErrorIn
(
@ -207,7 +207,7 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
allUValues
);
newUValues = patch().patchSlice(newUValues);
mapDistribute::distribute
(
Pstream::defaultCommsType,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,10 +27,34 @@ License
#include "fvSchemes.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
int Foam::fvSchemes::debug(Foam::debug::debugSwitch("fvSchemes", false));
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
void Foam::fvSchemes::clear()
{
ddtSchemes_.clear();
defaultDdtScheme_.clear();
d2dt2Schemes_.clear();
defaultD2dt2Scheme_.clear();
interpolationSchemes_.clear();
defaultInterpolationScheme_.clear();
divSchemes_.clear(); // optional
defaultDivScheme_.clear();
gradSchemes_.clear(); // optional
defaultGradScheme_.clear();
snGradSchemes_.clear();
defaultSnGradScheme_.clear();
laplacianSchemes_.clear(); // optional
defaultLaplacianScheme_.clear();
fluxRequired_.clear();
defaultFluxRequired_ = false;
cacheFields_.clear();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
@ -48,8 +72,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
ddtSchemes_
(
ITstream(objectPath() + "::ddtSchemes",
tokenList())()
ITstream
(
objectPath() + "::ddtSchemes",
tokenList()
)()
),
defaultDdtScheme_
(
@ -58,8 +85,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
d2dt2Schemes_
(
ITstream(objectPath() + "::d2dt2Schemes",
tokenList())()
ITstream
(
objectPath() + "::d2dt2Schemes",
tokenList()
)()
),
defaultD2dt2Scheme_
(
@ -68,8 +98,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
interpolationSchemes_
(
ITstream(objectPath() + "::interpolationSchemes",
tokenList())()
ITstream
(
objectPath() + "::interpolationSchemes",
tokenList()
)()
),
defaultInterpolationScheme_
(
@ -78,8 +111,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
divSchemes_
(
ITstream(objectPath() + "::divSchemes",
tokenList())()
ITstream
(
objectPath() + "::divSchemes",
tokenList()
)()
),
defaultDivScheme_
(
@ -88,8 +124,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
gradSchemes_
(
ITstream(objectPath() + "::gradSchemes",
tokenList())()
ITstream
(
objectPath() + "::gradSchemes",
tokenList()
)()
),
defaultGradScheme_
(
@ -98,8 +137,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
snGradSchemes_
(
ITstream(objectPath() + "::snGradSchemes",
tokenList())()
ITstream
(
objectPath() + "::snGradSchemes",
tokenList()
)()
),
defaultSnGradScheme_
(
@ -108,8 +150,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
laplacianSchemes_
(
ITstream(objectPath() + "::laplacianSchemes",
tokenList())()
ITstream
(
objectPath() + "::laplacianSchemes",
tokenList()
)()
),
defaultLaplacianScheme_
(
@ -118,14 +163,20 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
fluxRequired_
(
ITstream(objectPath() + "::fluxRequired",
tokenList())()
ITstream
(
objectPath() + "::fluxRequired",
tokenList()
)()
),
defaultFluxRequired_(false),
cacheFields_
(
ITstream(objectPath() + "::cacheFields",
tokenList())()
ITstream
(
objectPath() + "::cacheFields",
tokenList()
)()
)
{
read();
@ -140,6 +191,9 @@ bool Foam::fvSchemes::read()
{
const dictionary& dict = schemesDict();
// persistent settings across reads is incorrect
clear();
if (dict.found("ddtSchemes"))
{
ddtSchemes_ = dict.subDict("ddtSchemes");
@ -148,20 +202,23 @@ bool Foam::fvSchemes::read()
{
// For backward compatibility.
// The timeScheme will be deprecated with warning or removed
WarningIn("fvSchemes::read()")
<< "Using deprecated 'timeScheme' instead of 'ddtSchemes'"
<< nl << endl;
word timeSchemeName(dict.lookup("timeScheme"));
word schemeName(dict.lookup("timeScheme"));
if (timeSchemeName == "EulerImplicit")
if (schemeName == "EulerImplicit")
{
timeSchemeName = "Euler";
schemeName = "Euler";
}
else if (timeSchemeName == "BackwardDifferencing")
else if (schemeName == "BackwardDifferencing")
{
timeSchemeName = "backward";
schemeName = "backward";
}
else if (timeSchemeName == "SteadyState")
else if (schemeName == "SteadyState")
{
timeSchemeName = "steadyState";
schemeName = "steadyState";
}
else
{
@ -172,19 +229,14 @@ bool Foam::fvSchemes::read()
<< exit(FatalIOError);
}
if (ddtSchemes_.found("default"))
{
ddtSchemes_.remove("default");
}
ddtSchemes_.add("default", timeSchemeName);
ddtSchemes_.set("default", schemeName);
ddtSchemes_.lookup("default")[0].lineNumber() =
dict.lookup("timeScheme").lineNumber();
}
else
{
ddtSchemes_.add("default", "none");
ddtSchemes_.set("default", "none");
}
if
@ -205,31 +257,29 @@ bool Foam::fvSchemes::read()
{
// For backward compatibility.
// The timeScheme will be deprecated with warning or removed
WarningIn("fvSchemes::read()")
<< "Using deprecated 'timeScheme' instead of 'd2dt2Schemes'"
<< nl << endl;
word timeSchemeName(dict.lookup("timeScheme"));
word schemeName(dict.lookup("timeScheme"));
if (timeSchemeName == "EulerImplicit")
if (schemeName == "EulerImplicit")
{
timeSchemeName = "Euler";
schemeName = "Euler";
}
else if (timeSchemeName == "SteadyState")
else if (schemeName == "SteadyState")
{
timeSchemeName = "steadyState";
schemeName = "steadyState";
}
if (d2dt2Schemes_.found("default"))
{
d2dt2Schemes_.remove("default");
}
d2dt2Schemes_.add("default", timeSchemeName);
d2dt2Schemes_.set("default", schemeName);
d2dt2Schemes_.lookup("default")[0].lineNumber() =
dict.lookup("timeScheme").lineNumber();
}
else
{
d2dt2Schemes_.add("default", "none");
d2dt2Schemes_.set("default", "none");
}
if

View File

@ -84,8 +84,13 @@ class fvSchemes
// Private Member Functions
//- Disallow default bitwise copy construct and assignment
//- Clear the dictionaries and streams before reading
void clear();
//- Disallow default bitwise copy construct
fvSchemes(const fvSchemes&);
//- Disallow default bitwise assignment
void operator=(const fvSchemes&);

View File

@ -91,7 +91,7 @@ public:
FatalIOErrorIn
(
"extendedLeastSquaresGrad"
"(const fvMesh& mesh, Istream& schemeData)",
"(const fvMesh&, Istream& schemeData)",
schemeData
) << "Minimum determinant = " << minDet_
<< " should be >= 0 and <= 8"

View File

@ -67,7 +67,7 @@ class cellLimitedGrad
tmp<fv::gradScheme<Type> > basicGradScheme_;
//- Limiter coefficient
scalar k_;
const scalar k_;
// Private Member Functions
@ -98,7 +98,7 @@ public:
{
FatalIOErrorIn
(
"cellLimitedGrad(const fvMesh& mesh, Istream& schemeData)",
"cellLimitedGrad(const fvMesh&, Istream& schemeData)",
schemeData
) << "coefficient = " << k_
<< " should be >= 0 and <= 1"

View File

@ -21,7 +21,7 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "cellLimitedGrad.H"
@ -377,7 +377,7 @@ tmp<volTensorField> cellLimitedGrad<vector>::grad
);
}
}
if (fv::debug)
{
Info<< "gradient limiter for: " << vsf.name()

View File

@ -67,7 +67,7 @@ class cellMDLimitedGrad
tmp<fv::gradScheme<Type> > basicGradScheme_;
//- Limiter coefficient
scalar k_;
const scalar k_;
// Private Member Functions
@ -98,8 +98,7 @@ public:
{
FatalIOErrorIn
(
"cellMDLimitedGrad"
"(const fvMesh& mesh, Istream& schemeData)",
"cellMDLimitedGrad(const fvMesh&, Istream& schemeData)",
schemeData
) << "coefficient = " << k_
<< " should be >= 0 and <= 1"

View File

@ -21,7 +21,7 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "cellMDLimitedGrad.H"

View File

@ -67,7 +67,7 @@ class faceLimitedGrad
tmp<fv::gradScheme<Type> > basicGradScheme_;
//- Limiter coefficient
scalar k_;
const scalar k_;
// Private Member Functions
@ -107,7 +107,7 @@ public:
{
FatalIOErrorIn
(
"faceLimitedGrad(const fvMesh& mesh, Istream& schemeData)",
"faceLimitedGrad(const fvMesh&, Istream& schemeData)",
schemeData
) << "coefficient = " << k_
<< " should be >= 0 and <= 1"

View File

@ -67,7 +67,7 @@ class faceMDLimitedGrad
tmp<fv::gradScheme<Type> > basicGradScheme_;
//- Limiter coefficient
scalar k_;
const scalar k_;
// Private Member Functions
@ -107,7 +107,7 @@ public:
{
FatalIOErrorIn
(
"faceMDLimitedGrad(const fvMesh& mesh, Istream& schemeData)",
"faceMDLimitedGrad(const fvMesh&, Istream& schemeData)",
schemeData
) << "coefficient = " << k_
<< " should be >= 0 and <= 1"

View File

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

View File

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

View File

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

View File

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

View File

@ -472,22 +472,18 @@ void Foam::fvMatrix<Type>::setValues
}
// Set reference level for solution
template<class Type>
void Foam::fvMatrix<Type>::setReference
(
const label cell,
const label celli,
const Type& value,
const bool forceReference
)
{
if (psi_.needReference() || forceReference)
if (celli >= 0 && (psi_.needReference() || forceReference))
{
if (cell >= 0)
{
source()[cell] += diag()[cell]*value;
diag()[cell] += diag()[cell];
}
source()[celli] += diag()[celli]*value;
diag()[celli] += diag()[celli];
}
}

View File

@ -326,7 +326,7 @@ public:
//- Set reference level for solution
void setReference
(
const label cell,
const label celli,
const Type& value,
const bool forceReference = false
);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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