Merge commit 'OpenCFD/master' into olesenm

This commit is contained in:
Mark Olesen
2008-07-01 13:01:09 +02:00
98 changed files with 3017 additions and 2998 deletions

6
.gitignore vendored
View File

@ -16,6 +16,7 @@
*.la
*.so
*.jar
lex.yy.c
# Corefiles
core
@ -27,10 +28,13 @@ core
lnInclude
# linux build folder(s) - anywhere
linux*Gcc*[SD]POpt*
linux*Gcc*
# reinstate wmake/rules that look like build folders
!wmake/rules/linux*
# but do ignore the derived files in there
wmake/rules/linux*/dirToString
wmake/rules/linux*/wmkdep
# doxygen generated documentation
doc/[Dd]oxygen/html

View File

@ -58,7 +58,7 @@
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
dimensionedScalar pRef("pRef", p.dimensions(), 1.0e5);
dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
Info<< "Creating field pd\n" << endl;
volScalarField pd
@ -67,10 +67,14 @@
(
"pd",
runTime.timeName(),
mesh
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
p - rho*gh - pRef,
p.boundaryField().types()
mesh
);
p = pd + rho*gh + pRef;
thermo->correct();
dimensionedScalar initialMass = fvc::domainIntegrate(rho);

View File

@ -1,8 +1,5 @@
bool closedVolume = pd.needReference();
//pd.boundaryField() ==
// p.boundaryField() - rho.boundaryField()*gh.boundaryField() - pRef.value();
rho = thermo->rho();
volScalarField rUA = 1.0/UEqn.A();

View File

@ -54,8 +54,7 @@
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
dimensionedScalar pRef("pRef", p.dimensions(), 1.0e5);
dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
Info<< "Creating field pd\n" << endl;
volScalarField pd
@ -64,16 +63,26 @@
(
"pd",
runTime.timeName(),
mesh
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
p - rho*gh - pRef,
p.boundaryField().types()
mesh
);
p = pd + rho*gh + pRef;
thermo->correct();
label pdRefCell = 0;
scalar pdRefValue = 0.0;
setRefCell(pd, mesh.solutionDict().subDict("SIMPLE"), pdRefCell, pdRefValue);
setRefCell
(
pd,
mesh.solutionDict().subDict("SIMPLE"),
pdRefCell,
pdRefValue
);
dimensionedScalar initialMass = fvc::domainIntegrate(rho);

View File

@ -1,6 +1,3 @@
pd.boundaryField() ==
p.boundaryField() - rho.boundaryField()*gh.boundaryField() - pRef.value();
volScalarField rUA = 1.0/UEqn().A();
U = rUA*UEqn().H();
UEqn.clear();

View File

@ -55,8 +55,7 @@
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
dimensionedScalar pRef("pRef", p.dimensions(), 1.0e5);
dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
Info<< "Creating field pd\n" << endl;
volScalarField pd
@ -65,12 +64,16 @@
(
"pd",
runTime.timeName(),
mesh
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
p - rho*gh - pRef,
p.boundaryField().types()
mesh
);
p = pd + rho*gh + pRef;
thermo->correct();
label pdRefCell = 0;
scalar pdRefValue = 0.0;

View File

@ -1,6 +1,3 @@
pd.boundaryField() ==
p.boundaryField() - rho.boundaryField()*gh.boundaryField() - pRef.value();
volScalarField rUA = 1.0/UEqn().A();
U = rUA*UEqn().H();
UEqn.clear();

View File

@ -11,7 +11,12 @@
List<scalar> initialMassf(fluidRegions.size());
dimensionedScalar pRef("pRef", dimensionSet(1, -1, -2, 0, 0), 1.0E5);
dimensionedScalar pRef
(
"pRef",
dimensionSet(1, -1, -2, 0, 0),
rp.lookup("pRef")
);
// Populate fluid field pointer lists
forAll(fluidRegions, i)
@ -173,7 +178,7 @@
Info<< " Updating p from pd\n" << endl;
thermof[i].p() == pdf[i] + rhof[i]*ghf[i] + pRef;
thermof[i].correct();
initialMassf[i] = fvc::domainIntegrate(rhof[i]).value();
}

View File

@ -1,11 +1,6 @@
{
bool closedVolume = false;
//pdf[i].boundaryField() ==
// thermof[i].p().boundaryField()
// - rhof[i].boundaryField()*ghf[i].boundaryField()
// - pRef.value();
rhof[i] = thermof[i].rho();
volScalarField rUA = 1.0/UEqn().A();
@ -15,11 +10,11 @@
fvc::interpolate(rhof[i])
*(
(fvc::interpolate(Uf[i]) & fluidRegions[i].Sf())
// + fvc::ddtPhiCorr(rUA, rhof[i], Uf[i], phif[i])
+ fvc::ddtPhiCorr(rUA, rhof[i], Uf[i], phif[i])
)
- fvc::interpolate(rhof[i]*rUA*ghf[i])
*fvc::snGrad(rhof[i])
*fluidRegions[i].magSf();
*fvc::snGrad(rhof[i])
*fluidRegions[i].magSf();
// Solve pressure difference
# include "pdEqn.H"
@ -55,8 +50,7 @@
initialMassf[i]
)
- fvc::domainIntegrate(thermof[i].psi()*thermof[i].p())
)
/fvc::domainIntegrate(thermof[i].psi());
)/fvc::domainIntegrate(thermof[i].psi());
rhof[i] = thermof[i].rho();
}

View File

@ -37,7 +37,7 @@
mesh
);
# include "compressibleCreatePhi.H"
#include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
@ -53,7 +53,7 @@
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
dimensionedScalar pRef("pRef", p.dimensions(), 0.0);
dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
Info<< "Creating field pd\n" << endl;
volScalarField pd
@ -69,7 +69,7 @@
mesh
);
//pd = p - rho*gh - pRef;
p = pd + rho*gh + pRef;
thermo->correct();
dimensionedScalar initialMass = fvc::domainIntegrate(rho);

View File

@ -0,0 +1,6 @@
#!/bin/sh
set -x
wclean libso extrudeModel
wclean

View File

@ -0,0 +1,6 @@
#!/bin/sh
set -x
wmake libso extrudeModel
wmake

View File

@ -1,3 +1,4 @@
extrudeMesh.C
EXE = $(FOAM_APPBIN)/extrudeMesh

View File

@ -1,8 +1,11 @@
EXE_INC = \
-IextrudedMesh \
-IextrudeModel/lnInclude \
-I$(FOAM_SRC)/meshTools/lnInclude \
-I$(FOAM_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \
-lmeshTools \
-ldynamicMesh
-ldynamicMesh \
-lextrudeModel

View File

@ -3,6 +3,6 @@
Time runTimeExtruded
(
Time::controlDictName,
rootDirTarget,
caseDirTarget
args.rootPath(),
args.caseName()
);

View File

@ -23,39 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Extrude mesh from existing patch or from patch read from file. Merges close
points so be careful.
Extrude mesh from existing patch or from patch read from file.
Note: Merges close points so be careful.
Can do wedges:
- use wedgeExtruder instead of e.g. linearNormalExtruder
- extrusion is opposite the surface/patch normal so inwards the source
mesh
- axis direction has to be consistent with this.
- use -mergeFaces option if doing full 360 and want to merge front and back
E.g. starting from 'movingWall' patch of cavity tutorial:
- we want to rotate around the left side of this patch (is at x=0,y=0.1)
for a full 360 degrees:
wedgeExtruder
(
point(0,0.1,0), // point on axis
vector(0,0,-1), // (normalized!) direction of axis
360.0/180.0*mathematicalConstant::pi // angle
)
- note direction of axis. This should be consistent with rotating against
the patch normal direction. If you get it wrong you'll see all cells
with extreme aspect ratio and internal faces wrong way around in
checkMesh
- call with e.g. 10 layers. Thickness argument (0.1) is not used!
extrudeMesh <root> <case> 10 0.1 \
-sourceRoot $FOAM_TUTORIALS/icoFoam \
-sourceCase cavity \
-sourcePatch movingWall
-mergeFaces
Type of extrusion prescribed by run-time selectable model.
\*---------------------------------------------------------------------------*/
@ -72,10 +43,7 @@ Description
#include "perfectInterface.H"
#include "extrudedMesh.H"
#include "linearNormalExtruder.H"
#include "linearRadialExtruder.H"
#include "sigmaRadialExtruder.H"
#include "wedgeExtruder.H"
#include "extrudeModel.H"
using namespace Foam;
@ -99,6 +67,23 @@ int main(int argc, char *argv[])
autoPtr<extrudedMesh> meshPtr(NULL);
autoPtr<extrudeModel> model
(
extrudeModel::New
(
IOdictionary
(
IOobject
(
"extrudeProperties",
runTimeExtruded.constant(),
runTimeExtruded,
IOobject::MUST_READ
)
)
)
);
if (args.options().found("sourceRoot"))
{
fileName rootDirSource(args.options()["sourceRoot"]);
@ -115,7 +100,6 @@ int main(int argc, char *argv[])
rootDirSource,
caseDirSource
);
# include "createPolyMesh.H"
label patchID = mesh.boundaryMesh().findPatchID(patchName);
@ -153,20 +137,7 @@ int main(int argc, char *argv[])
runTimeExtruded
),
pp,
nLayers, // number of layers
linearNormalExtruder(-thickness) // overall thickness(signed!)
//wedgeExtruder
//(
// point(0,0.1,0), // point on axis
// vector(0,0,-1), // (normalized!) direction of axis
// 360.0/180.0*mathematicalConstant::pi // angle
//)
//wedgeExtruder
//(
// point(0,0,0), // point on axis
// vector(0,1,0), // (normalized!) direction of axis
// 30.0/180.0*mathematicalConstant::pi // angle
//)
model()
)
);
}
@ -198,12 +169,10 @@ int main(int argc, char *argv[])
runTimeExtruded
),
fMesh,
nLayers, // number of layers
linearNormalExtruder(-thickness) // overall thickness (signed!)
model()
)
);
}
extrudedMesh& mesh = meshPtr();

