Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2011-03-25 14:44:39 +00:00
100 changed files with 1509 additions and 159 deletions

View File

@ -281,7 +281,7 @@
to provide an in-line functionObject. E.g.
#+BEGIN_SRC c++
functions
(
{
pAverage
{
functionObjectLibs ("libutilityFunctionObjects.so");
@ -293,7 +293,7 @@
Info<<"p avg:" << average(p) << endl;
#};
}
);
}
#+END_SRC
See also [[./doc/changes/dynamicCode.org]]

View File

@ -3,6 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory
set -x
wmake
wmake rhoLTSPimpleFoam
wmake rhoPorousMRFPimpleFoam
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,3 @@
rhoLTSPimpleFoam.C
EXE = $(FOAM_APPBIN)/rhoLTSPimpleFoam

View File

@ -0,0 +1,15 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,117 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
Application
rhoLTSPimpleFoam
Description
Transient solver for laminar or turbulent flow of compressible fluids
for HVAC and similar applications.
Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
pseudo-transient simulations with support for local time-stepping for
efficient steady-state solution.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "fvcSmooth.H"
#include "bound.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readPIMPLEControls.H"
#include "setInitialrDeltaT.H"
#include "createFields.H"
#include "initContinuityErrs.H"
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "setrDeltaT.H"
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
if (nOuterCorr != 1)
{
p.storePrevIter();
rho.storePrevIter();
}
#include "UEqn.H"
#include "hEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H"
}
turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,19 @@
scalar maxDeltaT
(
pimple.lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT
(
IOobject
(
"rDeltaT",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
zeroGradientFvPatchScalarField::typeName
);

View File

@ -0,0 +1,79 @@
{
scalar maxCo
(
pimple.lookupOrDefault<scalar>("maxCo", 0.8)
);
scalar rDeltaTSmoothingCoeff
(
pimple.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02)
);
scalar rDeltaTDampingCoeff
(
pimple.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
);
scalar maxDeltaT
(
pimple.lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT0 = rDeltaT;
// Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalField() = max
(
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(mag(phi))().dimensionedInternalField()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField())
);
if (transonic)
{
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf())
);
rDeltaT.dimensionedInternalField() = max
(
rDeltaT.dimensionedInternalField(),
fvc::surfaceSum(mag(phid))().dimensionedInternalField()
/((2*maxCo)*mesh.V()*psi.dimensionedInternalField())
);
}
// Update tho boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
if (rDeltaTSmoothingCoeff < 1.0)
{
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
}
Info<< "Smoothed flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
// Limit rate of change of time scale
// - reduce as much as required
// - only increase at a fraction of old time scale
if
(
rDeltaTDampingCoeff < 1.0
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
{
rDeltaT = rDeltaT0*max(rDeltaT/rDeltaT0, 1.0 - rDeltaTDampingCoeff);
Info<< "Damped flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
}
}

View File

@ -104,7 +104,7 @@
=functionObject=.
#+BEGIN_SRC c++
functions
(
{
pAverage
{
functionObjectLibs ("libutilityFunctionObjects.so");
@ -117,7 +117,7 @@
Info<<"p avg:" << average(p) << endl;
#};
}
);
}
#+END_SRC
This dynamic code framework uses the following entries
+ =codeData=: declaration (in .H file) of local (null-constructable) data
@ -233,7 +233,11 @@
- codedFixedValue could be extended to provide local data however
in terms of complexity this is not really worthwhile.
- all templates come from
=etc/codeTemplates/dynamicCode=
=~/.OpenFOAM/dev/codeTemplates/dynamicCode=
- all templates come from (in order of preference)
=FOAM_TEMPLATE_DIR=
=~/.OpenFOAM/dev/codeTemplates/dynamicCode=
=etc/codeTemplates/dynamicCode=
- any generated C++ code will display line numbers relative to the original
dictionary (using the '#line' directive) to ease finding compilation
errors.

View File

@ -1215,7 +1215,7 @@ Foam::fileNameList Foam::dlLoaded()
{
std::cout
<< "dlLoaded()"
<< " : determined loaded libraries :" << libs.size() << endl;
<< " : determined loaded libraries :" << libs.size() << std::endl;
}
return libs;
}

View File

@ -522,7 +522,7 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const
bool Foam::dynamicCode::wmakeLibso() const
{
const Foam::string wmakeCmd("wmake -s libso " + this->codeRelPath());
const Foam::string wmakeCmd("wmake -s libso " + this->codePath());
Info<< "Invoking " << wmakeCmd << endl;
if (Foam::system(wmakeCmd))

View File

@ -34,44 +34,57 @@ License
Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
:
dict_(dict),
code_(stringOps::trim(dict["code"])),
code_(),
localCode_(),
include_(),
options_(),
libs_()
{
// expand dictionary entries
stringOps::inplaceExpand(code_, dict);
{
const entry& codeEntry = dict.lookupEntry("code", false, false);
code_ = stringOps::trim(codeEntry.stream());
stringOps::inplaceExpand(code_, dict);
addLineDirective(code_, codeEntry.startLineNumber(), dict.name());
}
// note: removes any leading/trailing whitespace
// - necessary for compilation options, convenient for includes
// and body.
// optional
if (dict.found("localCode"))
const entry* includePtr = dict.lookupEntryPtr
(
"codeInclude",
false,
false
);
if (includePtr)
{
localCode_ = stringOps::trim(dict["localCode"]);
stringOps::inplaceExpand(localCode_, dict);
}
// optional
if (dict.found("codeInclude"))
{
include_ = stringOps::trim(dict["codeInclude"]);
include_ = stringOps::trim(includePtr->stream());
stringOps::inplaceExpand(include_, dict);
addLineDirective(include_, includePtr->startLineNumber(), dict.name());
}
// optional
if (dict.found("codeOptions"))
const entry* optionsPtr = dict.lookupEntryPtr
(
"codeOptions",
false,
false
);
if (optionsPtr)
{
options_ = stringOps::trim(dict["codeOptions"]);
options_ = stringOps::trim(optionsPtr->stream());
stringOps::inplaceExpand(options_, dict);
}
// optional
if (dict.found("codeLibs"))
const entry* libsPtr = dict.lookupEntryPtr("codeLibs", false, false);
if (libsPtr)
{
libs_ = stringOps::trim(dict["codeLibs"]);
libs_ = stringOps::trim(libsPtr->stream());
stringOps::inplaceExpand(libs_, dict);
}
@ -82,4 +95,17 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::dynamicCodeContext::addLineDirective
(
string& code,
const label lineNum,
const fileName& name
)
{
code = "#line " + Foam::name(lineNum) + " \"" + name + "\"\n" + code;
}
// ************************************************************************* //

View File

@ -51,6 +51,7 @@ namespace Foam
class dynamicCodeContext
{
// Private data
//- The parent dictionary context
const dictionary& dict_;
@ -123,6 +124,13 @@ public:
return sha1_;
}
//- Helper: add #line directive
static void addLineDirective
(
string&,
const label lineNum,
const fileName& name
);
};

View File

@ -241,10 +241,6 @@ void Foam::codedFixedValueFvPatchField<Type>::createLibrary
// Write files for new library
if (!dynCode.upToDate(context))
{
Info<< "Using dynamicCode for patch " << this->patch().name()
<< " on field " << this->dimensionedInternalField().name()
<< endl;
// filter with this context
dynCode.reset(context);
@ -271,7 +267,7 @@ void Foam::codedFixedValueFvPatchField<Type>::createLibrary
dynCode.setMakeOptions
(
"EXE_INC = -g \\\n"
"-I$(LIB_SRC)/finiteVolume/lnInclude\\\n"
"-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
+ context.options()
+ "\n\nLIB_LIBS = \\\n"
+ " -lOpenFOAM \\\n"
@ -343,6 +339,12 @@ void Foam::codedFixedValueFvPatchField<Type>::updateLibrary() const
return;
}
Info<< "Using dynamicCode for patch " << this->patch().name()
<< " on field " << this->dimensionedInternalField().name() << nl
<< "at line " << codeDict.startLineNumber()
<< " in " << codeDict.name() << endl;
// remove instantiation of fvPatchField provided by library
redirectPatchFieldPtr_.clear();

View File

@ -213,6 +213,14 @@ void Foam::meshRefinement::updateIntersections(const labelList& changedFaces)
}
}
// Extend segments a bit
{
const vectorField smallVec(Foam::sqrt(SMALL)*(end-start));
start += smallVec;
end -= smallVec;
}
// Do tests in one go
labelList surfaceHit;
{
@ -316,6 +324,14 @@ void Foam::meshRefinement::checkData()
}
}
// Extend segments a bit
{
const vectorField smallVec(Foam::sqrt(SMALL)*(end-start));
start += smallVec;
end -= smallVec;
}
// Do tests in one go
labelList surfaceHit;
{
@ -2247,6 +2263,14 @@ void Foam::meshRefinement::dumpIntersections(const fileName& prefix) const
}
}
// Extend segments a bit
{
const vectorField smallVec(Foam::sqrt(SMALL)*(end-start));
start += smallVec;
end -= smallVec;
}
// Do tests in one go
labelList surfaceHit;
List<pointIndexHit> surfaceHitInfo;

View File