View File

@ -0,0 +1,9 @@
extrudeModel/extrudeModel.C
extrudeModel/newExtrudeModel.C
linearNormal/linearNormal.C
linearRadial/linearRadial.C
sigmaRadial/sigmaRadial.C
wedge/wedge.C
LIB = $(FOAM_LIBBIN)/libextrudeModel

View File

@ -0,0 +1,8 @@
EXE_INC = \
-I$(FOAM_SRC)/meshTools/lnInclude \
-I$(FOAM_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \
-lmeshTools \
-ldynamicMesh

View File

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "extrudeModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(extrudeModel, 0);
defineRunTimeSelectionTable(extrudeModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::extrudeModel::extrudeModel
(
const word& modelType,
const dictionary& dict
)
:
nLayers_(readLabel(dict.lookup("nLayers"))),
dict_(dict),
coeffDict_(dict.subDict(modelType + "Coeffs"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::extrudeModel::~extrudeModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::extrudeModel::nLayers() const
{
return nLayers_;
}
// ************************************************************************* //

View File

@ -0,0 +1,136 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::extrudeModel
Description
Top level extrusion model class
SourceFiles
extrudeModel.C
\*---------------------------------------------------------------------------*/
#ifndef extrudeModel_H
#define extrudeModel_H
#include "dictionary.H"
#include "point.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class extrudeModel Declaration
\*---------------------------------------------------------------------------*/
class extrudeModel
{
protected:
// Protected data
const label nLayers_;
const dictionary& dict_;
const dictionary& coeffDict_;
// Private Member Functions
//- Disallow default bitwise copy construct
extrudeModel(const extrudeModel&);
//- Disallow default bitwise assignment
void operator=(const extrudeModel&);
public:
//- Runtime type information
TypeName("extrudeModel");
//- Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
extrudeModel,
dictionary,
(
const dictionary& dict
),
(dict)
);
// Constructors
//- Construct from dictionary
extrudeModel(const word& modelType, const dictionary&);
// Selectors
//- Select null constructed
static autoPtr<extrudeModel> New(const dictionary&);
//- Destructor
virtual ~extrudeModel();
// Member Functions
// Access
label nLayers() const;
// Member Operators
virtual point operator()
(
const point& surfacePoint,
const vector& surfaceNormal,
const label layer
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "extrudeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::extrudeModel> Foam::extrudeModel::New
(
const dictionary& dict
)
{
word extrudeModelType(dict.lookup("extrudeModel"));
Info<< "Selecting extrudeModel " << extrudeModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(extrudeModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("extrudeModel::New(const dictionary&)")
<< "Unknown extrudeModelType type "
<< extrudeModelType
<< ", constructor not in hash table" << nl << nl
<< " Valid extrudeModel types are :" << nl
<< dictionaryConstructorTablePtr_->toc() << nl
<< exit(FatalError);
}
return autoPtr<extrudeModel>(cstrIter()(dict));
}
// ************************************************************************* //

View File

@ -0,0 +1,79 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "linearNormal.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace extrudeModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(linearNormal, 0);
addToRunTimeSelectionTable(extrudeModel, linearNormal, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
linearNormal::linearNormal(const dictionary& dict)
:
extrudeModel(typeName, dict),
thickness_(readScalar(coeffDict_.lookup("thickness")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
linearNormal::~linearNormal()
{}
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
point linearNormal::operator()
(
const point& surfacePoint,
const vector& surfaceNormal,
const label layer
) const
{
scalar d = thickness_*layer/nLayers_;
return surfacePoint + d*surfaceNormal;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -23,27 +23,33 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::linearNormalExtruder
Foam::extrudeModels::linearNormal
Description
Extrudes by transforming points normal to the surface by a given distance
\*---------------------------------------------------------------------------*/
#ifndef linearNormalExtruder_H
#define linearNormalExtruder_H
#ifndef linearNormal_H
#define linearNormal_H
#include "point.H"
#include "extrudeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace extrudeModels
{
/*---------------------------------------------------------------------------*\
Class linearNormalExtruder Declaration
Class linearNormal Declaration
\*---------------------------------------------------------------------------*/
class linearNormalExtruder
class linearNormal
:
public extrudeModel
{
// Private data
@ -53,13 +59,17 @@ class linearNormalExtruder
public:
//- Runtime type information
TypeName("linearNormal");
// Constructors
//- Construct from components
linearNormalExtruder(const scalar thickness)
:
thickness_(thickness)
{}
linearNormal(const dictionary& dict);
//- Destructor
~linearNormal();
// Member Operators
@ -68,19 +78,14 @@ public:
(
const point& surfacePoint,
const vector& surfaceNormal,
const label nLayers,
const label layer
) const
{
scalar d = thickness_*layer/nLayers;
return surfacePoint + d*surfaceNormal;
}
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -88,3 +93,4 @@ public:
#endif
// ************************************************************************* //

View File

@ -0,0 +1,82 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "linearRadial.H"
#include "addToRunTimeSelectionTable.H"
namespace Foam
{
namespace extrudeModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(linearRadial, 0);
addToRunTimeSelectionTable(extrudeModel, linearRadial, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
linearRadial::linearRadial(const dictionary& dict)
:
extrudeModel(typeName, dict),
R_(readScalar(coeffDict_.lookup("R")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
linearRadial::~linearRadial()
{}
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
point linearRadial::operator()
(
const point& surfacePoint,
const vector& surfaceNormal,
const label layer
) const
{
// radius of the surface
scalar rs = mag(surfacePoint);
vector rsHat = surfacePoint/rs;
scalar delta = (R_ - rs)/nLayers_;
scalar r = rs + layer*delta;
return r*rsHat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -23,27 +23,31 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::linearRadialExtruder
Foam::extrudeModels::linearRadial
Description
\*---------------------------------------------------------------------------*/
#ifndef linearRadialExtruder_H
#define linearRadialExtruder_H
#ifndef linearRadial_H
#define linearRadial_H
#include "point.H"
#include "extrudeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace extrudeModels
{
/*---------------------------------------------------------------------------*\
Class linearRadialExtruder Declaration
Class linearRadial Declaration
\*---------------------------------------------------------------------------*/
class linearRadialExtruder
class linearRadial
:
public extrudeModel
{
// Private data
@ -52,13 +56,17 @@ class linearRadialExtruder
public:
//- Runtime type information
TypeName("linearRadial");
// Constructors
//- Construct from components
linearRadialExtruder(const scalar R)
:
R_(R)
{}
linearRadial(const dictionary& dict);
//- Destructor
~linearRadial();
// Member Operators
@ -67,23 +75,14 @@ public:
(
const point& surfacePoint,
const vector& surfaceNormal,
const label nLayers,
const label layer
) const
{
// radius of the surface
scalar rs = mag(surfacePoint);
vector rsHat = surfacePoint/rs;
scalar delta = (R_ - rs)/nLayers;
scalar r = rs + layer*delta;
return r*rsHat;
}
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -91,3 +90,4 @@ public:
#endif
// ************************************************************************* //

View File

@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "sigmaRadial.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace extrudeModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(sigmaRadial, 0);
addToRunTimeSelectionTable(extrudeModel, sigmaRadial, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
sigmaRadial::sigmaRadial(const dictionary& dict)
:
extrudeModel(typeName, dict),
RTbyg_(readScalar(coeffDict_.lookup("RTbyg"))),
pRef_(readScalar(coeffDict_.lookup("pRef"))),
pStrat_(readScalar(coeffDict_.lookup("pStrat")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
sigmaRadial::~sigmaRadial()
{}
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
point sigmaRadial::operator()
(
const point& surfacePoint,
const vector& surfaceNormal,
const label layer
) const
{
// radius of the surface
scalar rs = mag(surfacePoint);
vector rsHat = surfacePoint/rs;
scalar p = pRef_ - layer*(pRef_ - pStrat_)/nLayers_;
scalar r = rs - RTbyg_*log(p/pRef_);
return r*rsHat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -23,27 +23,31 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::sigmaRadialExtruder
Foam::extrudeModels::sigmaRadial
Description
\*---------------------------------------------------------------------------*/
#ifndef sigmaRadialExtruder_H
#define sigmaRadialExtruder_H
#ifndef sigmaRadial_H
#define sigmaRadial_H
#include "point.H"
#include "extrudeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace extrudeModels
{
/*---------------------------------------------------------------------------*\
Class sigmaRadialExtruder Declaration
Class sigmaRadial Declaration
\*---------------------------------------------------------------------------*/
class sigmaRadialExtruder
class sigmaRadial
:
public extrudeModel
{
// Private data
@ -54,20 +58,17 @@ class sigmaRadialExtruder
public:
//- Runtime type information
TypeName("sigmaRadial");
// Constructors
//- Construct from components
sigmaRadialExtruder
(
const scalar RTbyg,
const scalar pRef,
const scalar pStrat
)
:
RTbyg_(RTbyg),
pRef_(pRef),
pStrat_(pStrat)
{}
sigmaRadial(const dictionary& dict);
//-Destructor
~sigmaRadial();
// Member Operators
@ -76,24 +77,14 @@ public:
(
const point& surfacePoint,
const vector& surfaceNormal,
const label nLayers,
const label layer
) const
{
// radius of the surface
scalar rs = mag(surfacePoint);
vector rsHat = surfacePoint/rs;
scalar p = pRef_ - layer*(pRef_ - pStrat_)/nLayers;
scalar r = rs - RTbyg_*Foam::log(p/pRef_);
return r*rsHat;
}
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -101,3 +92,4 @@ public:
#endif
// ************************************************************************* //

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "wedge.H"
#include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace extrudeModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(wedge, 0);
addToRunTimeSelectionTable(extrudeModel, wedge, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
wedge::wedge(const dictionary& dict)
:
extrudeModel(typeName, dict),
axisPt_(coeffDict_.lookup("axisPt")),
axisNormal_(coeffDict_.lookup("axisNormal")),
angle_
(
readScalar(coeffDict_.lookup("angle"))
*mathematicalConstant::pi/180.0
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
wedge::~wedge()
{}
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
point wedge::operator()
(
const point& surfacePoint,
const vector& surfaceNormal,
const label layer
) const
{
scalar sliceAngle;
// For the case of a single layer extrusion assume a
// symmetric wedge about the reference plane is required
if (nLayers_ == 1)
{
if (layer == 0)
{
sliceAngle = -angle_/2.0;
}
else
{
sliceAngle = angle_/2.0;
}
}
else
{
sliceAngle = angle_*(layer + 1)/nLayers_;
}
// Find projection onto axis (or rather decompose surfacePoint
// into vector along edge (proj), vector normal to edge in plane
// of surface point and surface normal.
point d = surfacePoint - axisPt_;
d -= (axisNormal_ & d)*axisNormal_;
scalar dMag = mag(d);
point edgePt = surfacePoint - d;
// Rotate point around sliceAngle.
point rotatedPoint = edgePt;
if (dMag > VSMALL)
{
vector n = (d/dMag) ^ axisNormal_;
rotatedPoint +=
+ cos(sliceAngle)*d
- sin(sliceAngle)*mag(d)*n; // Use either n or surfaceNormal
}
return rotatedPoint;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -23,29 +23,40 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::wedgeExtruder
Foam::extrudeModels::wedge
Description
Extrudes by rotating a surface around an axis
- extrusion is opposite the surface/patch normal so inwards the source
mesh
- axis direction has to be consistent with this.
- use -mergeFaces option if doing full 360 and want to merge front and back
- note direction of axis. This should be consistent with rotating against
the patch normal direction. If you get it wrong you'll see all cells
with extreme aspect ratio and internal faces wrong way around in
checkMesh
\*---------------------------------------------------------------------------*/
#ifndef wedgeExtruder_H
#define wedgeExtruder_H
#ifndef wedge_H
#define wedge_H
#include "point.H"
#include "extrudeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace extrudeModels
{
/*---------------------------------------------------------------------------*\
Class wedgeExtruder Declaration
Class wedge Declaration
\*---------------------------------------------------------------------------*/
class wedgeExtruder
class wedge
:
public extrudeModel
{
// Private data
@ -58,22 +69,19 @@ class wedgeExtruder
//- overall angle (radians)
const scalar angle_;
public:
//- Runtime type information
TypeName("wedge");
// Constructors
//- Construct from components
wedgeExtruder
(
const point& axisPt,
const point& axisNormal,
const scalar angle
)
:
axisPt_(axisPt),
axisNormal_(axisNormal),
angle_(angle)
{}
wedge(const dictionary& dict);
//- Destrcuctor
~wedge();
// Member Operators
@ -82,60 +90,14 @@ public:
(
const point& surfacePoint,
const vector& surfaceNormal,
const label nLayers,
const label layer
) const
{
scalar sliceAngle;
// For the case of a single layer extrusion assume a
// symmetric wedge about the reference plane is required
if (nLayers == 1)
{
if (layer == 0)
{
sliceAngle = -angle_/2.0;
}
else
{
sliceAngle = angle_/2.0;
}
}
else
{
sliceAngle = angle_ * (layer+1)/nLayers;
}
// Find projection onto axis (or rather decompose surfacePoint
// into vector along edge (proj), vector normal to edge in plane
// of surface point and surface normal.
point d = surfacePoint - axisPt_;
d -= (axisNormal_&d)*axisNormal_;
scalar dMag = mag(d);
point edgePt = surfacePoint - d;
// Rotate point around sliceAngle.
point rotatedPoint = edgePt;
if (dMag > VSMALL)
{
vector n = (d/dMag) ^ axisNormal_;
rotatedPoint +=
+ cos(sliceAngle)*d
- sin(sliceAngle)*mag(d)*n; // Use either n or surfaceNormal
}
return rotatedPoint;
}
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object extrudeProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
extrudeModel wedge;
//extrudeModel linearNormal;
//extrudeModel linearRadial;
//extrudeModel sigmaRadial;
nLayers 1;
wedgeCoeffs
{
axisPt (0 0 0);
axisNormal (0 -1 0);
angle 2.0;
}
linearNormalCoeffs
{
thickness 0.1;
}
linearRadialCoeffs
{
R 0.1;
}
sigmaRadialCoeffs
{
RTbyg 1;
pRef 1;
pStrat 1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -46,19 +46,19 @@ template
<
class Face,
template<class> class FaceList,
class PointField,
class PointExtruder
class PointField
>
Foam::pointField Foam::extrudedMesh::extrudedPoints
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const label nLayers,
const PointExtruder& extruder
const extrudeModel& model
)
{
const pointField& surfacePoints = extrudePatch.localPoints();
const vectorField& surfaceNormals = extrudePatch.pointNormals();
const label nLayers = model.nLayers();
pointField ePoints((nLayers + 1)*surfacePoints.size());
for (label layer=0; layer<=nLayers; layer++)
@ -67,11 +67,10 @@ Foam::pointField Foam::extrudedMesh::extrudedPoints
forAll(surfacePoints, i)
{
ePoints[offset + i] = extruder
ePoints[offset + i] = model
(
surfacePoints[i],
surfaceNormals[i],
nLayers,
layer
);
}
@ -85,7 +84,7 @@ template<class Face, template<class> class FaceList, class PointField>
Foam::faceList Foam::extrudedMesh::extrudedFaces
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const label nLayers
const extrudeModel& model
)
{
const pointField& surfacePoints = extrudePatch.localPoints();
@ -93,6 +92,8 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
const edgeList& surfaceEdges = extrudePatch.edges();
const label nInternalEdges = extrudePatch.nInternalEdges();
const label nLayers = model.nLayers();
label nFaces =
(nLayers + 1)*surfaceFaces.size() + nLayers*surfaceEdges.size();
@ -108,7 +109,7 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
// Side faces from layer to layer+1
for (label i = 0; i < nInternalEdges; i++)
for (label i=0; i<nInternalEdges; i++)
{
quad[0] = surfaceEdges[i][1] + currentLayerOffset;
quad[1] = surfaceEdges[i][0] + currentLayerOffset;
@ -140,7 +141,7 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
// Side faces across layer
for (label i = nInternalEdges; i < surfaceEdges.size(); i++)
for (label i=nInternalEdges; i<surfaceEdges.size(); i++)
{
const edge& e = surfaceEdges[i];
quad[0] = e[1] + currentLayerOffset;
@ -162,7 +163,7 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
// Top faces
forAll(surfaceFaces, i)
{
eFaces[facei++] = face(surfaceFaces[i]);
eFaces[facei++] = face(surfaceFaces[i]);
}
// Bottom faces
@ -172,7 +173,7 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
face
(
surfaceFaces[i].reverseFace()
+ nLayers*surfacePoints.size()
+ nLayers*surfacePoints.size()
);
}
@ -184,13 +185,15 @@ template<class Face, template<class> class FaceList, class PointField>
Foam::cellList Foam::extrudedMesh::extrudedCells
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const label nLayers
const extrudeModel& model
)
{
const List<face>& surfaceFaces = extrudePatch.localFaces();
const edgeList& surfaceEdges = extrudePatch.edges();
const label nInternalEdges = extrudePatch.nInternalEdges();
const label nLayers = model.nLayers();
cellList eCells(nLayers*surfaceFaces.size());
// Size the cells
@ -200,7 +203,7 @@ Foam::cellList Foam::extrudedMesh::extrudedCells
for (label layer=0; layer<nLayers; layer++)
{
eCells[i+layer*surfaceFaces.size()].setSize(f.size() + 2);
eCells[i + layer*surfaceFaces.size()].setSize(f.size() + 2);
}
}
@ -213,7 +216,7 @@ Foam::cellList Foam::extrudedMesh::extrudedCells
for (label layer=0; layer<nLayers; layer++)
{
// Side faces from layer to layer+1
for (label i = 0; i < nInternalEdges; i++)
for (label i=0; i<nInternalEdges; i++)
{
// Get patch faces using edge
const labelList& edgeFaces = extrudePatch.edgeFaces()[i];
@ -248,7 +251,7 @@ Foam::cellList Foam::extrudedMesh::extrudedCells
for (label layer=0; layer<nLayers; layer++)
{
// Side faces across layer
for (label i = nInternalEdges; i < surfaceEdges.size(); i++)
for (label i=nInternalEdges; i<surfaceEdges.size(); i++)
{
// Get patch faces using edge
const labelList& edgeFaces = extrudePatch.edgeFaces()[i];
@ -290,30 +293,31 @@ template
<
class Face,
template<class> class FaceList,
class PointField,
class PointExtruder
class PointField
>
Foam::extrudedMesh::extrudedMesh
(
const IOobject& io,
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const label nLayers,
const PointExtruder& extruder
const extrudeModel& model
)
:
polyMesh
(
io,
extrudedPoints(extrudePatch, nLayers, extruder),
extrudedFaces(extrudePatch, nLayers),
extrudedCells(extrudePatch, nLayers)
)
extrudedPoints(extrudePatch, model),
extrudedFaces(extrudePatch, model),
extrudedCells(extrudePatch, model)
),
model_(model)
{
List<polyPatch*> patches(3);
label facei = nInternalFaces();
label sz = nLayers*(extrudePatch.nEdges() - extrudePatch.nInternalEdges());
label sz =
model_.nLayers()
*(extrudePatch.nEdges() - extrudePatch.nInternalEdges());
patches[0] = new wallPolyPatch
(
@ -351,3 +355,4 @@ Foam::extrudedMesh::extrudedMesh
// ************************************************************************* //

View File

@ -36,6 +36,7 @@ SourceFiles
#define extrudedMesh_H
#include "polyMesh.H"
#include "extrudeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,24 +51,22 @@ class extrudedMesh
:
public polyMesh
{
// Private data
const extrudeModel& model_;
// Private Member Functions
//- Do edge and face use points in same order?
static bool sameOrder(const face&, const edge&);
//- Construct and return the extruded mesh points
template
<
class Face,
template<class> class FaceList,
class PointField,
class PointExtruder
>
template<class Face, template<class> class FaceList, class PointField>
pointField extrudedPoints
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const label nLayers,
const PointExtruder& extruder
const extrudeModel& model
);
//- Construct and return the extruded mesh faces
@ -75,7 +74,7 @@ class extrudedMesh
faceList extrudedFaces
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const label nLayers
const extrudeModel& model
);
//- Construct and return the extruded mesh cells
@ -83,7 +82,7 @@ class extrudedMesh
cellList extrudedCells
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const label nLayers
const extrudeModel& model
);
@ -99,19 +98,12 @@ public:
// Constructors
//- Construct from the primitivePatch to extrude
template
<
class Face,
template<class> class FaceList,
class PointField,
class PointExtruder
>
template<class Face, template<class> class FaceList, class PointField>
extrudedMesh
(
const IOobject& io,
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const label nLayers,
const PointExtruder& extruder
const extrudeModel& model
);
};
@ -133,3 +125,4 @@ public:
#endif
// ************************************************************************* //

View File

@ -51,12 +51,14 @@ class faceMesh
:
public PrimitivePatch<face, List, pointField>
{
PrimitivePatch<face, List, pointField> read(Istream& is)
{
pointField points(is);
faceList faces(is);
return PrimitivePatch<face, Foam::List, pointField>(faces, points);
}
// Private member functions
PrimitivePatch<face, List, pointField> read(Istream& is)
{
pointField points(is);
faceList faces(is);
return PrimitivePatch<face, Foam::List, pointField>(faces, points);
}
public:

View File

@ -1,13 +1,6 @@
argList::validArgs.clear();
argList::noParallel();
argList::validArgs.append("target root");
argList::validArgs.append("target case");
argList::validArgs.append("nLayers");
argList::validArgs.append("overal thickness");
argList::validOptions.insert("sourceRoot", "source root");
argList::validOptions.insert("sourceCase", "source case");
argList::validOptions.insert("sourcePatch", "source patch");
@ -23,16 +16,3 @@
FatalError.exit();
}
fileName rootDirTarget(args.additionalArgs()[0]);
fileName caseDirTarget(args.additionalArgs()[1]);
label nLayers(readLabel(IStringStream(args.additionalArgs()[2])()));
scalar thickness(readScalar(IStringStream(args.additionalArgs()[3])()));
Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl;
Info<< "Extruding layers:" << nl
<< " number of layers " << nLayers << nl
<< " overall thickness " << thickness << nl
<< endl;

View File

@ -140,6 +140,7 @@ buildParaView ()
{
# set general options
addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON"
addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release"
# set paraview environment
unset PARAVIEW_SRC_DIR

View File

@ -134,7 +134,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
const unallocLabelList& faceCells = p.patch().faceCells();
// Build the d-vectors
vectorField pd =
vectorField pd =
mesh.Sf().boundaryField()[patchi]
/(
mesh.magSf().boundaryField()[patchi]
@ -198,7 +198,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
const unallocLabelList& faceCells = p.faceCells();
// Build the d-vectors
vectorField pd =
vectorField pd =
mesh.Sf().boundaryField()[patchi]
/(
mesh.magSf().boundaryField()[patchi]
@ -239,6 +239,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
// For 3D meshes check the determinant of the dd tensor and switch to
// Gauss if it is less than 3
/* Currently the det(dd[celli]) criterion is incorrect: dd is weighted by Sf
if (mesh.nGeometricD() == 3)
{
label nBadCells = 0;
@ -279,7 +280,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
if (mesh.boundary()[patchi].size())
{
label patchFacei =
label patchFacei =
facei - mesh.boundaryMesh()[patchi].start();
if (mesh.boundary()[patchi].coupled())
@ -294,14 +295,14 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
0.2
);
lsP.boundaryField()[patchi][patchFacei] =
lsP.boundaryField()[patchi][patchFacei] =
(1 - wf)
*Sf.boundaryField()[patchi][patchFacei]
/V[celli];
}
else
{
lsP.boundaryField()[patchi][patchFacei] =
lsP.boundaryField()[patchi][patchFacei] =
Sf.boundaryField()[patchi][patchFacei]
/V[celli];
}
@ -318,7 +319,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
<< endl;
}
}
*/
if (debug)
{

View File

@ -57,7 +57,6 @@ class shifted
scalar e_at_rCut_;
public:
//- Runtime type information

View File

@ -27,8 +27,6 @@ License
#include "treeBoundBox.H"
#include "ListOps.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::treeBoundBox Foam::treeBoundBox::greatBox
@ -50,6 +48,7 @@ const Foam::label facesArray[6][4] =
};
//! @endcond
const Foam::faceList Foam::treeBoundBox::faces
(
initListList<face, label, 6, 4>(facesArray)
@ -74,12 +73,34 @@ const Foam::label edgesArray[12][2] =
};
//! @endcond
const Foam::edgeList Foam::treeBoundBox::edges
(
initListList<edge, label, 12, 2>(edgesArray)
);
const Foam::FixedList<Foam::vector, 6> Foam::treeBoundBox::faceNormals
(
calcFaceNormals()
);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::FixedList<Foam::vector, 6> Foam::treeBoundBox::calcFaceNormals()
{
FixedList<vector, 6> normals;
normals[LEFT] = vector(-1, 0, 0);
normals[RIGHT] = vector( 1, 0, 0);
normals[BOTTOM] = vector( 0, -1, 0);
normals[TOP] = vector( 0, 1, 0);
normals[BACK] = vector( 0, 0, -1);
normals[FRONT] = vector( 0, 0, 1);
return normals;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct as the bounding box of the given pointField

View File

@ -78,6 +78,11 @@ class treeBoundBox
public boundBox
{
private:
//- To initialise faceNormals.
static FixedList<vector, 6> calcFaceNormals();
public:
// Static data members
@ -142,6 +147,9 @@ public:
//- Edge to point addressing
static const edgeList edges;
//- Per face the unit normal
static const FixedList<vector, 6> faceNormals;
//- Face on which neighbour is
static direction neighbourFaceBits(const label&);

View File

@ -85,23 +85,23 @@ void Foam::fieldAverage::initialise()
const word fieldName = faItems_[i].fieldName();
if (obr_.foundObject<volScalarField>(fieldName))
{
addMeanFields<scalar>(i, meanScalarFields_);
addMeanField<scalar>(i, meanScalarFields_);
}
else if (obr_.foundObject<volVectorField>(fieldName))
{
addMeanFields<vector>(i, meanVectorFields_);
addMeanField<vector>(i, meanVectorFields_);
}
else if (obr_.foundObject<volSphericalTensorField>(fieldName))
{
addMeanFields<sphericalTensor>(i, meanSphericalTensorFields_);
addMeanField<sphericalTensor>(i, meanSphericalTensorFields_);
}
else if (obr_.foundObject<volSymmTensorField>(fieldName))
{
addMeanFields<symmTensor>(i, meanSymmTensorFields_);
addMeanField<symmTensor>(i, meanSymmTensorFields_);
}
else if (obr_.foundObject<volTensorField>(fieldName))
{
addMeanFields<tensor>(i, meanTensorFields_);
addMeanField<tensor>(i, meanTensorFields_);
}
else
{
@ -118,29 +118,29 @@ void Foam::fieldAverage::initialise()
if (faItems_[i].prime2Mean())
{
const word fieldName = faItems_[i].fieldName();
if (!faItems_[i].mean())
{
FatalErrorIn("Foam::fieldAverage::initialise()")
<< "To calculate the prime-squared average, the "
<< "mean average must also be selected for field "
<< fieldName << nl << exit(FatalError);
}
if (obr_.foundObject<volScalarField>(fieldName))
{
if (!faItems_[i].mean())
{
FatalErrorIn("Foam::fieldAverage::initialise()")
<< "To calculate the prime-squared average, the "
<< "mean average must also be selected for field "
<< fieldName << nl << exit(FatalError);
}
addPrime2MeanFields<scalar>(i, prime2MeanScalarFields_);
addPrime2MeanField<scalar>
(
i,
meanScalarFields_,
prime2MeanScalarFields_
);
}
else if (obr_.foundObject<volVectorField>(fieldName))
{
if (!faItems_[i].mean())
{
FatalErrorIn("Foam::fieldAverage::initialise()")
<< "To calculate the prime-squared average, the "
<< "mean average must also be selected for field "
<< fieldName << nl << exit(FatalError);
}
addPrime2MeanFields<vector>
addPrime2MeanField<vector>
(
i,
meanVectorFields_,
prime2MeanSymmTensorFields_
);
}
@ -251,8 +251,16 @@ void Foam::fieldAverage::calcAverages()
totalTime_[i] += obr_.time().deltaT().value();
}
addMeanSqrToPrime2Mean<scalar>(prime2MeanScalarFields_);
addMeanSqrToPrime2Mean<vector>(prime2MeanSymmTensorFields_);
addMeanSqrToPrime2Mean<scalar>
(
meanScalarFields_,
prime2MeanScalarFields_
);
addMeanSqrToPrime2Mean<vector>
(
meanVectorFields_,
prime2MeanSymmTensorFields_
);
calculateMeanFields<scalar>(meanScalarFields_);
calculateMeanFields<vector>(meanVectorFields_);
@ -260,8 +268,16 @@ void Foam::fieldAverage::calcAverages()
calculateMeanFields<symmTensor>(meanSymmTensorFields_);
calculateMeanFields<tensor>(meanTensorFields_);
calculatePrime2MeanFields<scalar>(prime2MeanScalarFields_);
calculatePrime2MeanFields<vector>(prime2MeanSymmTensorFields_);
calculatePrime2MeanFields<scalar>
(
meanScalarFields_,
prime2MeanScalarFields_
);
calculatePrime2MeanFields<vector>
(
meanVectorFields_,
prime2MeanSymmTensorFields_
);
}

View File

@ -161,22 +161,21 @@ protected:
// valid, and populate field lists
void initialise();
//- Add mean average fields to PtrLists
//- Add mean average field to PtrList
template<class Type>
void addMeanFields
void addMeanField
(
const label fieldi,
const label,
PtrList<GeometricField<Type, fvPatchField, volMesh> >&
fieldList
);
//- Add prime-squared average fields to PtrLists
//- Add prime-squared average field to PtrList
template<class Type1, class Type2>
void addPrime2MeanFields
void addPrime2MeanField
(
const label fieldi,
const label,
PtrList<GeometricField<Type1, fvPatchField, volMesh> >&,
PtrList<GeometricField<Type2, fvPatchField, volMesh> >&
fieldList
);
@ -190,23 +189,22 @@ protected:
void calculateMeanFields
(
PtrList<GeometricField<Type, fvPatchField, volMesh> >&
fieldList
);
//- Add mean-squared field value to prime-squared mean field
template<class Type1, class Type2>
void addMeanSqrToPrime2Mean
(
PtrList<GeometricField<Type1, fvPatchField, volMesh> >&,
PtrList<GeometricField<Type2, fvPatchField, volMesh> >&
fieldList
);
//- Calculate prime-squared average fields
template<class Type1, class Type2>
void calculatePrime2MeanFields
(
PtrList<GeometricField<Type1, fvPatchField, volMesh> >&,
PtrList<GeometricField<Type2, fvPatchField, volMesh> >&
fieldList
);

View File

@ -31,23 +31,22 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::fieldAverage::addMeanFields
void Foam::fieldAverage::addMeanField
(
const label fieldi,
PtrList<GeometricField<Type, fvPatchField, volMesh> >& fieldList
PtrList<GeometricField<Type, fvPatchField, volMesh> >& meanFieldList
)
{
if (faItems_[fieldi].mean())
{
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
const fvMesh& mesh = refCast<const fvMesh>(obr_);
const word& fieldName = faItems_[fieldi].fieldName();
const fieldType& baseField = mesh.lookupObject<fieldType>(fieldName);
const word meanFieldName = fieldName + EXT_MEAN;
const fieldType& baseField = obr_.lookupObject<fieldType>(fieldName);
const word meanFieldName = fieldName + EXT_MEAN;
Info<< "Reading/calculating field " << meanFieldName << nl << endl;
fieldList.set
meanFieldList.set
(
fieldi,
new fieldType
@ -55,8 +54,8 @@ void Foam::fieldAverage::addMeanFields
IOobject
(
meanFieldName,
mesh.time().timeName(),
mesh,
obr_.time().timeName(),
obr_,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
@ -68,26 +67,25 @@ void Foam::fieldAverage::addMeanFields
template<class Type1, class Type2>
void Foam::fieldAverage::addPrime2MeanFields
void Foam::fieldAverage::addPrime2MeanField
(
const label fieldi,
PtrList<GeometricField<Type2, fvPatchField, volMesh> >& fieldList
PtrList<GeometricField<Type1, fvPatchField, volMesh> >& meanFieldList,
PtrList<GeometricField<Type2, fvPatchField, volMesh> >& prime2MeanFieldList
)
{
if (faItems_[fieldi].mean())
if (faItems_[fieldi].mean() && meanFieldList.set(fieldi))
{
typedef GeometricField<Type1, fvPatchField, volMesh> fieldType1;
typedef GeometricField<Type2, fvPatchField, volMesh> fieldType2;
const fvMesh& mesh = refCast<const fvMesh>(obr_);
const word& fieldName = faItems_[fieldi].fieldName();
const fieldType1& baseField = mesh.lookupObject<fieldType1>(fieldName);
const fieldType1& meanField =
mesh.lookupObject<fieldType1>(fieldName + EXT_MEAN);
const word meanFieldName = fieldName + EXT_PRIME2MEAN;
const fieldType1& baseField = obr_.lookupObject<fieldType1>(fieldName);
const fieldType1& meanField = meanFieldList[fieldi];
const word meanFieldName = fieldName + EXT_PRIME2MEAN;
Info<< "Reading/calculating field " << meanFieldName << nl << endl;
fieldList.set
prime2MeanFieldList.set
(
fieldi,
new fieldType2
@ -95,8 +93,8 @@ void Foam::fieldAverage::addPrime2MeanFields
IOobject
(
meanFieldName,
mesh.time().timeName(),
mesh,
obr_.time().timeName(),
obr_,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
@ -110,7 +108,7 @@ void Foam::fieldAverage::addPrime2MeanFields
template<class Type>
void Foam::fieldAverage::calculateMeanFields
(
PtrList<GeometricField<Type, fvPatchField, volMesh> >& fieldList
PtrList<GeometricField<Type, fvPatchField, volMesh> >& meanFieldList
)
{
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
@ -119,31 +117,27 @@ void Foam::fieldAverage::calculateMeanFields
forAll(faItems_, i)
{
if (fieldList.set(i))
if (faItems_[i].mean() && meanFieldList.set(i))
{
if (faItems_[i].mean())
const word& fieldName = faItems_[i].fieldName();
const fieldType& baseField =
obr_.lookupObject<fieldType>(fieldName);
fieldType& meanField = meanFieldList[i];
scalar alpha = 0.0;
scalar beta = 0.0;
if (faItems_[i].timeBase())
{
const fvMesh& mesh = refCast<const fvMesh>(obr_);
const word& fieldName = faItems_[i].fieldName();
const fieldType& baseField =
mesh.lookupObject<fieldType>(fieldName);
fieldType& meanField = fieldList[i];
scalar alpha = 0.0;
scalar beta = 0.0;
if (faItems_[i].timeBase())
{
alpha = (totalTime_[i] - dt)/totalTime_[i];
beta = dt/totalTime_[i];
}
else
{
alpha = scalar(totalIter_[i] - 1)/scalar(totalIter_[i]);
beta = 1.0/scalar(totalIter_[i]);
}
meanField = alpha*meanField + beta*baseField;
alpha = (totalTime_[i] - dt)/totalTime_[i];
beta = dt/totalTime_[i];
}
else
{
alpha = scalar(totalIter_[i] - 1)/scalar(totalIter_[i]);
beta = 1.0/scalar(totalIter_[i]);
}
meanField = alpha*meanField + beta*baseField;
}
}
}
@ -152,7 +146,8 @@ void Foam::fieldAverage::calculateMeanFields
template<class Type1, class Type2>
void Foam::fieldAverage::calculatePrime2MeanFields
(
PtrList<GeometricField<Type2, fvPatchField, volMesh> >& fieldList
PtrList<GeometricField<Type1, fvPatchField, volMesh> >& meanFieldList,
PtrList<GeometricField<Type2, fvPatchField, volMesh> >& prime2MeanFieldList
)
{
typedef GeometricField<Type1, fvPatchField, volMesh> fieldType1;
@ -162,36 +157,36 @@ void Foam::fieldAverage::calculatePrime2MeanFields
forAll(faItems_, i)
{
if (fieldList.set(i))
if
(
faItems_[i].prime2Mean()
&& meanFieldList.set(i)
&& prime2MeanFieldList.set(i)
)
{
if (faItems_[i].prime2Mean())
const word& fieldName = faItems_[i].fieldName();
const fieldType1& baseField =
obr_.lookupObject<fieldType1>(fieldName);
const fieldType1& meanField = meanFieldList[i];
fieldType2& prime2MeanField = prime2MeanFieldList[i];
scalar alpha = 0.0;
scalar beta = 0.0;
if (faItems_[i].timeBase())
{
const fvMesh& mesh = refCast<const fvMesh>(obr_);
const word& fieldName = faItems_[i].fieldName();
const fieldType1& baseField =
mesh.lookupObject<fieldType1>(fieldName);
const fieldType1& meanField =
mesh.lookupObject<fieldType1>(fieldName + EXT_MEAN);
fieldType2& prime2MeanField = fieldList[i];
scalar alpha = 0.0;
scalar beta = 0.0;
if (faItems_[i].timeBase())
{
alpha = (totalTime_[i] - dt)/totalTime_[i];
beta = dt/totalTime_[i];
}
else
{
alpha = scalar(totalIter_[i] - 1)/scalar(totalIter_[i]);
beta = 1.0/scalar(totalIter_[i]);
}
prime2MeanField =
alpha*prime2MeanField
+ beta*sqr(baseField)
- sqr(meanField);
alpha = (totalTime_[i] - dt)/totalTime_[i];
beta = dt/totalTime_[i];
}
else
{
alpha = scalar(totalIter_[i] - 1)/scalar(totalIter_[i]);
beta = 1.0/scalar(totalIter_[i]);
}
prime2MeanField =
alpha*prime2MeanField
+ beta*sqr(baseField)
- sqr(meanField);
}
}
}
@ -200,7 +195,8 @@ void Foam::fieldAverage::calculatePrime2MeanFields
template<class Type1, class Type2>
void Foam::fieldAverage::addMeanSqrToPrime2Mean
(
PtrList<GeometricField<Type2, fvPatchField, volMesh> >& fieldList
PtrList<GeometricField<Type1, fvPatchField, volMesh> >& meanFieldList,
PtrList<GeometricField<Type2, fvPatchField, volMesh> >& prime2MeanFieldList
)
{
typedef GeometricField<Type1, fvPatchField, volMesh> fieldType1;
@ -208,18 +204,17 @@ void Foam::fieldAverage::addMeanSqrToPrime2Mean
forAll(faItems_, i)
{
if (fieldList.set(i))
if
(
faItems_[i].prime2Mean()
&& meanFieldList.set(i)
&& prime2MeanFieldList.set(i)
)
{
if (faItems_[i].prime2Mean())
{
const fvMesh& mesh = refCast<const fvMesh>(obr_);
const word& fieldName = faItems_[i].fieldName();
const fieldType1& meanField =
mesh.lookupObject<fieldType1>(fieldName + EXT_MEAN);
fieldType2& prime2MeanField = fieldList[i];
const fieldType1& meanField = meanFieldList[i];
fieldType2& prime2MeanField = prime2MeanFieldList[i];
prime2MeanField += sqr(meanField);
}
prime2MeanField += sqr(meanField);
}
}
}

View File

@ -20,21 +20,21 @@ internalField uniform 100000;
boundaryField
{
floor
floor
{
type fixedFluxBuoyantPressure;
type calculated;
value uniform 100000;
}
ceiling
ceiling
{
type fixedFluxBuoyantPressure;
type calculated;
value uniform 100000;
}
fixedWalls
fixedWalls
{
type fixedFluxBuoyantPressure;
type calculated;
value uniform 100000;
}
}

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object pd;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
floor
{
type fixedFluxBuoyantPressure;
value uniform 0;
}
ceiling
{
type fixedFluxBuoyantPressure;
value uniform 0;
}
fixedWalls
{
type fixedFluxBuoyantPressure;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -18,4 +18,6 @@ thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<per
mixture air 1 28.9 1000 0 1.8e-05 0.7;
pRef 1e5;
// ************************************************************************* //

View File

@ -16,25 +16,25 @@ FoamFile
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 100000;
internalField uniform 0;
boundaryField
{
floor
floor
{
type fixedFluxBuoyantPressure;
type calculated;
value uniform 100000;
}
ceiling
ceiling
{
type fixedFluxBuoyantPressure;
type calculated;
value uniform 100000;
}
fixedWalls
fixedWalls
{
type fixedFluxBuoyantPressure;
type calculated;
value uniform 100000;
}
}

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object pd;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
floor
{
type fixedFluxBuoyantPressure;
value uniform 0;
}
ceiling
{
type fixedFluxBuoyantPressure;
value uniform 0;
}
fixedWalls
{
type fixedFluxBuoyantPressure;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -18,4 +18,6 @@ thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<per
mixture air 1 28.9 1000 0 1.8e-05 0.7;
pRef 1e5;
// ************************************************************************* //

View File

@ -20,27 +20,27 @@ internalField uniform 100000;
boundaryField
{
floor
floor
{
type fixedFluxBuoyantPressure;
type calculated;
value uniform 100000;
}
ceiling
ceiling
{
type fixedFluxBuoyantPressure;
type calculated;
value uniform 100000;
}
fixedWalls
fixedWalls
{
type fixedFluxBuoyantPressure;
type calculated;
value uniform 100000;
}
box
{
type fixedFluxBuoyantPressure;
type calculated;
value uniform 100000;
}
}

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object pd;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
floor
{
type fixedFluxBuoyantPressure;
value uniform 0;
}
ceiling
{
type fixedFluxBuoyantPressure;
value uniform 0;
}
fixedWalls
{
type fixedFluxBuoyantPressure;
value uniform 0;
}
box
{
type fixedFluxBuoyantPressure;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -18,4 +18,6 @@ thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<per
mixture air 1 28.9 1000 0 1.8e-05 0.7;
pRef 1e5;
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
walls
{
type fixedValue;
value uniform (0 0 0);
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
walls
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object pd;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
walls
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,12 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application="compressibleLesInterFoam"
runApplication blockMesh
cp 0/alpha1.org 0/alpha1
cp 0/pd.org 0/pd
runApplication setFields
runApplication $application

View File

@ -0,0 +1,182 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object LESProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
LESModel laminar;
delta smooth;
laminarCoeffs
{
}
oneEqEddyCoeffs
{
ck 0.07;
ce 1.05;
}
dynOneEqEddyCoeffs
{
ce 1.05;
filter simple;
}
locDynOneEqEddyCoeffs
{
ce 1.05;
filter simple;
}
SmagorinskyCoeffs
{
ce 1.05;
ck 0.07;
}
Smagorinsky2Coeffs
{
ce 1.05;
ck 0.07;
cD2 0.02;
}
spectEddyViscCoeffs
{
ce 1.05;
cB 8.22;
cK1 0.83;
cK2 1.03;
cK3 4.75;
cK4 2.55;
}
dynSmagorinskyCoeffs
{
ce 1.05;
filter simple;
}
mixedSmagorinskyCoeffs
{
ce 1.05;
ck 0.07;
filter simple;
}
dynMixedSmagorinskyCoeffs
{
ce 1.05;
filter simple;
}
LRRDiffStressCoeffs
{
ce 1.05;
ck 0.09;
c1 1.8;
c2 0.6;
}
DeardorffDiffStressCoeffs
{
ce 1.05;
ck 0.09;
cm 4.13;
}
SpalartAllmarasCoeffs
{
alphaNut 1.5;
Cb1 0.1355;
Cb2 0.622;
Cw2 0.3;
Cw3 2;
Cv1 7.1;
CDES 0.65;
ck 0.07;
}
cubeRootVolCoeffs
{
deltaCoeff 1;
}
PrandtlCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
smoothCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
maxDeltaRatio 1.1;
}
Cdelta 0.158;
}
vanDriestCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
smoothCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
maxDeltaRatio 1.1;
}
Aplus 26;
Cdelta 0.158;
}
smoothCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
maxDeltaRatio 1.1;
}
kappa 0.4187;
wallFunctionCoeffs
{
E 9;
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 -0.1)
(1 0 -0.1)
(1 2 -0.1)
(0 2 -0.1)
(0 0 0.1)
(1 0 0.1)
(1 2 0.1)
(0 2 0.1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (80 160 1) simpleGrading (1 1 1)
);
patches
(
wall walls
(
(3 7 6 2)
(0 4 7 3)
(2 6 5 1)
(1 5 4 0)
)
empty frontAndBack
(
(0 3 2 1)
(4 5 6 7)
)
);
// ************************************************************************* //

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
2
(
walls
{
type wall;
nFaces 480;
startFace 25360;
}
frontAndBack
{
type empty;
nFaces 25600;
startFace 25840;
}
)
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phase1 //water
{
transportModel Newtonian;
nu nu [0 2 -1 0 0 0 0] 1e-6;
rho rho [1 -3 0 0 0 0 0] 1000;
rho0 rho0 [1 -3 0 0 0 0 0] 1000;
psi psi [0 -2 2 0 0] 1e-5;
}
phase2 //air
{
transportModel Newtonian;
nu nu [0 2 -1 0 0 0 0] 1.589e-5;
rho rho [1 -3 0 0 0 0 0] 1;
rho0 rho0 [1 -3 0 0 0 0 0] 0;
psi psi [0 -2 2 0 0] 1e-5;
}
pMin pMin [1 -1 -2 0 0 0 0] 1e4;
sigma sigma [1 0 -2 0 0 0 0] 0.07;
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application lesInterFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 0.5;
deltaT 1e-04;
writeControl adjustableRunTime;
writeInterval 5e-03;
purgeWrite 0;
writeFormat ascii;
writePrecision 8;
writeCompression compressed;
timeFormat general;
timePrecision 10;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.25;
maxDeltaT 1;
// ************************************************************************* //

View File

@ -0,0 +1,64 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(rho*phi,U) Gauss upwind; //linear;
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss interfaceCompression 1.0;
div(phi,pd) Gauss upwind; //vanLeer; //linear;
div(phi,k) Gauss vanLeer;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default uncorrected;
}
fluxRequired
{
default no;
pd;
pcorr;
gamma;
}
// ************************************************************************* //

View File

@ -0,0 +1,126 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
pcorr PCG
{
preconditioner GAMG
{
tolerance 1e-5;
relTol 0;
smoother DICGaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nBottomSweeps 2;
cacheAgglomeration false;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
};
tolerance 1e-5;
relTol 0;
maxIter 100;
};
rho diagonal
{};
pd GAMG
{
tolerance 1e-7;
relTol 0.01;
smoother DIC; //GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
};
pdFinal PCG
{
preconditioner GAMG
{
tolerance 1e-7;
relTol 0;
nVcycles 2;
smoother DICGaussSeidel;
nPreSweeps 2;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
};
tolerance 1e-7;
relTol 0;
maxIter 20;
};
U smoothSolver
{
smoother GaussSeidel;
tolerance 1e-6;
relTol 0;
nSweeps 1;
};
k PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0;
};
B PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0;
};
nuTilda PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0;
};
}
PISO
{
momentumPredictor no;
transSonic no;
nOuterCorrectors 3;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
nAlphaCorr 1;
nAlphaSubCycles 1;
cGamma 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha1 1
volScalarFieldValue pd 1e5
);
regions
(
sphereToCell
{
centre (0.5 0.5 0);
radius 0.1;
fieldValues
(
volScalarFieldValue alpha1 0
volScalarFieldValue pd 10e5
);
}
boxToCell
{
box (-10 1 -1) (10 10 1);
fieldValues
(
volScalarFieldValue alpha1 0
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
walls
{
type fixedValue;
value uniform (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: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alpha1.org;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object pd.org;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,5 @@
#!/bin/sh
foamCleanTutorials cases
rm -rf processor*
rm 0/pd.gz 0/alpha1.gz

View File

@ -0,0 +1,15 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application="compressibleLesInterFoam"
runApplication blockMesh
cp 0/alpha1.org 0/alpha1
cp 0/pd.org 0/pd
runApplication setFields
runApplication decomposePar
hostname > system/machines
runParallel $application 4 system/machines
runApplication reconstructPar

View File

@ -0,0 +1,182 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object LESProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
LESModel laminar;
delta smooth;
laminarCoeffs
{
}
oneEqEddyCoeffs
{
ck 0.07;
ce 1.05;
}
dynOneEqEddyCoeffs
{
ce 1.05;
filter simple;
}
locDynOneEqEddyCoeffs
{
ce 1.05;
filter simple;
}
SmagorinskyCoeffs
{
ce 1.05;
ck 0.07;
}
Smagorinsky2Coeffs
{
ce 1.05;
ck 0.07;
cD2 0.02;
}
spectEddyViscCoeffs
{
ce 1.05;
cB 8.22;
cK1 0.83;
cK2 1.03;
cK3 4.75;
cK4 2.55;
}
dynSmagorinskyCoeffs
{
ce 1.05;
filter simple;
}
mixedSmagorinskyCoeffs
{
ce 1.05;
ck 0.07;
filter simple;
}
dynMixedSmagorinskyCoeffs
{
ce 1.05;
filter simple;
}
LRRDiffStressCoeffs
{
ce 1.05;
ck 0.09;
c1 1.8;
c2 0.6;
}
DeardorffDiffStressCoeffs
{
ce 1.05;
ck 0.09;
cm 4.13;
}
SpalartAllmarasCoeffs
{
alphaNut 1.5;
Cb1 0.1355;
Cb2 0.622;
Cw2 0.3;
Cw3 2;
Cv1 7.1;
CDES 0.65;
ck 0.07;
}
cubeRootVolCoeffs
{
deltaCoeff 1;
}
PrandtlCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
smoothCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
maxDeltaRatio 1.1;
}
Cdelta 0.158;
}
vanDriestCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
smoothCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
maxDeltaRatio 1.1;
}
Aplus 26;
Cdelta 0.158;
}
smoothCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
maxDeltaRatio 1.1;
}
kappa 0.4187;
wallFunctionCoeffs
{
E 9;
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(1 0 0)
(1 2 0)
(0 2 0)
(0 0 1)
(1 0 1)
(1 2 1)
(0 2 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (80 160 80) simpleGrading (1 1 1)
);
patches
(
wall walls
(
(3 7 6 2)
(0 4 7 3)
(2 6 5 1)
(1 5 4 0)
(0 3 2 1)
(4 5 6 7)
)
);
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1
(
walls
{
type wall;
nFaces 64000;
startFace 3040000;
}
)
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phase1 //water
{
transportModel Newtonian;
nu nu [0 2 -1 0 0 0 0] 1e-6;
rho rho [1 -3 0 0 0 0 0] 1000;
rho0 rho0 [1 -3 0 0 0 0 0] 1000;
psi psi [0 -2 2 0 0] 1e-5;
}
phase2 //air
{
transportModel Newtonian;
nu nu [0 2 -1 0 0 0 0] 1.589e-5;
rho rho [1 -3 0 0 0 0 0] 1;
rho0 rho0 [1 -3 0 0 0 0 0] 0;
psi psi [0 -2 2 0 0] 1e-5;
}
pMin pMin [1 -1 -2 0 0 0 0] 1e4;
sigma sigma [1 0 -2 0 0 0 0] 0.07;
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application lesInterFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 0.5;
deltaT 1e-04;
writeControl adjustableRunTime;
writeInterval 5e-03;
purgeWrite 0;
writeFormat ascii;
writePrecision 8;
writeCompression compressed;
timeFormat general;
timePrecision 10;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.25;
maxDeltaT 1;
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method hierarchical;
//method metis;
//method parMetis;
simpleCoeffs
{
n (1 4 1);
delta 0.001;
}
hierarchicalCoeffs
{
n (1 4 1);
delta 0.001;
order xyz;
}
metisCoeffs
{}
manualCoeffs
{
dataFile "";
}
distributed no;
roots
(
);
// ************************************************************************* //

View File

@ -0,0 +1,64 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(rho*phi,U) Gauss upwind; //linear;
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss interfaceCompression 1.0;
div(phi,pd) Gauss upwind; //vanLeer; //linear;
div(phi,k) Gauss vanLeer;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default uncorrected;
}
fluxRequired
{
default no;
pd;
pcorr;
gamma;
}
// ************************************************************************* //

View File

@ -0,0 +1,126 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
pcorr PCG
{
preconditioner GAMG
{
tolerance 1e-5;
relTol 0;
smoother DICGaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nBottomSweeps 2;
cacheAgglomeration false;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
};
tolerance 1e-5;
relTol 0;
maxIter 100;
};
rho diagonal
{};
pd GAMG
{
tolerance 1e-7;
relTol 0.01;
smoother DIC; //GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
};
pdFinal PCG
{
preconditioner GAMG
{
tolerance 1e-7;
relTol 0;
nVcycles 2;
smoother DICGaussSeidel;
nPreSweeps 2;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
};
tolerance 1e-7;
relTol 0;
maxIter 20;
};
U smoothSolver
{
smoother GaussSeidel;
tolerance 1e-6;
relTol 0;
nSweeps 1;
};
k PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0;
};
B PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0;
};
nuTilda PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0;
};
}
PISO
{
momentumPredictor no;
transSonic no;
nOuterCorrectors 3;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
nAlphaCorr 1;
nAlphaSubCycles 1;
cGamma 1;
}
// ************************************************************************* //

View File

@ -0,0 +1 @@
noisy

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha1 1
volScalarFieldValue pd 1e5
);
regions
(
sphereToCell
{
centre (0.5 0.5 0.5);
radius 0.1;
fieldValues
(
volScalarFieldValue alpha1 0
volScalarFieldValue pd 10e5
);
}
boxToCell
{
box (-10 1 -1) (10 10 1);
fieldValues
(
volScalarFieldValue alpha1 0
);
}
);
// ************************************************************************* //

View File

@ -63,7 +63,7 @@ pair
shift2 0.97e-9;
scale2 1.2e11;
}
writeTables yes;
writeTables no;
}
Ar-Ne
@ -80,7 +80,7 @@ pair
epsilon 8.765026657e-22;
}
energyScalingFunction shiftedForce;
writeTables yes;
writeTables no;
}
Ne-Ne
@ -97,7 +97,7 @@ pair
epsilon 5.813260729e-22;
}
energyScalingFunction shiftedForce;
writeTables yes;
writeTables no;
}
}

View File

@ -14,7 +14,7 @@ cd ..
cd throttle3D
rm -rf constant/polyMesh/sets > /dev/null 2>&1
rm -rf 0 > /dev/null 2>&1
cp -r 0.orig 0
cp -r 0.org 0
rm system/cellSetDict > /dev/null 2>&1
rm -rf processor[0-9] > /dev/null 2>&1

View File

@ -26,7 +26,7 @@ cd throttle
cd ..
cd throttle3D
cp -r 0.orig 0
cp -r 0.org 0
runApplication blockMesh
@ -42,3 +42,4 @@ cd throttle3D
runParallel $application 4 system/machines
runApplication reconstructPar
cd ..

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type zeroGradient;
value uniform (0 0 0);
}
outlet
{
type zeroGradient;
value uniform (0 0 0);
}
walls
{
type fixedValue;
value uniform (0 0 0);
}
frontBack
{
type fixedValue;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object gamma;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
walls
{
type calculated;
value uniform 0;
}
frontBack
{
type calculated;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -9,28 +9,34 @@ FoamFile
{
version 2.0;
format ascii;
class volSymmTensorField;
object R;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
dimensions [0 2 -2 0 0];
internalField uniform (0 0 0 0 0 0);
internalField uniform 10.0;
boundaryField
{
floor
inlet
{
type fixedValue;
value uniform 0.5;
}
outlet
{
type zeroGradient;
}
ceiling
walls
{
type zeroGradient;
}
fixedWalls
frontBack
{
type zeroGradient;
}

View File

@ -0,0 +1,43 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format binary;
class volScalarField;
object nuSgs;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 1e-11;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
walls
{
type fixedValue;
value uniform 0;
}
frontBack
{
type fixedValue;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0];
internalField uniform 300e5;
boundaryField
{
inlet
{
type totalPressure;
U U;
phi phiv;
rho rho;
psi none;
gamma 1;
p0 uniform 300e5;
}
outlet
{
type fixedValue;
value uniform 100e5;
}
walls
{
type zeroGradient;
}
frontBack
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -9,28 +9,35 @@ FoamFile
{
version 2.0;
format ascii;
class volSymmTensorField;
object R;
class volScalarField;
object rho;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 -2 -2 0 0 0 0];
dimensions [1 -3 0 0 0];
internalField uniform (0 0 0 0 0 0);
internalField uniform 845;
boundaryField
{
floor
inlet
{
type fixedValue;
value uniform 845;
}
outlet
{
type fixedValue;
value uniform 835;
}
walls
{
type zeroGradient;
}
ceiling
{
type zeroGradient;
}
fixedWalls
frontBack
{
type zeroGradient;
}

View File

@ -20,7 +20,7 @@ startTime 0;
stopAt endTime;
endTime 4e-10;
endTime 1e-10;
deltaT 1e-14;

View File

@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application=`basename $PWD`
application="mdEquilibrationFoam"
(cd hartmann && runApplication blockMesh)
(cd hartmann && runApplication $application)

View File

@ -46,7 +46,7 @@ solvers
p GAMG
{
preconditioner 1e-5;
tolerance 1e-8;
relTol 0;
smoother GaussSeidel;

View File

@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application="interFoam"
application="rasInterFoam"
runApplication blockMesh
runApplication setFields

View File

@ -17,7 +17,7 @@ FoamFile
numberOfSubdomains 4;
method hierarchical;
method metis;
//method metis;
//method parMetis;
simpleCoeffs
@ -34,15 +34,7 @@ hierarchicalCoeffs
}
metisCoeffs
{
//processorWeights
//(
// 1
// 1
// 1
// 1
//);
}
{}
manualCoeffs
{
@ -51,7 +43,7 @@ manualCoeffs
distributed no;
roots
roots
(
);

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,7 @@ void importDirectory(const char* dirName);
%}
%s CMNT CFNAME SCFNAME JFNAME FFNAME
%x CMNT CFNAME SCFNAME JFNAME FFNAME
%%
"//".*\n ; /* remove c++ style one line comments */