@ -283,6 +283,13 @@ void Foam::meshRefinement::getBafflePatches
}
}
// Extend segments a bit
{
const vectorField smallVec(Foam::sqrt(SMALL)*(end-start));
start += smallVec;
end -= smallVec;
}
// Do test for intersections
// ~~~~~~~~~~~~~~~~~~~~~~~~~
@ -2447,6 +2454,13 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
}
}
// Extend segments a bit
{
const vectorField smallVec(Foam::sqrt(SMALL)*(end-start));
start += smallVec;
end -= smallVec;
}
// Do test for intersections
// ~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -626,6 +626,13 @@ Foam::label Foam::meshRefinement::markSurfaceRefinement
}
}
// Extend segments a bit
{
const vectorField smallVec(Foam::sqrt(SMALL)*(end-start));
start += smallVec;
end -= smallVec;
}
// Do test for higher intersections
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -835,6 +842,14 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
}
}
// Extend segments a bit
{
const vectorField smallVec(Foam::sqrt(SMALL)*(end-start));
start += smallVec;
end -= smallVec;
}
// Test for all intersections (with surfaces of higher max level than
// minLevel) and cache per cell the max surface level and the local normal
// on that surface.

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -72,14 +72,14 @@ Foam::Pair<Foam::vector> Foam::searchableSurfaceWithGaps::offsetVecs
}
offsets[0][minCmpt] = 1.0;
// Orthogonalise
// Orthonormalise
offsets[0] -= n[minCmpt]*n;
// Scale
offsets[0] *= gap_/mag(offsets[0]);
offsets[0] /= mag(offsets[0]);
// Do second offset vector perp to original edge and first offset vector
offsets[1] = n ^ offsets[0];
// Scale
offsets[0] *= gap_;
offsets[1] *= gap_;
}
@ -240,7 +240,7 @@ void Foam::searchableSurfaceWithGaps::findLine
// test in pairs: only if both perturbations hit something
// do we accept the hit.
const vectorField smallVec(SMALL*(compactEnd-compactStart));
const vectorField smallVec(1E-6*(compactEnd-compactStart));
List<pointIndexHit> plusInfo;
surface().findLine
@ -294,7 +294,7 @@ void Foam::searchableSurfaceWithGaps::findLine
offset0.setSize(plusMissMap.size());
offset1.setSize(plusMissMap.size());
const vectorField smallVec(SMALL*(compactEnd-compactStart));
const vectorField smallVec(1E-6*(compactEnd-compactStart));
surface().findLine
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -573,6 +573,9 @@ const Foam::indexedOctree<Foam::treeDataEdge>&
bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
scalar oldTol = indexedOctree<treeDataTriSurface>::perturbTol();
indexedOctree<treeDataEdge>::perturbTol() = tolerance_;
edgeTree_.reset
(
new indexedOctree<treeDataEdge>
@ -590,6 +593,8 @@ const Foam::indexedOctree<Foam::treeDataEdge>&
3.0 // duplicity
)
);
indexedOctree<treeDataEdge>::perturbTol() = oldTol;
}
return edgeTree_();
}

View File

@ -188,9 +188,6 @@ void Foam::codedFunctionObject::createLibrary
// Write files for new library
if (!dynCode.upToDate(context))
{
Info<< "Using dynamicCode for functionObject " << name()
<< endl;
// filter with this context
dynCode.reset(context);
@ -282,6 +279,11 @@ void Foam::codedFunctionObject::updateLibrary() const
return;
}
Info<< "Using dynamicCode for functionObject " << name()
<< " at line " << dict_.startLineNumber()
<< " in " << dict_.name() << endl;
// remove instantiation of fvPatchField provided by library
redirectFunctionObjectPtr_.clear();
@ -375,21 +377,60 @@ bool Foam::codedFunctionObject::read(const dictionary& dict)
{
dict.lookup("redirectType") >> redirectType_;
if (dict.found("codeRead"))
const entry* readPtr = dict.lookupEntryPtr
(
"codeRead",
false,
false
);
if (readPtr)
{
codeRead_ = stringOps::trim(dict["codeRead"]);
codeRead_ = stringOps::trim(readPtr->stream());
stringOps::inplaceExpand(codeRead_, dict);
dynamicCodeContext::addLineDirective
(
codeRead_,
readPtr->startLineNumber(),
dict.name()
);
}
if (dict.found("codeExecute"))
const entry* execPtr = dict.lookupEntryPtr
(
"codeExecute",
false,
false
);
if (execPtr)
{
codeExecute_ = stringOps::trim(dict["codeExecute"]);
codeExecute_ = stringOps::trim(execPtr->stream());
stringOps::inplaceExpand(codeExecute_, dict);
dynamicCodeContext::addLineDirective
(
codeExecute_,
execPtr->startLineNumber(),
dict.name()
);
}
if (dict.found("codeEnd"))
const entry* endPtr = dict.lookupEntryPtr
(
"codeEnd",
false,
false
);
if (execPtr)
{
codeEnd_ = stringOps::trim(dict["codeEnd"]);
codeEnd_ = stringOps::trim(endPtr->stream());
stringOps::inplaceExpand(codeEnd_, dict);
dynamicCodeContext::addLineDirective
(
codeEnd_,
endPtr->startLineNumber(),
dict.name()
);
}
updateLibrary();
return redirectFunctionObject().read(dict);
}

View File

@ -277,6 +277,8 @@ void Foam::sampledSurfaces::read(const dictionary& dict)
void Foam::sampledSurfaces::updateMesh(const mapPolyMesh&)
{
expire();
// pointMesh and interpolation will have been reset in mesh.update
}
@ -327,10 +329,6 @@ bool Foam::sampledSurfaces::expire()
}
}
// reset interpolation
pointMesh::Delete(mesh_);
volPointInterpolation::Delete(mesh_);
// true if any surfaces just expired
return justExpired;
}

View File

@ -12,6 +12,6 @@ runApplication setSet -batch makeBlockedFaceSet.setSet
runApplication PDRMesh
# Run
runApplication PDRFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -4,9 +4,6 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="XiFoam"
setControlDict()
{
controlDict="system/controlDict"
@ -32,7 +29,7 @@ cloneCase moriyoshiHomogeneous moriyoshiHomogeneousPart2
cp -r ../moriyoshiHomogeneous/0.005 .
setControlDict
runApplication $application
runApplication `getApplication`
)
# ----------------------------------------------------------------- end-of-file

View File

@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="chemFoam"
application=`getApplication`
runApplication $application

View File

@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="chemFoam"
application=`getApplication`
runApplication $application

View File

@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="chemFoam"
application=`getApplication`
runApplication $application

View File

@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="chemFoam"
application=`getApplication`
runApplication $application

View File

@ -10,6 +10,6 @@ runApplication setSet -batch makeFaceSet.setSet
runApplication createPatch -overwrite
# Run
runApplication fireFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -4,7 +4,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="fireFoam"
application=`getApplication`
runApplication blockMesh
runApplication setSet -batch makeFaceSet.setSet

View File

@ -4,9 +4,6 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name
application="rhoCentralFoam"
cases=" \
shockTube \
wedge15Ma5 \
@ -55,7 +52,7 @@ do
;;
esac
runApplication $application
runApplication `getApplication`
)
done

View File

@ -0,0 +1,54 @@
/*--------------------------------*- 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 T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 293;
boundaryField
{
front
{
type zeroGradient;
}
back
{
type zeroGradient;
}
wall
{
type zeroGradient;
}
porosityWall
{
type zeroGradient;
}
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type inletOutlet;
value $internalField;
inletValue $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- 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 (0 0 0);
boundaryField
{
front
{
type fixedValue;
value uniform (0 0 0);
}
back
{
type fixedValue;
value uniform (0 0 0);
}
wall
{
type fixedValue;
value uniform (0 0 0);
}
porosityWall
{
type slip;
value uniform (0 0 0);
}
inlet
{
type flowRateInletVelocity;
flowRate 0.1;
value uniform (0 0 0);
}
outlet
{
type fluxCorrectedVelocity; //inletOutlet;
value uniform (0 0 0);
inletValue uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- 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 alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
front
{
type alphatWallFunction;
value uniform 0;
}
back
{
type alphatWallFunction;
value uniform 0;
}
wall
{
type alphatWallFunction;
value uniform 0;
}
porosityWall
{
type alphatWallFunction;
value uniform 0;
}
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- 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 epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 200;
boundaryField
{
front
{
type compressible::epsilonWallFunction;
value uniform 200;
}
back
{
type compressible::epsilonWallFunction;
value uniform 200;
}
wall
{
type compressible::epsilonWallFunction;
value uniform 200;
}
porosityWall
{
type compressible::epsilonWallFunction;
value uniform 200;
}
inlet
{
type compressible::turbulentMixingLengthDissipationRateInlet;
mixingLength 0.005;
value uniform 200;
}
outlet
{
type inletOutlet;
inletValue uniform 200;
value uniform 200;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- 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 k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 1;
boundaryField
{
front
{
type compressible::kqRWallFunction;
value uniform 1;
}
back
{
type compressible::kqRWallFunction;
value uniform 1;
}
wall
{
type compressible::kqRWallFunction;
value uniform 1;
}
porosityWall
{
type compressible::kqRWallFunction;
value uniform 1;
}
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value uniform 1;
}
outlet
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- 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 mut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
front
{
type mutkWallFunction;
value uniform 0;
}
back
{
type mutkWallFunction;
value uniform 0;
}
wall
{
type mutkWallFunction;
value uniform 0;
}
porosityWall
{
type mutkWallFunction;
value uniform 0;
}
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- 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 [1 -1 -2 0 0 0 0];
internalField uniform 1.0e5;
boundaryField
{
front
{
type zeroGradient;
}
back
{
type zeroGradient;
}
wall
{
type zeroGradient;
}
porosityWall
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,9 @@
cd ${0%/*} || exit 1 # run from this directory
m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication `getApplication`

View File

@ -0,0 +1,25 @@
/*--------------------------------*- 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 kEpsilon;
turbulence on;
printCoeffs on;
// ************************************************************************* //

View File

@ -0,0 +1,165 @@
/*--------------------------------*- 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;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// block definition for a porosity with an angled inlet/outlet
// the porosity is not aligned with the main axes
//
dnl> -----------------------------------------------------------------
dnl> <STANDARD DEFINTIONS>
dnl>
changecom(//)changequote([,]) dnl>
define(calc, [esyscmd(perl -e 'print ($1)')]) dnl>
define(VCOUNT, 0) dnl>
define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl>
dnl>
define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl>
define(quad2D, ($1f $1b $2b $2f)) dnl>
define(frontQuad, ($1f $2f $3f $4f)) dnl>
define(backQuad, ($4b $3b $2b $1b)) dnl>
dnl>
dnl> </STANDARD DEFINTIONS>
dnl> -----------------------------------------------------------------
dnl>
define(ncells, 20) dnl>
define(ninlet, 15) dnl>
define(nporo, 20) dnl>
define(noutlet, 20) dnl>
dnl>
define(x0,0) dnl>
define(y0,0) dnl>
define(y0,0) dnl>
define(Cos,0.7071067812) dnl> == cos(45)
define(Sin,0.7071067812) dnl> == sin(45)
dnl>
define(width,50) dnl>
define(zBack,calc(-width/2)) dnl>
define(zFront,calc(width/2)) dnl>
define(leninlet,150)dnl>
define(lenporo,100)dnl>
define(lenoutlet,100)dnl>
dnl>
define(xhyp,calc(Sin*width)) dnl>
define(yhyp,calc(Cos*width)) dnl>
define(xinlet,leninlet)dnl>
define(xporo,calc(Cos*lenporo)) dnl>
define(yporo,calc(Sin*lenporo)) dnl>
define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
dnl>
convertToMeters 0.001;
vertices
(
// inlet region
( -xinlet y0 zBack ) vlabel(in1b)
( -xinlet yhyp zBack ) vlabel(in2b)
( -xinlet y0 zFront ) vlabel(in1f)
( -xinlet yhyp zFront ) vlabel(in2f)
// join inlet->outlet
( x0 y0 zBack ) vlabel(join1b)
( -xhyp yhyp zBack ) vlabel(join2b)
( x0 y0 zFront ) vlabel(join1f)
( -xhyp yhyp zFront ) vlabel(join2f)
// porosity ends ->outlet
( xporo yporo zBack ) vlabel(poro1b)
( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b)
( xporo yporo zFront ) vlabel(poro1f)
( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f)
// outlet
( xoutlet youtlet zBack ) vlabel(out1b)
( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b)
( xoutlet youtlet zFront ) vlabel(out1f)
( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f)
);
blocks
(
// inlet block
hex2D(in1, join1, join2, in2)
inlet ( ninlet ncells ncells ) simpleGrading (1 1 1)
// porosity block
hex2D(join1, poro1, poro2, join2)
porosity ( nporo ncells ncells ) simpleGrading (1 1 1)
// outlet block
hex2D(poro1, out1, out2, poro2)
outlet ( noutlet ncells ncells ) simpleGrading (1 1 1)
);
edges
(
);
patches
(
// is there no way of defining all my 'defaultFaces' to be 'wall'?
wall front
(
// inlet block
frontQuad(in1, join1, join2, in2)
// outlet block
frontQuad(poro1, out1, out2, poro2)
)
wall back
(
// inlet block
backQuad(in1, join1, join2, in2)
// outlet block
backQuad(poro1, out1, out2, poro2)
)
wall wall
(
// inlet block
quad2D(in1, join1)
quad2D(join2, in2)
// outlet block
quad2D(poro1, out1)
quad2D(out2, poro2)
)
wall porosityWall
(
// porosity block
frontQuad(join1, poro1, poro2, join2)
// porosity block
backQuad(join1, poro1, poro2, join2)
// porosity block
quad2D(join1, poro1)
quad2D(poro2, join2)
)
patch inlet
(
quad2D(in2, in1)
)
patch outlet
(
quad2D(out2, out1)
)
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*--------------------------------*- 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;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
6
(
front
{
type wall;
nFaces 700;
startFace 63400;
}
back
{
type wall;
nFaces 700;
startFace 64100;
}
wall
{
type wall;
nFaces 1400;
startFace 64800;
}
porosityWall
{
type wall;
nFaces 1600;
startFace 66200;
}
inlet
{
type patch;
nFaces 400;
startFace 67800;
}
outlet
{
type patch;
nFaces 400;
startFace 68200;
}
)
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- 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 porousZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1
(
porosity
{
coordinateSystem
{
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
Darcy
{
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
}
}
)
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*--------------------------------*- 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 thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>;
mixture
{
nMoles 1;
molWeight 28.9;
Cp 1007;
Hf 0;
As 1.4792e-06;
Ts 116;
}
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- 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 turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RASModel;
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- 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 rhoLTSPimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 500;
deltaT 1;
writeControl adjustableRunTime;
writeInterval 50;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //

View File

@ -0,0 +1,76 @@
/*--------------------------------*- 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 localEuler rDeltaT;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss upwind;
div(phid,p) Gauss upwind;
div(phiU,p) Gauss linear;
div(phi,h) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind;
div(phi,omega) Gauss upwind;
div((rho*R)) Gauss linear;
div(R) Gauss linear;
div(U) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(muEff,U) Gauss linear corrected;
laplacian(mut,U) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(DomegaEff,omega) Gauss linear corrected;
laplacian((rho*(1|A(U))),p) Gauss linear corrected;
laplacian(alphaEff,h) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
/*--------------------------------*- 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 PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.1;
}
pFinal
{
$p;
tolerance 1e-06;
relTol 0.1;
}
"(rho|U|h|k|epsilon|omega)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
}
"(rho|U|h|k|epsilon|omega)Final"
{
$U;
tolerance 1e-05;
relTol 0.1;
}
}
PIMPLE
{
momentumPredictor yes;
nOuterCorrectors 1;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
rhoMin rhoMin [ 1 -3 0 0 0 ] 0.5;
rhoMax rhoMax [ 1 -3 0 0 0 ] 2.0;
maxCo 0.8;
rDeltaTSmoothingCoeff 0.02;
rDeltaTDampingCoeff 1;
maxDeltaT 1;
}
// ************************************************************************* //

View File

@ -6,5 +6,4 @@ m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication rhoPimpleFoam
runApplication `getApplication`

View File

@ -1,3 +1,4 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
@ -5,6 +6,9 @@ m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication rhoPorousSimpleFoam
application=`getApplication`
runApplication blockMesh
runApplication $application
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,21 @@
/*--------------------------------*- 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 MRFZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
0
()
// ************************************************************************* //

View File

@ -8,7 +8,7 @@
FoamFile
{
version 2.0;
format binary;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;

View File

@ -4,9 +4,6 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="sonicLiquidFoam"
setDecompressionTankFine()
{
blockMeshDict="constant/polyMesh/blockMeshDict"
@ -42,7 +39,7 @@ cloneCase decompressionTank decompressionTankFine
# And execute
runApplication blockMesh
runApplication $application
runApplication `getApplication`
)
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,52 @@
Fields are used by dsmcFoam in several ways, some of which are different to
their use elsewhere in OpenFOAM. None of these fields are solved by partial
differential equations, they are used either to record simulation data, or to
supply boundary data.
In each case there are 11 fields:
boundaryT, boundaryU:
The wall and free stream conditions at the boundary are specified for
velocity and temperature with these fields - only the data on the
patches is used, the cell data is not. These are the only two fields
which supply data to the case.
dsmcRhoN:
The population of dsmc particles in cells is recorded to visualise how
well the cell population conditions required for dsmc are met. The
boundary conditions are zeroGradient because only cell data is
meaningful.
fD, q:
The wall heat flux (q) and force density (fD, i.e. stress vector) is
recorded with these fields - only the data on wall patches is relevant,
the cell data is not.
iDof, internalE, linearKE, momentum, rhoM, rhoN:
These fields are the densities of extensive quantities in the
simulation, i.e. of number, mass, momentum, energy. Cell data is
recorded in the internal field and the boundaryField is used to record
the data of particles that strike wall patches. The properties of
particles striking wall faces are weighted by 1/(Un*fA), where Un is the
normal component of the particle's velocity and fA is the face area.
This is done so that when intensive quantities, such as velocity or
temperature, are evaluated on the wall the values are correct this
allows velocity slip and temperature jump to be evaluated.
Therefore, the data in these fields on wall patches is of a different
type to the volume data. This may cause problems when post-processing,
as any interpolation of these fields will have a artifacts in the near
wall cells because the values on the faces are radically different.
This can be overcome by visualising the data uninterpolated, or by
copying the fields and setting zeroGradient boundary conditions on
walls. Calculated intensive fields do not have this issue.
Further fields are produced by dsmcFoam, i.e. dsmcSigmaTcRMax (used in the
selection of collision partners) and by the fieldAverage (averaging the
extensive quantity densities) and dsmcFields (calculating intensive quantities,
i.e. velocity and temperature, from extensive quantities) function objects in
each case as it runs.

View File

@ -6,6 +6,6 @@ cd ${0%/*} || exit 1 # run from this directory
runApplication blockMesh
runApplication dsmcInitialise
runApplication dsmcFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -6,6 +6,6 @@ cd ${0%/*} || exit 1 # run from this directory
runApplication blockMesh
runApplication dsmcInitialise
runApplication dsmcFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -8,7 +8,6 @@ runApplication blockMesh
runApplication decomposePar
runParallel dsmcInitialise 4
runParallel dsmcFoam 4
runApplication reconstructPar -noLagrangian
runApplication `getApplication` -noLagrangian
# ----------------------------------------------------------------- end-of-file

View File

@ -7,7 +7,7 @@ cd ${0%/*} || exit 1 # run from this directory
runApplication blockMesh
runApplication decomposePar
runParallel dsmcInitialise 4
runParallel dsmcFoam 4
runParallel `getApplication` 4
runApplication reconstructPar -noLagrangian

View File

@ -5,8 +5,6 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
application="mdEquilibrationFoam"
for caseName in periodicCubeArgon periodicCubeWater
do
(
@ -14,7 +12,7 @@ do
runApplication blockMesh
runApplication mdInitialise
runApplication $application
runApplication `getApplication`
)
done
# ----------------------------------------------------------------- end-of-file

View File

@ -4,11 +4,7 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
(
cd hartmann || exit
cleanCase
cleanSamples
)
cleanCase
cleanSamples
# ----------------------------------------------------------------- end-of-file

View File

@ -5,15 +5,11 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="mhdFoam"
application=`getApplication`
(
cd hartmann || exit
runApplication blockMesh
runApplication $application
runApplication foamCalc components U
runApplication sample
)
runApplication blockMesh
runApplication $application
runApplication foamCalc components U
runApplication sample
# ----------------------------------------------------------------- end-of-file

View File

@ -6,6 +6,6 @@ cd ${0%/*} || exit 1 # run from this directory
runApplication blockMesh
runApplication snappyHexMesh -overwrite
runApplication buoyantBoussinesqSimpleFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="buoyantSimpleFoam"
application=`getApplication`
runApplication blockMesh
runApplication $application

View File

@ -28,7 +28,7 @@ done
#-- Run on single processor
#runApplication chtMultiRegionFoam
#runApplication `getApplication`
# Decompose
for i in bottomAir topAir heater leftSolid rightSolid
@ -37,7 +37,7 @@ do
done
# Run
runParallel chtMultiRegionFoam 4
runParallel `getApplication` 4
# Reconstruct
for i in bottomAir topAir heater leftSolid rightSolid

View File

@ -37,7 +37,7 @@ do
done
# Run
runParallel chtMultiRegionFoam 4
runParallel `getApplication` 4
# Reconstruct
for i in bottomWater topAir heater leftSolid rightSolid

View File

@ -30,7 +30,7 @@ done
#-- Run on single processor
runApplication chtMultiRegionFoam
runApplication `getApplication`
## Decompose
@ -40,7 +40,7 @@ runApplication chtMultiRegionFoam
#done
#
## Run
#runParallel chtMultiRegionFoam 4
#runParallel `getApplication` 4
#
## Reconstruct
#for i in bottomAir topAir heater leftSolid rightSolid

View File

@ -28,7 +28,7 @@ done
#-- Run on single processor
runApplication chtMultiRegionSimpleFoam
runApplication `getApplication`
## Decompose
#for i in bottomAir topAir heater leftSolid rightSolid
@ -37,7 +37,7 @@ runApplication chtMultiRegionSimpleFoam
#done
#
## Run
#runParallel chtMultiRegionSimpleFoam 4
#runParallel `getApplication` 4
#
## Reconstruct
#for i in bottomAir topAir heater leftSolid rightSolid

View File

@ -40,7 +40,7 @@ done
#-- Run on single processor
runApplication chtMultiRegionSimpleFoam
runApplication `getApplication`
## Decompose
#for i in bottomAir topAir heater leftSolid rightSolid
@ -49,7 +49,7 @@ runApplication chtMultiRegionSimpleFoam
#done
#
## Run
#runParallel chtMultiRegionSimpleFoam 4
#runParallel `getApplication` 4
#
## Reconstruct
#for i in bottomAir topAir heater leftSolid rightSolid

View File

@ -17,7 +17,7 @@ do
sed "s/XXX/$e/g" constant/transportProperties.template \
> constant/transportProperties
runApplication boundaryFoam
runApplication `getApplication`
mv log.boundaryFoam log.boundaryFoam_$e

View File

@ -4,9 +4,6 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name
application="icoFoam"
cavityCases="cavity cavityFine cavityGrade cavityHighRe cavityClipped"
runMapFields()
@ -97,7 +94,7 @@ do
esac
previousCase="$caseName"
( cd $caseName && runApplication $application )
( cd $caseName && runApplication `getApplication` )
done
# elbow case for testing Fluent-FOAM conversion tools
@ -107,7 +104,7 @@ runFluentMeshToFoam elbow elbow/elbow.msh
(
cd elbow || exit
runApplication $application
runApplication `getApplication`
runApplication foamMeshToFluent
runApplication foamDataToFluent
)

View File

@ -23,7 +23,7 @@ cp -r 0.org 0
runApplication mapFields ../wingMotion2D_simpleFoam -sourceTime latestTime -consistent
mv 0/pointDisplacement.unmapped 0/pointDisplacement
runApplication decomposePar
runParallel pimpleDyMFoam 3
runParallel `getApplication` 3
runApplication reconstructPar
# ----------------------------------------------------------------- end-of-file

View File

@ -6,5 +6,5 @@ m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication porousSimpleFoam
runApplication `getApplication`

View File

@ -12,4 +12,4 @@ sed -i 's/\(nNonOrthogonalCorrectors\).*;/\1 10;/g' system/fvSolution
runApplication potentialFoam -writep
sed -i 's/\(nNonOrthogonalCorrectors\).*;/\1 0;/g' system/fvSolution
runApplication simpleFoam
runApplication `getApplication`

View File

@ -11,7 +11,7 @@ runApplication decomposePar
#runApplication snappyHexMesh -overwrite
#runApplication setSet -batch makeZones
#runApplication setsToZones -noFlipMap
#runApplication windSimpleFoam
#runApplication `getApplication`
cp system/decomposeParDict-par system/decomposeParDict
runParallel snappyHexMesh 2 -overwrite
@ -31,7 +31,7 @@ runParallel renumberMesh 4 -overwrite
#runParallel changeDictionary 4 -literalRE
runParallel setSet 4 -batch makeZones
runParallel simpleWindFoam 4
runParallel `getApplication` 4
runApplication reconstructParMesh -constant
runApplication reconstructPar

View File

@ -8,4 +8,4 @@ cd ${0%/*} || exit 1 # run from this directory
runApplication blockMesh
# run the solver
runApplication LTSReactingParcelFoam
runApplication `getApplication`

View File

@ -8,6 +8,6 @@ cd ${0%/*} || exit 1 # run from this directory
runApplication blockMesh
# run the solver
runApplication LTSReactingParcelFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -12,6 +12,6 @@ runApplication potentialFoam
rm -f 0/phi
# run the solver
runApplication porousExplicitSourceReactingParcelFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -3,4 +3,4 @@
./Allrun.pre
runApplication reactingParcelFilmFoam
runApplication `getApplication`

View File

@ -6,4 +6,4 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
./Allrun.pre
runApplication reactingParcelFilmFoam
runApplication `getApplication`

View File

@ -10,7 +10,7 @@ cd ${0%/*} || exit 1 # run from this directory
decomposePar -region wallFilmRegion > log.decomposePar.wallFilmRegion 2>&1
decomposePar > log.decomposePar.primaryRegion 2>&1
runParallel reactingParcelFilmFoam 4
runParallel `getApplication` 4
reconstructPar -region wallFilmRegion > log.reconstructPar.wallFilmRegion 2>&1
reconstructPar > log.reconstructPar.primaryRegion 2>&1

View File

@ -3,4 +3,4 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions
./Allrun.pre
runApplication reactingParcelFilmFoam
runApplication `getApplication`

View File

@ -7,7 +7,7 @@
decomposePar -region wallFilmRegion > log.decomposePar.wallFilmRegion 2>&1
decomposePar > log.decomposePar.primaryRegion 2>&1
runParallel reactingParcelFilmFoam 4
runParallel `getApplication` 4
reconstructPar -region wallFilmRegion > log.reconstructPar.wallFilmRegion 2>&1
reconstructPar > log.reconstructPar.primaryRegion 2>&1

View File

@ -3,4 +3,4 @@
./Allrun.pre
runApplication reactingParcelFilmFoam
runApplication `getApplication`

View File

@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="moveDynamicMesh"
application=`getApplication`
runApplication blockMesh
runApplication topoSet

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interDyMFoam;
application moveDynamicMesh;
startFrom startTime;

View File

@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="cavitatingFoam"
application=`getApplication`
refineMeshByCellSet()
{

View File

@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="cavitatingFoam"
application=`getApplication`
refineMeshByCellSet()
{

View File

@ -9,6 +9,6 @@ runApplication blockMesh
runApplication setSet -batch createObstacle.setSet
runApplication subsetMesh -overwrite c0 -patch walls
runApplication setFields
runApplication interDyMFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="interDyMFoam"
application=`getApplication`
runApplication blockMesh
runApplication topoSet

View File

@ -8,6 +8,6 @@ m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
runApplication blockMesh
cp 0/alpha1.org 0/alpha1
runApplication setFields
runApplication interDyMFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -8,6 +8,6 @@ m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
runApplication blockMesh
cp 0/alpha1.org 0/alpha1
runApplication setFields
runApplication interDyMFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -8,6 +8,6 @@ m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
runApplication blockMesh
cp 0/alpha1.org 0/alpha1
runApplication setFields
runApplication interDyMFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -8,6 +8,6 @@ m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
runApplication blockMesh
cp 0/alpha1.org 0/alpha1
runApplication setFields
runApplication interDyMFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -8,6 +8,6 @@ m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
runApplication blockMesh
cp 0/alpha1.org 0/alpha1
runApplication setFields
runApplication interDyMFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -7,6 +7,6 @@ cd ${0%/*} || exit 1 # run from this directory
runApplication blockMesh
cp 0/alpha1.org 0/alpha1
runApplication setFields
runApplication interDyMFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -4,9 +4,6 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="interFoam"
setDamBreakFine ()
{
blockMeshDict="constant/polyMesh/blockMeshDict"
@ -33,7 +30,7 @@ setDamBreakFine ()
runApplication blockMesh
cp 0/alpha1.org 0/alpha1
runApplication setFields
runApplication $application
runApplication `getApplication`
)
# Clone case
@ -50,7 +47,7 @@ cloneCase damBreak damBreakFine
cp ../damBreak/0/alpha1.org 0/alpha1
runApplication setFields
runApplication decomposePar
runParallel $application 4
runParallel `getApplication` 4
runApplication reconstructPar
)
@ -61,7 +58,7 @@ cloneCase damBreak damBreakFine
runApplication blockMesh
cp 0/alpha1.org 0/alpha1
runApplication setFields
runApplication $application
runApplication `getApplication`
)
# ----------------------------------------------------------------- end-of-file

View File

@ -4,9 +4,6 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="interFoam"
setDamBreakFine ()
{
blockMeshDict="constant/polyMesh/blockMeshDict"
@ -42,7 +39,7 @@ cloneCase damBreak damBreakFine
runApplication blockMesh
runApplication setFields
runApplication decomposePar
runParallel $application 4
runParallel `getApplication` 4
runApplication reconstructPar
)

View File

@ -9,6 +9,6 @@ cp 0/alpha1.org 0/alpha1
cp 0/alpha2.org 0/alpha2
cp 0/alpha3.org 0/alpha3
runApplication setFields
runApplication interMixingFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interFoam;
application interMixingFoam;
startFrom startTime;

View File

@ -11,6 +11,6 @@ runApplication blockMesh
runApplication snappyHexMesh -overwrite
# Run the solver
runApplication interPhaseChangeFoam
runApplication `getApplication`
# ----------------------------------------------------------------- end-of-file

View File

@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="multiphaseInterFoam"
application=`getApplication`
runApplication blockMesh
runApplication setFields

View File

@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="multiphaseInterFoam"
application=`getApplication`
runApplication blockMesh
runApplication setFields