Compare commits
85 commits
version-4.
...
ionicWind
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01b0b1396b | ||
|
|
9f1a9c60d1 | ||
|
|
75c8f48c51 | ||
|
|
b5bebc52ec | ||
|
|
6b3e8c972b | ||
|
|
8670f39b9f | ||
|
|
c06d324891 | ||
|
|
3efddbac8a | ||
|
|
ad1db37d45 | ||
|
|
408cd2c2d3 | ||
|
|
0da86b7edd | ||
|
|
554e8d0fb0 | ||
|
|
d214c8dfd5 | ||
|
|
03c63bf7a5 | ||
|
|
4cfa55f2ea | ||
|
|
c989277b5e | ||
|
|
53b4b3fc2d | ||
|
|
b5331fdc86 | ||
|
|
7b7f43754d | ||
|
|
8dd02db3b8 | ||
|
|
f71eecf0cc | ||
|
|
bf3559e6be | ||
|
|
783d6cf640 | ||
|
|
bb1309bee1 | ||
|
|
e4bbb06941 | ||
|
|
748858b28d | ||
|
|
14927bb3d0 | ||
|
|
cf5b0901ea | ||
|
|
b4861ec0ad | ||
|
|
ecc796de76 | ||
|
|
f10cfe3fb0 | ||
|
|
56a4152a93 | ||
|
|
1e24adef1f | ||
|
|
ec0c14f527 | ||
|
|
7af84c144d | ||
|
|
d7ffce4f5d | ||
|
|
38af843e10 | ||
|
|
17013e6f44 | ||
|
|
dbcc59da2f | ||
|
|
6f7aaecc58 | ||
|
|
7d5fe2f3d9 | ||
|
|
16dbac4c03 | ||
|
|
71161ef0b8 | ||
|
|
efa306a033 | ||
|
|
fc009a4fa2 | ||
|
|
ca7db4558d | ||
|
|
6804c6cf49 | ||
|
|
89a346ec52 | ||
|
|
e964d879e2 | ||
|
|
1decf44db0 | ||
|
|
7c251b6e92 | ||
|
|
8f3169652e | ||
|
|
7c8d3866cb | ||
|
|
a1a70270f0 | ||
|
|
54efb46f26 | ||
|
|
8ff56d46b9 | ||
|
|
98113110d8 | ||
|
|
100d9a9dd1 | ||
|
|
d5dd04e0a6 | ||
|
|
42cc7646e0 | ||
|
|
a8ccb13d48 | ||
|
|
a7c2bd6cac | ||
|
|
4fc4bc5d35 | ||
|
|
930eb454e4 | ||
|
|
750b0402a6 | ||
|
|
fb57ecbfdf | ||
|
|
3d754f4a12 | ||
|
|
2fedcfd00c | ||
|
|
7209ceb306 | ||
|
|
daa4d54a49 | ||
|
|
0b3c8e6fb4 | ||
|
|
0e18bbaa12 | ||
|
|
422f1770e0 | ||
|
|
fcb789a267 | ||
|
|
769940a61b | ||
|
|
35f4d2da07 | ||
|
|
acc2a7707e | ||
|
|
c4b8d5e443 | ||
|
|
61195404f7 | ||
|
|
8e01ae0462 | ||
|
|
423ac54eab | ||
|
|
c590630ab0 | ||
|
|
579268eb16 | ||
|
|
a6a964b265 | ||
|
|
c326278adb |
142 changed files with 1654 additions and 923 deletions
23
.gitlab-ci.yml
Normal file
23
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
allmake:
|
||||
image: park0d/of4builder
|
||||
tags:
|
||||
- openfoam4
|
||||
before_script:
|
||||
- "[[ -d ../ThirdParty-4.x ]] || git clone https://github.com/OpenFOAM/ThirdParty-4.x.git ../ThirdParty-4.x"
|
||||
- source etc/bashrc
|
||||
- rm -rf platforms
|
||||
- wclean all
|
||||
script:
|
||||
- ./Allwmake -j
|
||||
artifacts:
|
||||
paths:
|
||||
- ./
|
||||
|
||||
cantera:
|
||||
image: park0d/of4builder
|
||||
tags:
|
||||
- openfoam4
|
||||
script:
|
||||
- whereis libcantera
|
||||
|
||||
|
||||
4
COPYING
4
COPYING
|
|
@ -1,7 +1,7 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
OpenFOAM(R) is Copyright (C) 2011 OpenFOAM Foundation
|
||||
Contact: OpenFOAM Foundation (OpenFOAM.Foundation@gmail.com)
|
||||
OpenFOAM is Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Contact: OpenFOAM Foundation, http://openfoam.org/contact
|
||||
|
||||
You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms
|
||||
of GNU General Public License version 3, which is displayed below, or
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#include "createMeshes.H"
|
||||
|
||||
if (!fluidRegions.size())
|
||||
if (!fluidRegions.size() && !solidRegions.size())
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "No fluid meshes present" << exit(FatalError);
|
||||
<< "No region meshes present" << exit(FatalError);
|
||||
}
|
||||
|
||||
fvMesh& mesh = fluidRegions[0];
|
||||
fvMesh& mesh = fluidRegions.size() ? fluidRegions[0] : solidRegions[0];
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ License
|
|||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "relativeVelocityModel.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "slipFvPatchFields.H"
|
||||
#include "partialSlipFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
|
@ -33,6 +36,34 @@ namespace Foam
|
|||
defineRunTimeSelectionTable(relativeVelocityModel, dictionary);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::wordList Foam::relativeVelocityModel::UdmPatchFieldTypes() const
|
||||
{
|
||||
const volVectorField& U = mixture_.U();
|
||||
|
||||
wordList UdmTypes
|
||||
(
|
||||
U.boundaryField().size(),
|
||||
calculatedFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
forAll(U.boundaryField(), i)
|
||||
{
|
||||
if
|
||||
(
|
||||
isA<fixedValueFvPatchVectorField>(U.boundaryField()[i])
|
||||
|| isA<slipFvPatchVectorField>(U.boundaryField()[i])
|
||||
|| isA<partialSlipFvPatchVectorField>(U.boundaryField()[i])
|
||||
)
|
||||
{
|
||||
UdmTypes[i] = fixedValueFvPatchVectorField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
return UdmTypes;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
|
@ -55,11 +86,12 @@ Foam::relativeVelocityModel::relativeVelocityModel
|
|||
"Udm",
|
||||
alphac_.time().timeName(),
|
||||
alphac_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
alphac_.mesh(),
|
||||
dimensionedVector("Udm", dimVelocity, Zero)
|
||||
dimensionedVector("Udm", dimVelocity, Zero),
|
||||
UdmPatchFieldTypes()
|
||||
)
|
||||
{}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -52,12 +52,16 @@ class relativeVelocityModel
|
|||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Return the list of patchFieldTypes for Udm derived from U
|
||||
wordList UdmPatchFieldTypes() const;
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
relativeVelocityModel(const relativeVelocityModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const relativeVelocityModel&);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -101,7 +101,11 @@ Foam::turbulentDispersionModels::Burns::D() const
|
|||
*sqr(pair_.dispersed().d())
|
||||
)
|
||||
*pair_.continuous().rho()
|
||||
*(1.0 + pair_.dispersed()/max(pair_.continuous(), residualAlpha_));
|
||||
*pair_.dispersed()
|
||||
*(
|
||||
1.0/max(pair_.dispersed(), residualAlpha_)
|
||||
+ 1.0/max(pair_.continuous(), residualAlpha_)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -101,7 +101,11 @@ Foam::turbulentDispersionModels::Burns::D() const
|
|||
*sqr(pair_.dispersed().d())
|
||||
)
|
||||
*pair_.continuous().rho()
|
||||
*(1.0 + pair_.dispersed()/max(pair_.continuous(), residualAlpha_));
|
||||
*pair_.dispersed()
|
||||
*(
|
||||
1.0/max(pair_.dispersed(), residualAlpha_)
|
||||
+ 1.0/max(pair_.continuous(), residualAlpha_)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ EXE_LIBS = \
|
|||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-ldecompositionMethods \
|
||||
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
|
||||
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
|
||||
-ledgeMesh \
|
||||
-ltriSurface \
|
||||
-ldynamicMesh \
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -62,7 +62,7 @@ Foam::tmp<Foam::Field<Type>> filterFarPoints
|
|||
)
|
||||
{
|
||||
tmp<Field<Type>> tNewField(new Field<Type>(field.size()));
|
||||
Field<Type>& newField = tNewField();
|
||||
Field<Type>& newField = tNewField.ref();
|
||||
|
||||
label added = 0;
|
||||
label count = 0;
|
||||
|
|
@ -160,7 +160,7 @@ Foam::tmp<Foam::triadField> buildAlignmentField(const T& mesh)
|
|||
(
|
||||
new triadField(mesh.vertexCount(), triad::unset)
|
||||
);
|
||||
triadField& alignments = tAlignments();
|
||||
triadField& alignments = tAlignments.ref();
|
||||
|
||||
for
|
||||
(
|
||||
|
|
@ -188,7 +188,7 @@ Foam::tmp<Foam::pointField> buildPointField(const T& mesh)
|
|||
(
|
||||
new pointField(mesh.vertexCount(), point(GREAT, GREAT, GREAT))
|
||||
);
|
||||
pointField& points = tPoints();
|
||||
pointField& points = tPoints.ref();
|
||||
|
||||
for
|
||||
(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -30,6 +30,7 @@ License
|
|||
#include "scalarIOField.H"
|
||||
#include "labelIOField.H"
|
||||
#include "pointConversion.H"
|
||||
#include "polyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ EXE_LIBS = \
|
|||
-lconformalVoronoiMesh \
|
||||
-lmeshTools \
|
||||
-ldecompositionMethods \
|
||||
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
|
||||
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
|
||||
-ledgeMesh \
|
||||
-lfileFormats \
|
||||
-ltriSurface \
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -311,7 +311,7 @@ tmp<scalarField> signedDistance
|
|||
)
|
||||
{
|
||||
tmp<scalarField> tfld(new scalarField(points.size(), Foam::sqr(GREAT)));
|
||||
scalarField& fld = tfld();
|
||||
scalarField& fld = tfld.ref();
|
||||
|
||||
// Find nearest
|
||||
List<pointIndexHit> nearest;
|
||||
|
|
@ -647,7 +647,8 @@ int main(int argc, char *argv[])
|
|||
forAll(fvm.C().boundaryField(), patchi)
|
||||
{
|
||||
const pointField& cc = fvm.C().boundaryField()[patchi];
|
||||
fvPatchScalarField& fld = cellDistance.boundaryField()[patchi];
|
||||
fvPatchScalarField& fld =
|
||||
cellDistance.boundaryFieldRef()[patchi];
|
||||
scalarField patchDistSqr
|
||||
(
|
||||
fld.patch().patchInternalField(distSqr)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -33,6 +33,7 @@ Description
|
|||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "CGAL/number_utils.h"
|
||||
#include "CGAL/Delaunay_triangulation_2.h"
|
||||
|
||||
#ifdef CGAL_INEXACT
|
||||
|
|
|
|||
|
|
@ -35,6 +35,6 @@ EXE_LIBS = \
|
|||
-ltriSurface \
|
||||
-ldynamicMesh \
|
||||
-ldecompositionMethods \
|
||||
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
|
||||
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
|
||||
-lsampling \
|
||||
-lfileFormats
|
||||
|
|
|
|||
|
|
@ -15,4 +15,5 @@ EXE_LIBS = \
|
|||
-lgenericPatchFields \
|
||||
-lrenumberMethods \
|
||||
$(LINK_FLAGS) \
|
||||
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp
|
||||
-ldecompositionMethods \
|
||||
-L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -84,10 +84,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
#include "createNamedPolyMesh.H"
|
||||
|
||||
const fileName setsSubPath(mesh.dbDir()/polyMesh::meshSubDir/"sets");
|
||||
|
||||
// Search for list of objects for the time of the mesh
|
||||
word setsInstance = runTime.findInstance
|
||||
(
|
||||
polyMesh::meshSubDir/"sets",
|
||||
setsSubPath,
|
||||
word::null,
|
||||
IOobject::MUST_READ,
|
||||
mesh.facesInstance()
|
||||
|
|
@ -95,7 +97,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
IOobjectList objects(mesh, setsInstance, polyMesh::meshSubDir/"sets");
|
||||
|
||||
Info<< "Searched : " << setsInstance/polyMesh::meshSubDir/"sets"
|
||||
Info<< "Searched : " << setsInstance/setsSubPath
|
||||
<< nl
|
||||
<< "Found : " << objects.names() << nl
|
||||
<< endl;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ EXE_LIBS = \
|
|||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-ldecompositionMethods \
|
||||
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
|
||||
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -42,7 +42,7 @@ Description
|
|||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// turbulence constants - file-scope
|
||||
// Turbulence constants - file-scope
|
||||
static const scalar Cmu(0.09);
|
||||
static const scalar kappa(0.41);
|
||||
|
||||
|
|
@ -130,14 +130,14 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (isA<incompressible::RASModel>(turbulence()))
|
||||
{
|
||||
// Calculate nut - reference nut is calculated by the turbulence model
|
||||
// on its construction
|
||||
// Calculate nut
|
||||
turbulence->validate();
|
||||
tmp<volScalarField> tnut = turbulence->nut();
|
||||
volScalarField& nut = tnut.ref();
|
||||
volScalarField& nut = const_cast<volScalarField&>(tnut());
|
||||
volScalarField S(mag(dev(symm(fvc::grad(U)))));
|
||||
nut = (1 - mask)*nut + mask*sqr(kappa*min(y, ybl))*::sqrt(2)*S;
|
||||
|
||||
// do not correct BC - wall functions will 'undo' manipulation above
|
||||
// Do not correct BC - wall functions will 'undo' manipulation above
|
||||
// by using nut from turbulence model
|
||||
|
||||
if (args.optionFound("writenut"))
|
||||
|
|
@ -151,11 +151,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
// Turbulence k
|
||||
tmp<volScalarField> tk = turbulence->k();
|
||||
volScalarField& k = tk.ref();
|
||||
volScalarField& k = const_cast<volScalarField&>(tk());
|
||||
scalar ck0 = pow025(Cmu)*kappa;
|
||||
k = (1 - mask)*k + mask*sqr(nut/(ck0*min(y, ybl)));
|
||||
|
||||
// do not correct BC - operation may use inconsistent fields wrt these
|
||||
// Do not correct BC - operation may use inconsistent fields wrt these
|
||||
// local manipulations
|
||||
// k.correctBoundaryConditions();
|
||||
|
||||
|
|
@ -165,11 +165,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
// Turbulence epsilon
|
||||
tmp<volScalarField> tepsilon = turbulence->epsilon();
|
||||
volScalarField& epsilon = tepsilon.ref();
|
||||
volScalarField& epsilon = const_cast<volScalarField&>(tepsilon());
|
||||
scalar ce0 = ::pow(Cmu, 0.75)/kappa;
|
||||
epsilon = (1 - mask)*epsilon + mask*ce0*k*sqrt(k)/min(y, ybl);
|
||||
|
||||
// do not correct BC - wall functions will use non-updated k from
|
||||
// Do not correct BC - wall functions will use non-updated k from
|
||||
// turbulence model
|
||||
// epsilon.correctBoundaryConditions();
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ int main(int argc, char *argv[])
|
|||
dimensionedScalar k0("VSMALL", k.dimensions(), VSMALL);
|
||||
omega = (1 - mask)*omega + mask*epsilon/(Cmu*k + k0);
|
||||
|
||||
// do not correct BC - wall functions will use non-updated k from
|
||||
// Do not correct BC - wall functions will use non-updated k from
|
||||
// turbulence model
|
||||
// omega.correctBoundaryConditions();
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
|
|||
volScalarField nuTilda(nuTildaHeader, mesh);
|
||||
nuTilda = nut;
|
||||
|
||||
// do not correct BC
|
||||
// Do not correct BC
|
||||
// nuTilda.correctBoundaryConditions();
|
||||
|
||||
Info<< "Writing nuTilda\n" << endl;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ do
|
|||
##DEBUG echo "remove>$wildcard<" 1>&2
|
||||
if [ -n "$wildcard" ]
|
||||
then
|
||||
dirList=$(echo "$dirList:" | sed -e "s@${wildcard}[^:]*:@@g")
|
||||
dirList=$(echo "$dirList:" | sed -e "s|${wildcard}[^:]*:||g")
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
|
|
@ -32,6 +32,6 @@
|
|||
Script=${0##*/}
|
||||
|
||||
echo $Script "has been superceded by the foamList utility:"
|
||||
echo "foamList -debug"
|
||||
echo "foamList -switches"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
|
|||
39
bin/stressComponents
Executable file
39
bin/stressComponents
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# stressComponents
|
||||
#
|
||||
# Description
|
||||
# Script to suggest using the new "-postProcess" solver option.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
Script=${0##*/}
|
||||
|
||||
echo $Script "has been superceded by the -postProcess solver option:"
|
||||
echo "<solverName> -funcs '(R components(turbulenceProperties:R))'"
|
||||
echo "e.g."
|
||||
echo "simpleFoam -postProcess -funcs '(R components(turbulenceProperties:R))'"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
37
bin/wallGradU
Executable file
37
bin/wallGradU
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# wallGradU
|
||||
#
|
||||
# Description
|
||||
# Script to suggest using the new "postProcess" utility.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
Script=${0##*/}
|
||||
|
||||
echo $Script "has been superceded by the postProcess utility:"
|
||||
echo " postProcess -func 'grad(U)'"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
@ -168,7 +168,7 @@ STRIP_FROM_INC_PATH =
|
|||
# support long names like on DOS, Mac, or CD-ROM.
|
||||
# The default value is: NO.
|
||||
|
||||
SHORT_NAMES = YES
|
||||
SHORT_NAMES = NO
|
||||
|
||||
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
|
||||
# first line (until the first dot) of a Javadoc-style comment as the brief
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
#------------------------------------------------------------------------------
|
||||
|
||||
export WM_PROJECT=OpenFOAM
|
||||
export WM_PROJECT_VERSION=4.1
|
||||
export WM_PROJECT_VERSION=4.x
|
||||
|
||||
################################################################################
|
||||
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||
|
|
@ -43,15 +43,12 @@ export WM_PROJECT_VERSION=4.1
|
|||
# Please set to the appropriate path if the default is not correct.
|
||||
#
|
||||
[ $BASH_SOURCE ] && \
|
||||
export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \
|
||||
export FOAM_INST_DIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) || \
|
||||
export FOAM_INST_DIR=$HOME/$WM_PROJECT
|
||||
# export FOAM_INST_DIR=~$WM_PROJECT
|
||||
# export FOAM_INST_DIR=/opt/$WM_PROJECT
|
||||
# export FOAM_INST_DIR=/usr/local/$WM_PROJECT
|
||||
#
|
||||
# Build foamyHexMesh
|
||||
export FOAMY_HEX_MESH=yes
|
||||
#
|
||||
# END OF (NORMAL) USER EDITABLE PART
|
||||
################################################################################
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,5 @@
|
|||
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
||||
|
||||
type forceCoeffs;
|
||||
rhoInf 1; // Redundant for incompressible
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ dragDir (1 0 0);
|
|||
CofR (0 0 0);
|
||||
pitchAxis (0 1 0);
|
||||
|
||||
#includeEtc "caseDicts/postProcessing/forces/forceCoeffsCompressible.cfg"
|
||||
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
|||
|
|
@ -24,6 +24,6 @@ dragDir (1 0 0);
|
|||
CofR (0 0 0);
|
||||
pitchAxis (0 1 0);
|
||||
|
||||
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
|
||||
#includeEtc "caseDicts/postProcessing/forces/forceCoeffsIncompressible.cfg"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
|||
|
|
@ -8,4 +8,7 @@
|
|||
|
||||
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
|
||||
|
||||
rho rhoInf;
|
||||
rhoInf 1; // Redundant, but currently read in
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
@ -12,7 +12,6 @@ libs ("libforces.so");
|
|||
writeControl timeStep;
|
||||
writeInterval 1;
|
||||
|
||||
rho rhoInf; // Incompressible solver
|
||||
log off;
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ patches (patch1 patch2);
|
|||
CofR (0 0 0);
|
||||
pitchAxis (0 1 0);
|
||||
|
||||
#includeEtc "caseDicts/postProcessing/forces/forcesCompressible.cfg"
|
||||
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Description
|
|||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
||||
#includeEtc "caseDicts/postProcessing/forces/forcesIncompressible.cfg"
|
||||
|
||||
rhoInf 1.225; // Fluid density
|
||||
patches (patch1 patch2);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@
|
|||
|
||||
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
||||
|
||||
rhoInf 1; // Redundant
|
||||
rho rhoInf;
|
||||
|
||||
// ************************************************************************* //
|
||||
27
etc/caseDicts/postProcessing/lagrangian/dsmcFields
Normal file
27
etc/caseDicts/postProcessing/lagrangian/dsmcFields
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Web: www.OpenFOAM.org
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Description
|
||||
Calculate intensive fields:
|
||||
- UMean
|
||||
- translationalT
|
||||
- internalT
|
||||
- overallT
|
||||
from averaged extensive fields from a DSMC calculation.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
type dsmcFields;
|
||||
libs ("liblagrangianFunctionObjects.so");
|
||||
|
||||
fields (rhoNMean rhoMMean momentumMean linearKEMean internalEMean
|
||||
iDofMean fDMean);
|
||||
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
|
||||
|
||||
# Clean the PATH
|
||||
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
|
||||
if ( $status == 0 ) setenv PATH $cleaned
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ FoamFile
|
|||
|
||||
Documentation
|
||||
{
|
||||
docBrowser "firefox %f";
|
||||
docBrowser "firefox -file %f";
|
||||
doxyDocDirs
|
||||
(
|
||||
"$WM_PROJECT_USER_DIR/html"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#------------------------------------------------------------------------------
|
||||
|
||||
setenv WM_PROJECT OpenFOAM
|
||||
setenv WM_PROJECT_VERSION 4.1
|
||||
setenv WM_PROJECT_VERSION 4.x
|
||||
|
||||
################################################################################
|
||||
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||
|
|
@ -43,15 +43,11 @@ setenv WM_PROJECT_VERSION 4.1
|
|||
#
|
||||
setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' | \
|
||||
sed 's%/'$WM_PROJECT'[^/]*/etc/cshrc%%'`
|
||||
echo $FOAM_INST_DIR
|
||||
# setenv FOAM_INST_DIR $HOME/$WM_PROJECT
|
||||
# setenv FOAM_INST_DIR ~$WM_PROJECT
|
||||
# setenv FOAM_INST_DIR /opt/$WM_PROJECT
|
||||
# setenv FOAM_INST_DIR /usr/local/$WM_PROJECT
|
||||
#
|
||||
# Build foamyHexMesh
|
||||
setenv FOAMY_HEX_MESH yes
|
||||
#
|
||||
# END OF (NORMAL) USER EDITABLE PART
|
||||
################################################################################
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ divSchemes
|
|||
div(phi,K) $turbulence;
|
||||
div(phi,Ekp) $turbulence;
|
||||
|
||||
div(phid,p) bounded Gauss upwind;
|
||||
div(phid,p) Gauss upwind;
|
||||
div((phi|interpolate(rho)),p) bounded Gauss upwind;
|
||||
|
||||
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
||||
|
|
|
|||
|
|
@ -64,23 +64,24 @@ Description
|
|||
libs | Libraries containing implementation | yes |
|
||||
region | Name of region for multi-region cases | no |
|
||||
enabled | On/off switch | no | yes
|
||||
log | Log information to standard output | no | yes
|
||||
timeStart| Start time | no |
|
||||
timeEnd | End time | no |
|
||||
evaluateControl | See time controls below | no | timeStep
|
||||
evaluateInterval | Steps between output | no |
|
||||
executeControl | See time controls below | no | timeStep
|
||||
executeInterval | Steps between each execute phase | no |
|
||||
writeControl | See time controls below | no | timeStep
|
||||
writeInterval | Steps between output | no |
|
||||
writeInterval | Steps between each write phase | no |
|
||||
\endtable
|
||||
|
||||
Time controls:
|
||||
\table
|
||||
Option | Description
|
||||
timeStep | Execute/write every 'writeInterval' time-steps
|
||||
writeTime | Execute/write every 'writeInterval' output times
|
||||
adjustableRunTime | Execute/write every 'writeInterval' run time period
|
||||
runTime | Execute/write every 'writeInterval' run time period
|
||||
clockTime | Execute/write every 'writeInterval' clock time period
|
||||
cpuTime | Execute/write every 'writeInterval' CPU time period
|
||||
timeStep | Execute/write every 'Interval' time-steps
|
||||
writeTime | Execute/write every 'Interval' output times
|
||||
adjustableRunTime | Execute/write every 'Interval' run time period
|
||||
runTime | Execute/write every 'Interval' run time period
|
||||
clockTime | Execute/write every 'Interval' clock time period
|
||||
cpuTime | Execute/write every 'Interval' CPU time period
|
||||
none | Execute/write every time-step
|
||||
\endtable
|
||||
|
||||
|
|
@ -91,6 +92,14 @@ Description
|
|||
libraries and the \c libs entry is used to specify which library should be
|
||||
loaded.
|
||||
|
||||
Each function object has two separate run phases:
|
||||
|
||||
- The \c execute phase is meant to be used for updating calculations
|
||||
or for management tasks.
|
||||
- The \c write phase is meant for writing the calculated data to disk.
|
||||
|
||||
For each phase the respective time controls are provided, as listed above.
|
||||
|
||||
Class
|
||||
Foam::functionObject
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ bool Foam::functionObjects::regionFunctionObject::store
|
|||
if (cacheable && fieldName == tfield().name())
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Cannot store cache-able field with the named used in the cache."
|
||||
<< "Cannot store cache-able field with the name used in the cache."
|
||||
<< nl
|
||||
<< " Either choose a different name or cache the field"
|
||||
<< " and use the 'writeObjects' functionObject."
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -211,7 +211,7 @@ DimensionedField<Type, GeoMesh>::DimensionedField
|
|||
const DimensionedField<Type, GeoMesh>& df
|
||||
)
|
||||
:
|
||||
regIOobject(newName, df, newName == df.name()),
|
||||
regIOobject(newName, df, newName != df.name()),
|
||||
Field<Type>(df),
|
||||
mesh_(df.mesh_),
|
||||
dimensions_(df.dimensions_)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -1164,11 +1164,18 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
|
|||
|
||||
this->dimensions() = gf.dimensions();
|
||||
|
||||
if (tgf.isTmp())
|
||||
{
|
||||
// Transfer the storage from the tmp
|
||||
primitiveFieldRef().transfer
|
||||
(
|
||||
const_cast<Field<Type>&>(gf.primitiveField())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
primitiveFieldRef() = gf.primitiveField();
|
||||
}
|
||||
|
||||
boundaryFieldRef() = gf.boundaryField();
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -35,6 +35,9 @@ namespace Foam
|
|||
}
|
||||
|
||||
|
||||
const Foam::label Foam::lduMatrix::solver::defaultMaxIter_ = 1000;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::lduMatrix::lduMatrix(const lduMesh& mesh)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -106,6 +106,9 @@ public:
|
|||
//- Dictionary of controls
|
||||
dictionary controlDict_;
|
||||
|
||||
//- Default maximum number of iterations in the solver
|
||||
static const label defaultMaxIter_;
|
||||
|
||||
//- Maximum number of iterations in the solver
|
||||
label maxIter_;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -157,7 +157,7 @@ Foam::lduMatrix::solver::solver
|
|||
|
||||
void Foam::lduMatrix::solver::readControls()
|
||||
{
|
||||
maxIter_ = controlDict_.lookupOrDefault<label>("maxIter", 1000);
|
||||
maxIter_ = controlDict_.lookupOrDefault<label>("maxIter", defaultMaxIter_);
|
||||
minIter_ = controlDict_.lookupOrDefault<label>("minIter", 0);
|
||||
tolerance_ = controlDict_.lookupOrDefault<scalar>("tolerance", 1e-6);
|
||||
relTol_ = controlDict_.lookupOrDefault<scalar>("relTol", 0);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -204,6 +204,16 @@ Foam::solverPerformance Foam::PBiCG::solve
|
|||
);
|
||||
}
|
||||
|
||||
// Recommend PBiCGStab if PBiCG fails to converge
|
||||
if (solverPerf.nIterations() > max(defaultMaxIter_, maxIter_))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "PBiCG has failed to converge within the maximum number"
|
||||
" of iterations " << max(defaultMaxIter_, maxIter_) << nl
|
||||
<< " Please try the more robust PBiCGStab solver."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return solverPerf;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ Foam::solverPerformance Foam::PBiCGStab::solve
|
|||
|
||||
// --- Calculate omega from tA and sA
|
||||
// (cheaper than using zA with preconditioned tA)
|
||||
omega = gSumProd(tA, sA)/tAtA;
|
||||
omega = gSumProd(tA, sA, matrix().mesh().comm())/tAtA;
|
||||
|
||||
// --- Update solution and residual
|
||||
for (label cell=0; cell<nCells; cell++)
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ Foam::vector Foam::eigenValues(const tensor& t)
|
|||
}
|
||||
|
||||
// Two identical roots and one distinct root
|
||||
else if (mag(PPP/QQ - 1) < SMALL)
|
||||
else if (mag(QQ) > SMALL && mag(PPP/QQ - 1) < SMALL)
|
||||
{
|
||||
scalar sqrtP = sqrt(P);
|
||||
scalar signQ = sign(Q);
|
||||
|
|
|
|||
|
|
@ -27,17 +27,19 @@ Class
|
|||
Description
|
||||
Polynomial templated on size (order):
|
||||
|
||||
poly = sum(coeff_[i]*x^i) logCoeff*log(x)
|
||||
\verbatim
|
||||
poly = sum(coeffs[i]*x^i) + logCoeff*log(x)
|
||||
\endverbatim
|
||||
|
||||
where 0 \<= i \<= N
|
||||
where <tt> 0 <= i <= N </tt>
|
||||
|
||||
- integer powers, starting at zero
|
||||
- value(x) to evaluate the poly for a given value
|
||||
- derivative(x) returns derivative at value
|
||||
- integral(x1, x2) returns integral between two scalar values
|
||||
- integral() to return a new, integral coeff polynomial
|
||||
- \c value(x) to evaluate the poly for a given value
|
||||
- \c derivative(x) returns derivative at value
|
||||
- \c integral(x1, x2) returns integral between two scalar values
|
||||
- \c integral() to return a new, integral coeff polynomial
|
||||
- increases the size (order)
|
||||
- integralMinus1() to return a new, integral coeff polynomial where
|
||||
- \c integralMinus1() to return a new, integral coeff polynomial where
|
||||
the base poly starts at order -1
|
||||
|
||||
SourceFiles
|
||||
|
|
|
|||
|
|
@ -27,16 +27,18 @@ Class
|
|||
Description
|
||||
Polynomial function representation
|
||||
|
||||
poly = logCoeff*log(x) + sum(coeff_[i]*x^i)
|
||||
\verbatim
|
||||
poly = logCoeff*log(x) + sum(coeffs[i]*x^i)
|
||||
\endverbatim
|
||||
|
||||
where 0 \<= i \<= N
|
||||
where <tt> 0 <= i <= N </tt>
|
||||
|
||||
- integer powers, starting at zero
|
||||
- value(x) to evaluate the poly for a given value
|
||||
- integrate(x1, x2) between two scalar values
|
||||
- integral() to return a new, integral coeff polynomial
|
||||
- \c value(x) to evaluate the poly for a given value
|
||||
- \c integrate(x1, x2) between two scalar values
|
||||
- \c integral() to return a new, integral coeff polynomial
|
||||
- increases the size (order)
|
||||
- integralMinus1() to return a new, integral coeff polynomial where
|
||||
- \c integralMinus1() to return a new, integral coeff polynomial where
|
||||
the base poly starts at order -1
|
||||
|
||||
See also
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ kOmegaSST<TurbulenceModel, BasicTurbulenceModel>::kOmegaSST
|
|||
template<class TurbulenceModel, class BasicTurbulenceModel>
|
||||
bool kOmegaSST<TurbulenceModel, BasicTurbulenceModel>::read()
|
||||
{
|
||||
if (BasicTurbulenceModel::read())
|
||||
if (TurbulenceModel::read())
|
||||
{
|
||||
alphaK1_.readIfPresent(this->coeffDict());
|
||||
alphaK2_.readIfPresent(this->coeffDict());
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -33,7 +33,7 @@ namespace Foam
|
|||
namespace LESModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
void dynamicLagrangian<BasicTurbulenceModel>::correctNut
|
||||
|
|
@ -159,7 +159,9 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
|
|||
}
|
||||
|
||||
// Local references
|
||||
const surfaceScalarField& phi = this->phi_;
|
||||
const alphaField& alpha = this->alpha_;
|
||||
const rhoField& rho = this->rho_;
|
||||
const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_;
|
||||
const volVectorField& U = this->U_;
|
||||
fv::options& fvOptions(fv::options::New(this->mesh_));
|
||||
|
||||
|
|
@ -183,19 +185,19 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
|
|||
|
||||
volScalarField invT
|
||||
(
|
||||
(1.0/(theta_.value()*this->delta()))*pow(flm_*fmm_, 1.0/8.0)
|
||||
alpha*rho*(1.0/(theta_.value()*this->delta()))*pow(flm_*fmm_, 1.0/8.0)
|
||||
);
|
||||
|
||||
volScalarField LM(L && M);
|
||||
|
||||
fvScalarMatrix flmEqn
|
||||
(
|
||||
fvm::ddt(flm_)
|
||||
+ fvm::div(phi, flm_)
|
||||
fvm::ddt(alpha, rho, flm_)
|
||||
+ fvm::div(alphaRhoPhi, flm_)
|
||||
==
|
||||
invT*LM
|
||||
- fvm::Sp(invT, flm_)
|
||||
+ fvOptions(flm_)
|
||||
+ fvOptions(alpha, rho, flm_)
|
||||
);
|
||||
|
||||
flmEqn.relax();
|
||||
|
|
@ -208,12 +210,12 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
|
|||
|
||||
fvScalarMatrix fmmEqn
|
||||
(
|
||||
fvm::ddt(fmm_)
|
||||
+ fvm::div(phi, fmm_)
|
||||
fvm::ddt(alpha, rho, fmm_)
|
||||
+ fvm::div(alphaRhoPhi, fmm_)
|
||||
==
|
||||
invT*MM
|
||||
- fvm::Sp(invT, fmm_)
|
||||
+ fvOptions(fmm_)
|
||||
+ fvOptions(alpha, rho, fmm_)
|
||||
);
|
||||
|
||||
fmmEqn.relax();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -153,7 +153,7 @@ LaunderSharmaKE<BasicTurbulenceModel>::LaunderSharmaKE
|
|||
(
|
||||
"C3",
|
||||
this->coeffDict_,
|
||||
-0.33
|
||||
0
|
||||
)
|
||||
),
|
||||
sigmak_
|
||||
|
|
@ -273,7 +273,7 @@ void LaunderSharmaKE<BasicTurbulenceModel>::correct()
|
|||
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
|
||||
==
|
||||
C1_*alpha*rho*G*epsilon_/k_
|
||||
- fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha*rho*divU, epsilon_)
|
||||
- fvm::SuSp(((2.0/3.0)*C1_ - C3_)*alpha*rho*divU, epsilon_)
|
||||
- fvm::Sp(C2_*f2()*alpha*rho*epsilon_/k_, epsilon_)
|
||||
+ alpha*rho*E
|
||||
+ epsilonSource()
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -137,7 +137,7 @@ RNGkEpsilon<BasicTurbulenceModel>::RNGkEpsilon
|
|||
(
|
||||
"C3",
|
||||
this->coeffDict_,
|
||||
-0.33
|
||||
0
|
||||
)
|
||||
),
|
||||
sigmak_
|
||||
|
|
@ -282,7 +282,7 @@ void RNGkEpsilon<BasicTurbulenceModel>::correct()
|
|||
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
|
||||
==
|
||||
(C1_ - R)*alpha*rho*G*epsilon_/k_
|
||||
- fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha*rho*divU, epsilon_)
|
||||
- fvm::SuSp(((2.0/3.0)*C1_ - C3_)*alpha*rho*divU, epsilon_)
|
||||
- fvm::Sp(C2_*alpha*rho*epsilon_/k_, epsilon_)
|
||||
+ epsilonSource()
|
||||
+ fvOptions(alpha, rho, epsilon_)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -137,7 +137,7 @@ kEpsilon<BasicTurbulenceModel>::kEpsilon
|
|||
(
|
||||
"C3",
|
||||
this->coeffDict_,
|
||||
-0.33
|
||||
0
|
||||
)
|
||||
),
|
||||
sigmak_
|
||||
|
|
@ -259,7 +259,7 @@ void kEpsilon<BasicTurbulenceModel>::correct()
|
|||
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
|
||||
==
|
||||
C1_*alpha()*rho()*G*epsilon_()/k_()
|
||||
- fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha()*rho()*divU, epsilon_)
|
||||
- fvm::SuSp(((2.0/3.0)*C1_ - C3_)*alpha()*rho()*divU, epsilon_)
|
||||
- fvm::Sp(C2_*alpha()*rho()*epsilon_()/k_(), epsilon_)
|
||||
+ epsilonSource()
|
||||
+ fvOptions(alpha, rho, epsilon_)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -125,7 +125,7 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs()
|
|||
|
||||
void Foam::fixedShearStressFvPatchVectorField::write(Ostream& os) const
|
||||
{
|
||||
fixedValueFvPatchVectorField::write(os);
|
||||
fvPatchVectorField::write(os);
|
||||
os.writeKeyword("tau") << tau0_ << token::END_STATEMENT << nl;
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -153,7 +153,7 @@ public:
|
|||
//- Evaluate the patchField
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::Pstream::blocking
|
||||
const Pstream::commsTypes commsType=Pstream::blocking
|
||||
);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -147,7 +147,7 @@ namespace Foam
|
|||
|
||||
os << nl;
|
||||
}
|
||||
} // end namespace
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
|
|
@ -183,17 +183,24 @@ void Foam::csvSetWriter<Type>::writeCoordHeader
|
|||
Ostream& os
|
||||
) const
|
||||
{
|
||||
const word axisName(points.axis());
|
||||
|
||||
if (points.hasVectorAxis())
|
||||
{
|
||||
forAll(points, i)
|
||||
for
|
||||
(
|
||||
word::const_iterator iter = axisName.begin();
|
||||
iter != axisName.end();
|
||||
++iter
|
||||
)
|
||||
{
|
||||
os << points.axis()[i];
|
||||
os << *iter;
|
||||
writeSeparator(os);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
os << points.axis();
|
||||
os << axisName;
|
||||
writeSeparator(os);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ Description
|
|||
|
||||
\f[
|
||||
p_rgh = p - \rho g.(h - hRef)
|
||||
\f]
|
||||
|
||||
\f[
|
||||
p = p0 - 0.5 \rho |U|^2
|
||||
\f]
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -1255,7 +1255,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdtUfCorr
|
|||
ddt0_<GeometricField<Type, fvPatchField, volMesh>>
|
||||
(
|
||||
"ddt0(" + rho.name() + ',' + U.name() + ')',
|
||||
U.dimensions()
|
||||
rho.dimensions()*U.dimensions()
|
||||
);
|
||||
|
||||
DDt0Field<GeometricField<Type, fvsPatchField, surfaceMesh>>& dUfdt0 =
|
||||
|
|
@ -1350,7 +1350,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr
|
|||
ddt0_<GeometricField<Type, fvPatchField, volMesh>>
|
||||
(
|
||||
"ddt0(" + rho.name() + ',' + U.name() + ')',
|
||||
U.dimensions()
|
||||
rho.dimensions()*U.dimensions()
|
||||
);
|
||||
|
||||
DDt0Field<fluxFieldType>& dphidt0 =
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -202,8 +202,8 @@ void Foam::MULES::limiterCorr
|
|||
scalarField psiMaxn(psiIf.size(), psiMin);
|
||||
scalarField psiMinn(psiIf.size(), psiMax);
|
||||
|
||||
scalarField sumPhip(psiIf.size(), VSMALL);
|
||||
scalarField mSumPhim(psiIf.size(), VSMALL);
|
||||
scalarField sumPhip(psiIf.size(), 0.0);
|
||||
scalarField mSumPhim(psiIf.size(), 0.0);
|
||||
|
||||
forAll(phiCorrIf, facei)
|
||||
{
|
||||
|
|
@ -361,7 +361,7 @@ void Foam::MULES::limiterCorr
|
|||
max(min
|
||||
(
|
||||
(sumlPhip[celli] + psiMaxn[celli])
|
||||
/(mSumPhim[celli] - SMALL),
|
||||
/(mSumPhim[celli] + ROOTVSMALL),
|
||||
1.0), 0.0
|
||||
);
|
||||
|
||||
|
|
@ -369,7 +369,7 @@ void Foam::MULES::limiterCorr
|
|||
max(min
|
||||
(
|
||||
(mSumlPhim[celli] + psiMinn[celli])
|
||||
/(sumPhip[celli] + SMALL),
|
||||
/(sumPhip[celli] + ROOTVSMALL),
|
||||
1.0), 0.0
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -236,8 +236,8 @@ void Foam::MULES::limiter
|
|||
|
||||
scalarField sumPhiBD(psiIf.size(), 0.0);
|
||||
|
||||
scalarField sumPhip(psiIf.size(), VSMALL);
|
||||
scalarField mSumPhim(psiIf.size(), VSMALL);
|
||||
scalarField sumPhip(psiIf.size(), 0.0);
|
||||
scalarField mSumPhim(psiIf.size(), 0.0);
|
||||
|
||||
forAll(phiCorrIf, facei)
|
||||
{
|
||||
|
|
@ -428,7 +428,7 @@ void Foam::MULES::limiter
|
|||
max(min
|
||||
(
|
||||
(sumlPhip[celli] + psiMaxn[celli])
|
||||
/(mSumPhim[celli] - SMALL),
|
||||
/(mSumPhim[celli] + ROOTVSMALL),
|
||||
1.0), 0.0
|
||||
);
|
||||
|
||||
|
|
@ -436,7 +436,7 @@ void Foam::MULES::limiter
|
|||
max(min
|
||||
(
|
||||
(mSumlPhim[celli] + psiMinn[celli])
|
||||
/(sumPhip[celli] + SMALL),
|
||||
/(sumPhip[celli] + ROOTVSMALL),
|
||||
1.0), 0.0
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,11 +52,11 @@ bool Foam::functionObjects::MachNo::calc()
|
|||
if
|
||||
(
|
||||
foundObject<volVectorField>(fieldName_)
|
||||
&& mesh_.foundObject<fluidThermo>(fluidThermo::dictName)
|
||||
&& foundObject<fluidThermo>(fluidThermo::dictName)
|
||||
)
|
||||
{
|
||||
const fluidThermo& thermo =
|
||||
mesh_.lookupObject<fluidThermo>(fluidThermo::dictName);
|
||||
lookupObject<fluidThermo>(fluidThermo::dictName);
|
||||
|
||||
const volVectorField& U = lookupObject<volVectorField>(fieldName_);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -40,7 +40,7 @@ namespace functionObjects
|
|||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::functionObjects::fieldAverage::resetFields()
|
||||
{
|
||||
|
|
@ -67,6 +67,27 @@ void Foam::functionObjects::fieldAverage::resetFields()
|
|||
|
||||
void Foam::functionObjects::fieldAverage::initialize()
|
||||
{
|
||||
if (!totalIter_.size())
|
||||
{
|
||||
totalIter_.setSize(faItems_.size(), 1);
|
||||
}
|
||||
|
||||
if (!totalTime_.size())
|
||||
{
|
||||
totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if totalTime_ has been set otherwise initialize
|
||||
forAll(totalTime_, fieldi)
|
||||
{
|
||||
if (totalTime_[fieldi] < 0)
|
||||
{
|
||||
totalTime_[fieldi] = obr_.time().deltaTValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resetFields();
|
||||
|
||||
// Add mean fields to the field lists
|
||||
|
|
@ -95,15 +116,11 @@ void Foam::functionObjects::fieldAverage::initialize()
|
|||
|
||||
void Foam::functionObjects::fieldAverage::restart()
|
||||
{
|
||||
Log
|
||||
<< " Restarting averaging at time " << obr_.time().timeName()
|
||||
Log << " Restarting averaging at time " << obr_.time().timeName()
|
||||
<< nl << endl;
|
||||
|
||||
totalIter_.clear();
|
||||
totalIter_.setSize(faItems_.size(), 1);
|
||||
|
||||
totalTime_.clear();
|
||||
totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue());
|
||||
|
||||
initialize();
|
||||
}
|
||||
|
|
@ -134,8 +151,7 @@ void Foam::functionObjects::fieldAverage::calcAverages()
|
|||
periodIndex_++;
|
||||
}
|
||||
|
||||
Log
|
||||
<< type() << " " << name() << " write:" << nl
|
||||
Log << type() << " " << name() << " write:" << nl
|
||||
<< " Calculating averages" << nl;
|
||||
|
||||
addMeanSqrToPrime2Mean<scalar, scalar>();
|
||||
|
|
@ -206,12 +222,6 @@ void Foam::functionObjects::fieldAverage::writeAveragingProperties() const
|
|||
|
||||
void Foam::functionObjects::fieldAverage::readAveragingProperties()
|
||||
{
|
||||
totalIter_.clear();
|
||||
totalIter_.setSize(faItems_.size(), 1);
|
||||
|
||||
totalTime_.clear();
|
||||
totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue());
|
||||
|
||||
if ((restartOnRestart_ || restartOnOutput_) && log)
|
||||
{
|
||||
Info<< " Starting averaging at time " << obr_.time().timeName()
|
||||
|
|
@ -232,8 +242,7 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
|
|||
|
||||
if (!propsDictHeader.headerOk())
|
||||
{
|
||||
Log
|
||||
<< " Starting averaging at time "
|
||||
Log << " Starting averaging at time "
|
||||
<< obr_.time().timeName() << nl;
|
||||
|
||||
return;
|
||||
|
|
@ -243,6 +252,12 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
|
|||
|
||||
Log << " Restarting averaging for fields:" << nl;
|
||||
|
||||
totalIter_.setSize(faItems_.size(), 1);
|
||||
|
||||
// Initialize totalTime with negative values
|
||||
// to indicate that it has not been set
|
||||
totalTime_.setSize(faItems_.size(), -1);
|
||||
|
||||
forAll(faItems_, fieldi)
|
||||
{
|
||||
const word& fieldName = faItems_[fieldi].fieldName();
|
||||
|
|
@ -253,8 +268,7 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
|
|||
totalIter_[fieldi] = readLabel(fieldDict.lookup("totalIter"));
|
||||
totalTime_[fieldi] = readScalar(fieldDict.lookup("totalTime"));
|
||||
|
||||
Log
|
||||
<< " " << fieldName
|
||||
Log << " " << fieldName
|
||||
<< " iters = " << totalIter_[fieldi]
|
||||
<< " time = " << totalTime_[fieldi] << nl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -56,7 +56,7 @@ fieldCoordinateSystemTransform
|
|||
:
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
fieldSet_(),
|
||||
coordSys_(mesh_, dict)
|
||||
coordSys_(mesh_, dict.subDict("coordinateSystem"))
|
||||
{
|
||||
read(dict);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -45,13 +45,18 @@ Description
|
|||
UMean
|
||||
UPrime2Mean
|
||||
);
|
||||
|
||||
coordinateSystem
|
||||
{
|
||||
origin (0.001 0 0);
|
||||
coordinateRotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 0.15 0);
|
||||
e3 (0 0 -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Usage
|
||||
|
|
|
|||
|
|
@ -40,11 +40,15 @@ functions
|
|||
|
||||
coordinateSystem
|
||||
{
|
||||
origin (0.001 0 0);
|
||||
origin (0 0 0);
|
||||
coordinateRotation
|
||||
{
|
||||
type axesRotation;
|
||||
e1 (1 0.15 0);
|
||||
e3 (0 0 -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
|||
|
|
@ -39,13 +39,6 @@ namespace functionObjects
|
|||
|
||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::fieldExpression::calc()
|
||||
{
|
||||
NotImplemented;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::fieldExpression::setResultName
|
||||
(
|
||||
const word& typeName,
|
||||
|
|
@ -121,8 +114,8 @@ bool Foam::functionObjects::fieldExpression::execute()
|
|||
if (!calc())
|
||||
{
|
||||
Warning
|
||||
<< "functionObject " << type() << ": Cannot find required field "
|
||||
<< fieldName_ << endl;
|
||||
<< " functionObjects::" << type() << " " << name()
|
||||
<< " failed to execute." << endl;
|
||||
|
||||
// Clear the result field from the objectRegistry if present
|
||||
clear();
|
||||
|
|
|
|||
|
|
@ -71,10 +71,13 @@ protected:
|
|||
|
||||
// Protected member functions
|
||||
|
||||
virtual bool calc();
|
||||
virtual bool calc() = 0;
|
||||
|
||||
void setResultName(const word& typeName, const word& defaultArg);
|
||||
|
||||
template<class Type>
|
||||
bool foundObject(const word& name);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
|
@ -133,6 +136,12 @@ public:
|
|||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "fieldExpressionTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fieldExpression.H"
|
||||
|
||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
bool Foam::functionObjects::fieldExpression::foundObject
|
||||
(
|
||||
const word& name
|
||||
)
|
||||
{
|
||||
if (fvMeshFunctionObject::foundObject<Type>(name))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning
|
||||
<< " functionObjects::" << type() << " " << this->name()
|
||||
<< " cannot find required object " << name << " of type "
|
||||
<< Type::typeName << endl;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
@ -28,7 +28,7 @@ Group
|
|||
grpFieldFunctionObjects
|
||||
|
||||
Description
|
||||
This function object calculates the value and location of scalar minimim
|
||||
This function object calculates the value and location of scalar minimum
|
||||
and maximum for a list of user-specified fields. For variables with a rank
|
||||
greater than zero, either the min/max of a component value or the magnitude
|
||||
is reported. When operating in parallel, the processor owning the value
|
||||
|
|
|
|||
|
|
@ -84,52 +84,52 @@ Type Foam::functionObjects::fieldValues::volRegion::processValues
|
|||
{
|
||||
case opSum:
|
||||
{
|
||||
result = sum(values);
|
||||
result = gSum(values);
|
||||
break;
|
||||
}
|
||||
case opSumMag:
|
||||
{
|
||||
result = sum(cmptMag(values));
|
||||
result = gSum(cmptMag(values));
|
||||
break;
|
||||
}
|
||||
case opAverage:
|
||||
{
|
||||
result = sum(values)/values.size();
|
||||
result = gSum(values)/nCells_;
|
||||
break;
|
||||
}
|
||||
case opWeightedAverage:
|
||||
{
|
||||
result = sum(weightField*values)/sum(weightField);
|
||||
result = gSum(weightField*values)/gSum(weightField);
|
||||
break;
|
||||
}
|
||||
case opVolAverage:
|
||||
{
|
||||
result = sum(V*values)/sum(V);
|
||||
result = gSum(V*values)/volume_;
|
||||
break;
|
||||
}
|
||||
case opWeightedVolAverage:
|
||||
{
|
||||
result = sum(weightField*V*values)/sum(weightField*V);
|
||||
result = gSum(weightField*V*values)/gSum(weightField*V);
|
||||
break;
|
||||
}
|
||||
case opVolIntegrate:
|
||||
{
|
||||
result = sum(V*values);
|
||||
result = gSum(V*values);
|
||||
break;
|
||||
}
|
||||
case opMin:
|
||||
{
|
||||
result = min(values);
|
||||
result = gMin(values);
|
||||
break;
|
||||
}
|
||||
case opMax:
|
||||
{
|
||||
result = max(values);
|
||||
result = gMax(values);
|
||||
break;
|
||||
}
|
||||
case opCoV:
|
||||
{
|
||||
Type meanValue = sum(values*V)/sum(V);
|
||||
Type meanValue = gSum(values*V)/volume_;
|
||||
|
||||
const label nComp = pTraits<Type>::nComponents;
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ Type Foam::functionObjects::fieldValues::volRegion::processValues
|
|||
scalar mean = component(meanValue, d);
|
||||
scalar& res = setComponent(result, d);
|
||||
|
||||
res = sqrt(sum(V*sqr(vals - mean))/sum(V))/mean;
|
||||
res = sqrt(gSum(V*sqr(vals - mean))/volume_)/mean;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -173,14 +173,10 @@ bool Foam::functionObjects::fieldValues::volRegion::writeValues
|
|||
weightField = setFieldValues<scalar>(weightFieldName_, true);
|
||||
}
|
||||
|
||||
// Combine onto master
|
||||
combineFields(values);
|
||||
combineFields(V);
|
||||
combineFields(weightField);
|
||||
Type result = processValues(values, V, weightField);
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
Type result = processValues(values, V, weightField);
|
||||
|
||||
// Add to result dictionary, over-writing any previous entry
|
||||
resultDict_.add(fieldName, result, true);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ bool Foam::functionObjects::grad::calcGrad()
|
|||
(
|
||||
resultName_,
|
||||
fvc::grad(lookupObject<VolFieldType>(fieldName_)),
|
||||
true
|
||||
mesh_.changing() && mesh_.cache(resultName_)
|
||||
);
|
||||
}
|
||||
else if (foundObject<SurfaceFieldType>(fieldName_))
|
||||
|
|
@ -48,7 +48,7 @@ bool Foam::functionObjects::grad::calcGrad()
|
|||
(
|
||||
resultName_,
|
||||
fvc::grad(lookupObject<SurfaceFieldType>(fieldName_)),
|
||||
true
|
||||
mesh_.changing() && mesh_.cache(resultName_)
|
||||
);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -324,22 +324,7 @@ bool Foam::functionObjects::streamLine::read(const dictionary& dict)
|
|||
Info<< type() << " " << name() << ":" << nl;
|
||||
|
||||
dict.lookup("fields") >> fields_;
|
||||
if (dict.found("U"))
|
||||
{
|
||||
dict.lookup("U") >> UName_;
|
||||
}
|
||||
else
|
||||
{
|
||||
UName_ = "U";
|
||||
if (dict.found("U"))
|
||||
{
|
||||
IOWarningInFunction(dict)
|
||||
<< "Using deprecated entry \"U\"."
|
||||
<< " Please use \"UName\" instead."
|
||||
<< endl;
|
||||
dict.lookup("U") >> UName_;
|
||||
}
|
||||
}
|
||||
UName_ = dict.lookupOrDefault("U", word("U"));
|
||||
|
||||
if (findIndex(fields_, UName_) == -1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -40,16 +40,20 @@ Description
|
|||
libs ("libfieldFunctionObjects.so");
|
||||
...
|
||||
setFormat vtk;
|
||||
U U;
|
||||
trackForward yes;
|
||||
|
||||
fields
|
||||
(
|
||||
U
|
||||
p
|
||||
);
|
||||
|
||||
lifeTime 10000;
|
||||
trackLength 1e-3;
|
||||
nSubCycle 5;
|
||||
cloudName particleTracks;
|
||||
|
||||
seedSampleSet uniform;
|
||||
uniformCoeffs
|
||||
{
|
||||
|
|
@ -67,7 +71,7 @@ Usage
|
|||
Property | Description | Required | Default value
|
||||
type | Type name: streamLine | yes |
|
||||
setFormat | Output data type | yes |
|
||||
U | Tracking velocity field name | yes |
|
||||
U | Tracking velocity field name | no | U
|
||||
fields | Fields to sample | yes |
|
||||
lifetime | Maximum number of particle tracking steps | yes |
|
||||
trackLength | Tracking segment length | no |
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -441,24 +441,7 @@ bool Foam::functionObjects::wallBoundedStreamLine::read(const dictionary& dict)
|
|||
{
|
||||
//dict_ = dict;
|
||||
dict.lookup("fields") >> fields_;
|
||||
if (dict.found("U"))
|
||||
{
|
||||
dict.lookup("U") >> UName_;
|
||||
}
|
||||
else
|
||||
{
|
||||
UName_ = "U";
|
||||
if (dict.found("U"))
|
||||
{
|
||||
IOWarningInFunction
|
||||
(
|
||||
dict
|
||||
) << "Using deprecated entry \"U\"."
|
||||
<< " Please use \"UName\" instead."
|
||||
<< endl;
|
||||
dict.lookup("U") >> UName_;
|
||||
}
|
||||
}
|
||||
|
||||
if (findIndex(fields_, UName_) == -1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -64,6 +64,8 @@ void Foam::functionObjects::wallShearStress::calcShearStress
|
|||
volVectorField& shearStress
|
||||
)
|
||||
{
|
||||
shearStress.dimensions().reset(Reff.dimensions());
|
||||
|
||||
forAllConstIter(labelHashSet, patchSet_, iter)
|
||||
{
|
||||
label patchi = iter.key();
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ Foam::functionObjects::yPlus::yPlus
|
|||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimless, 0.0)
|
||||
|
|
@ -150,6 +150,7 @@ Foam::functionObjects::yPlus::yPlus
|
|||
|
||||
mesh.objectRegistry::store(yPlusPtr);
|
||||
|
||||
read(dict);
|
||||
resetName(typeName);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -156,6 +156,9 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict)
|
|||
// Free stream velocity magnitude
|
||||
dict.lookup("magUInf") >> magUInf_;
|
||||
|
||||
// Reference (free stream) density
|
||||
dict.lookup("rhoInf") >> rhoRef_;
|
||||
|
||||
// Reference length and area scales
|
||||
dict.lookup("lRef") >> lRef_;
|
||||
dict.lookup("Aref") >> Aref_;
|
||||
|
|
|
|||
|
|
@ -639,7 +639,7 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
|
|||
// Reference density needed for incompressible calculations
|
||||
if (rhoName_ == "rhoInf")
|
||||
{
|
||||
rhoRef_ = readScalar(dict.lookup("rhoInf"));
|
||||
dict.lookup("rhoInf") >> rhoRef_;
|
||||
}
|
||||
|
||||
// Reference pressure, 0 by default
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -254,7 +254,7 @@ bool Foam::functionObjects::scalarTransport::execute()
|
|||
FatalErrorInFunction
|
||||
<< "Incompatible dimensions for phi: " << phi.dimensions() << nl
|
||||
<< "Dimensions should be " << dimMass/dimTime << " or "
|
||||
<< dimVolume/dimTime << endl;
|
||||
<< dimVolume/dimTime << exit(FatalError);
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -47,7 +47,7 @@ namespace Foam
|
|||
);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::codedFunctionObject::prepare
|
||||
(
|
||||
|
|
@ -284,6 +284,16 @@ bool Foam::codedFunctionObject::read(const dictionary& dict)
|
|||
);
|
||||
}
|
||||
|
||||
if(!dataPtr && !readPtr && !execPtr && !writePtr && !endPtr)
|
||||
{
|
||||
IOWarningInFunction
|
||||
(
|
||||
dict
|
||||
) << "No critical \"code\" prefixed keywords were found."
|
||||
<< " Please check the code documentation for more details."
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
updateLibrary(name_);
|
||||
return redirectFunctionObject().read(dict);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -28,19 +28,20 @@ Group
|
|||
grpUtilitiesFunctionObjects
|
||||
|
||||
Description
|
||||
This function object provides a general interface to enable dynamic code
|
||||
compilation.
|
||||
Provides a general interface to enable dynamic code compilation.
|
||||
|
||||
The entries are
|
||||
codeInclude : include files
|
||||
codeOptions : include paths; inserted into EXE_INC in Make/options
|
||||
codeLibs : link line; inserted into LIB_LIBS in Make/options
|
||||
codeData : c++; local member data (null constructed);
|
||||
localCode : c++; local static functions
|
||||
codeRead : c++; upon functionObject::read();
|
||||
codeExecute : c++;upon functionObject::execute();
|
||||
codeWrite : c++; upon functionObject::write()
|
||||
codeEnd : c++; upon functionObject::end();
|
||||
The entries are:
|
||||
\plaintable
|
||||
codeInclude | include files
|
||||
codeOptions | include paths; inserted into EXE_INC in Make/options
|
||||
codeLibs | link line; inserted into LIB_LIBS in Make/options
|
||||
codeData | c++; local member data (null constructed);
|
||||
localCode | c++; local static functions;
|
||||
codeRead | c++; upon functionObject::read();
|
||||
codeExecute | c++; upon functionObject::execute();
|
||||
codeWrite | c++; upon functionObject::write()
|
||||
codeEnd | c++; upon functionObject::end();
|
||||
\endplaintable
|
||||
|
||||
Example of function object specification:
|
||||
\verbatim
|
||||
|
|
@ -56,12 +57,11 @@ Description
|
|||
// Lookup U
|
||||
const volVectorField& U = mesh().lookupObject<volVectorField>("U");
|
||||
// Write
|
||||
mag(U).write();
|
||||
}
|
||||
mag(U)().write();
|
||||
#};"
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::codedBase
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
systemCall.C
|
||||
systemCallFunctionObject.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libsystemCall
|
||||
|
|
@ -261,7 +261,12 @@ void Foam::Cloud<ParticleType>::move(TrackData& td, const scalar trackTime)
|
|||
{
|
||||
// If we are running in parallel and the particle is on a
|
||||
// boundary face
|
||||
if (Pstream::parRun() && p.face() >= pMesh().nInternalFaces())
|
||||
if
|
||||
(
|
||||
Pstream::parRun()
|
||||
&& td.switchProcessor
|
||||
&& p.face() >= pMesh().nInternalFaces()
|
||||
)
|
||||
{
|
||||
label patchi = pbm.whichPatch(p.face());
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,8 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||
pc_,
|
||||
this->Tc_,
|
||||
X,
|
||||
dMassPC
|
||||
dMassPC,
|
||||
this->rhoc_
|
||||
);
|
||||
|
||||
// Limit phase change mass by availability of each specie
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ License
|
|||
|
||||
#include "NoPhaseChange.H"
|
||||
#include "LiquidEvaporation.H"
|
||||
#include "LiquidEvaporationConvDiff.H"
|
||||
#include "LiquidEvaporationBoil.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
|
@ -39,6 +40,7 @@ License
|
|||
makePhaseChangeModel(CloudType); \
|
||||
makePhaseChangeModelType(NoPhaseChange, CloudType); \
|
||||
makePhaseChangeModelType(LiquidEvaporation, CloudType); \
|
||||
makePhaseChangeModelType(LiquidEvaporationConvDiff, CloudType); \
|
||||
makePhaseChangeModelType(LiquidEvaporationBoil, CloudType);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,8 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
) const
|
||||
{
|
||||
// immediately evaporate mass that has reached critical condition
|
||||
|
|
@ -196,8 +197,8 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
|||
// vapour concentration at surface [kmol/m3] at film temperature
|
||||
const scalar Cs = pSat/(RR*Ts);
|
||||
|
||||
// vapour concentration in bulk gas [kmol/m3] at film temperature
|
||||
const scalar Cinf = Xc[gid]*pc/(RR*Ts);
|
||||
// vapour concentration in bulk gas [kmol/m3] at bulk gas temperature
|
||||
const scalar Cinf = Xc[gid]*pc/(RR*Tc);
|
||||
|
||||
// molar flux of vapour [kmol/m2/s]
|
||||
const scalar Ni = max(kc*(Cs - Cinf), 0.0);
|
||||
|
|
|
|||
|
|
@ -119,7 +119,8 @@ public:
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
) const;
|
||||
|
||||
//- Return the enthalpy per unit mass
|
||||
|
|
|
|||
|
|
@ -142,7 +142,8 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
) const
|
||||
{
|
||||
// immediately evaporate mass that has reached critical condition
|
||||
|
|
|
|||
|
|
@ -129,7 +129,8 @@ public:
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
) const;
|
||||
|
||||
//- Return the enthalpy per unit mass
|
||||
|
|
|
|||
|
|
@ -0,0 +1,287 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "LiquidEvaporationConvDiff.H"
|
||||
#include "specie.H"
|
||||
#include "mathematicalConstants.H"
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::tmp<Foam::scalarField> Foam::LiquidEvaporationConvDiff<CloudType>::calcXc
|
||||
(
|
||||
const label celli
|
||||
) const
|
||||
{
|
||||
scalarField Xc(this->owner().thermo().carrier().Y().size());
|
||||
|
||||
forAll(Xc, i)
|
||||
{
|
||||
Xc[i] =
|
||||
this->owner().thermo().carrier().Y()[i][celli]
|
||||
/this->owner().thermo().carrier().W(i);
|
||||
}
|
||||
|
||||
return Xc/sum(Xc);
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::Sh
|
||||
(
|
||||
const scalar Re,
|
||||
const scalar Sc
|
||||
) const
|
||||
{
|
||||
return 2.0 + 0.6*Foam::sqrt(Re)*cbrt(Sc);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::LiquidEvaporationConvDiff<CloudType>::LiquidEvaporationConvDiff
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
PhaseChangeModel<CloudType>(dict, owner, typeName),
|
||||
liquids_(owner.thermo().liquids()),
|
||||
activeLiquids_(this->coeffDict().lookup("activeLiquids")),
|
||||
liqToCarrierMap_(activeLiquids_.size(), -1),
|
||||
liqToLiqMap_(activeLiquids_.size(), -1)
|
||||
{
|
||||
if (activeLiquids_.size() == 0)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Evaporation model selected, but no active liquids defined"
|
||||
<< nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Participating liquid species:" << endl;
|
||||
|
||||
// Determine mapping between liquid and carrier phase species
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
Info<< " " << activeLiquids_[i] << endl;
|
||||
liqToCarrierMap_[i] =
|
||||
owner.composition().carrierId(activeLiquids_[i]);
|
||||
}
|
||||
|
||||
// Determine mapping between model active liquids and global liquids
|
||||
const label idLiquid = owner.composition().idLiquid();
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
liqToLiqMap_[i] =
|
||||
owner.composition().localId(idLiquid, activeLiquids_[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::LiquidEvaporationConvDiff<CloudType>::LiquidEvaporationConvDiff
|
||||
(
|
||||
const LiquidEvaporationConvDiff<CloudType>& pcm
|
||||
)
|
||||
:
|
||||
PhaseChangeModel<CloudType>(pcm),
|
||||
liquids_(pcm.owner().thermo().liquids()),
|
||||
activeLiquids_(pcm.activeLiquids_),
|
||||
liqToCarrierMap_(pcm.liqToCarrierMap_),
|
||||
liqToLiqMap_(pcm.liqToLiqMap_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::LiquidEvaporationConvDiff<CloudType>::~LiquidEvaporationConvDiff()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::LiquidEvaporationConvDiff<CloudType>::calculate
|
||||
(
|
||||
const scalar dt,
|
||||
const label celli,
|
||||
const scalar Re,
|
||||
const scalar Pr,
|
||||
const scalar d,
|
||||
const scalar nu,
|
||||
const scalar T,
|
||||
const scalar Ts,
|
||||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc //POSECH
|
||||
) const
|
||||
{
|
||||
// immediately evaporate mass that has reached critical condition
|
||||
if ((liquids_.Tc(X) - T) < SMALL)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Parcel reached critical conditions: "
|
||||
<< "evaporating all avaliable mass" << endl;
|
||||
}
|
||||
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
const label lid = liqToLiqMap_[i];
|
||||
dMassPC[lid] = GREAT;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// construct carrier phase species volume fractions for cell, celli
|
||||
const scalarField Xc(calcXc(celli));
|
||||
|
||||
// calculate mass transfer of each specie in liquid
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
const label gid = liqToCarrierMap_[i];
|
||||
const label lid = liqToLiqMap_[i];
|
||||
|
||||
// vapour diffusivity [m2/s]
|
||||
const scalar Dab = liquids_.properties()[lid].D(pc, Ts);
|
||||
|
||||
// saturation pressure for species i [pa]
|
||||
// - carrier phase pressure assumed equal to the liquid vapour pressure
|
||||
// close to the surface
|
||||
// NOTE: if pSat > pc then particle is superheated
|
||||
// calculated evaporation rate will be greater than that of a particle
|
||||
// at boiling point, but this is not a boiling model
|
||||
const scalar pSat = liquids_.properties()[lid].pv(pc, T);
|
||||
|
||||
// Schmidt number
|
||||
const scalar Sc = nu/(Dab + ROOTVSMALL);
|
||||
|
||||
// Sherwood number
|
||||
const scalar Sh = this->Sh(Re, Sc);
|
||||
|
||||
// mass transfer coefficient [m/s]
|
||||
const scalar kc = Sh*Dab/(d + ROOTVSMALL);
|
||||
|
||||
// vapour concentration at surface [kmol/m3] at film temperature
|
||||
const scalar Cs = pSat/(RR*Ts);
|
||||
|
||||
// vapour concentration in bulk gas [kmol/m3] at bulk gas temperature
|
||||
const scalar Cinf = Xc[gid]*pc/(RR*Tc);
|
||||
|
||||
// molar flux of vapour [kmol/m2/s]
|
||||
const scalar Ni = max(kc*(Cs - Cinf), 0.0);
|
||||
|
||||
// droplet surface pressure assumed to surface vapour pressure
|
||||
const scalar ps = liquids_.pv(pc, Ts, X);
|
||||
|
||||
// vapour density at droplet surface [kg/m3]
|
||||
const scalar rhos = ps*liquids_.W(X)/(RR*Ts);
|
||||
|
||||
// vapour mass fraction at surface
|
||||
const scalar Ys = min((Cs*liquids_.W(X)/rhos),0.9);
|
||||
|
||||
// vapour mass fraction in bulk gas
|
||||
const scalar Yinf = Cinf*liquids_.W(X)/rhos;
|
||||
|
||||
// Spalding mass number
|
||||
const scalar Bm = max(((Ys - Yinf)/(1.0 - Ys)),0.0);
|
||||
|
||||
// mass transfer [kg]
|
||||
dMassPC[lid] += kc*pi*sqr(d)*rhoc*log(1+Bm)*dt;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::dh
|
||||
(
|
||||
const label idc,
|
||||
const label idl,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
scalar dh = 0;
|
||||
|
||||
typedef PhaseChangeModel<CloudType> parent;
|
||||
switch (parent::enthalpyTransfer_)
|
||||
{
|
||||
case (parent::etLatentHeat):
|
||||
{
|
||||
dh = liquids_.properties()[idl].hl(p, T);
|
||||
break;
|
||||
}
|
||||
case (parent::etEnthalpyDifference):
|
||||
{
|
||||
scalar hc = this->owner().composition().carrier().Ha(idc, p, T);
|
||||
scalar hp = liquids_.properties()[idl].h(p, T);
|
||||
|
||||
dh = hc - hp;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown enthalpyTransfer type" << abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return dh;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::Tvap
|
||||
(
|
||||
const scalarField& X
|
||||
) const
|
||||
{
|
||||
return liquids_.Tpt(X);
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::LiquidEvaporationConvDiff<CloudType>::TMax
|
||||
(
|
||||
const scalar p,
|
||||
const scalarField& X
|
||||
) const
|
||||
{
|
||||
return liquids_.pvInvert(p, X);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
@ -0,0 +1,157 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::LiquidEvaporationConvDiff
|
||||
|
||||
Description
|
||||
Liquid evaporation model
|
||||
- uses ideal gas assumption
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef LiquidEvaporationConvDiff_H
|
||||
#define LiquidEvaporationConvDiff_H
|
||||
|
||||
#include "PhaseChangeModel.H"
|
||||
#include "liquidMixtureProperties.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class LiquidEvaporationConvDiff Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class LiquidEvaporationConvDiff
|
||||
:
|
||||
public PhaseChangeModel<CloudType>
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Global liquid properties data
|
||||
const liquidMixtureProperties& liquids_;
|
||||
|
||||
//- List of active liquid names
|
||||
List<word> activeLiquids_;
|
||||
|
||||
//- Mapping between liquid and carrier species
|
||||
List<label> liqToCarrierMap_;
|
||||
|
||||
//- Mapping between local and global liquid species
|
||||
List<label> liqToLiqMap_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Sherwood number as a function of Reynolds and Schmidt numbers
|
||||
scalar Sh(const scalar Re, const scalar Sc) const;
|
||||
|
||||
//- Calculate the carrier phase component volume fractions at celli
|
||||
tmp<scalarField> calcXc(const label celli) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("liquidEvaporationConvDiff");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
LiquidEvaporationConvDiff(const dictionary& dict, CloudType& cloud);
|
||||
|
||||
//- Construct copy
|
||||
LiquidEvaporationConvDiff(const LiquidEvaporationConvDiff<CloudType>& pcm);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<PhaseChangeModel<CloudType>> clone() const
|
||||
{
|
||||
return autoPtr<PhaseChangeModel<CloudType>>
|
||||
(
|
||||
new LiquidEvaporationConvDiff<CloudType>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~LiquidEvaporationConvDiff();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update model
|
||||
virtual void calculate
|
||||
(
|
||||
const scalar dt,
|
||||
const label celli,
|
||||
const scalar Re,
|
||||
const scalar Pr,
|
||||
const scalar d,
|
||||
const scalar nu,
|
||||
const scalar T,
|
||||
const scalar Ts,
|
||||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
) const;
|
||||
|
||||
//- Return the enthalpy per unit mass
|
||||
virtual scalar dh
|
||||
(
|
||||
const label idc,
|
||||
const label idl,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const;
|
||||
|
||||
//- Return vapourisation temperature
|
||||
virtual scalar Tvap(const scalarField& X) const;
|
||||
|
||||
//- Return maximum/limiting temperature
|
||||
virtual scalar TMax(const scalar p, const scalarField& X) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "LiquidEvaporationConvDiff.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
@ -78,7 +78,8 @@ void Foam::NoPhaseChange<CloudType>::calculate
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
) const
|
||||
{
|
||||
// Nothing to do...
|
||||
|
|
|
|||
|
|
@ -94,7 +94,8 @@ public:
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
) const;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,8 @@ public:
|
|||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& X,
|
||||
scalarField& dMassPC
|
||||
scalarField& dMassPC,
|
||||
const scalar rhoc
|
||||
) const = 0;
|
||||
|
||||
//- Return the enthalpy per unit mass
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -53,7 +53,6 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New
|
|||
) << "Unknown coordinateRotation type "
|
||||
<< rotType << nl << nl
|
||||
<< "Valid coordinateRotation types are :" << nl
|
||||
<< "[default: axes ]"
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
|
@ -87,7 +86,6 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New
|
|||
) << "Unknown coordinateRotation type "
|
||||
<< rotType << nl << nl
|
||||
<< "Valid coordinateRotation types are :" << nl
|
||||
<< "[default: axes ]"
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
@ -35,9 +35,9 @@ License
|
|||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(meshSearch, 0);
|
||||
defineTypeNameAndDebug(meshSearch, 0);
|
||||
|
||||
scalar meshSearch::tol_ = 1e-3;
|
||||
scalar meshSearch::tol_ = 1e-3;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -117,7 +117,6 @@ Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const
|
|||
}
|
||||
|
||||
|
||||
// linear searching
|
||||
Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const
|
||||
{
|
||||
const vectorField& centres = mesh_.cellCentres();
|
||||
|
|
@ -137,7 +136,6 @@ Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const
|
|||
}
|
||||
|
||||
|
||||
// walking from seed
|
||||
Foam::label Foam::meshSearch::findNearestCellWalk
|
||||
(
|
||||
const point& location,
|
||||
|
|
@ -174,7 +172,6 @@ Foam::label Foam::meshSearch::findNearestCellWalk
|
|||
}
|
||||
|
||||
|
||||
// tree based searching
|
||||
Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
|
||||
{
|
||||
// Search nearest cell centre.
|
||||
|
|
@ -214,7 +211,6 @@ Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
|
|||
}
|
||||
|
||||
|
||||
// linear searching
|
||||
Foam::label Foam::meshSearch::findNearestFaceLinear(const point& location) const
|
||||
{
|
||||
const vectorField& centres = mesh_.faceCentres();
|
||||
|
|
@ -234,7 +230,6 @@ Foam::label Foam::meshSearch::findNearestFaceLinear(const point& location) const
|
|||
}
|
||||
|
||||
|
||||
// walking from seed
|
||||
Foam::label Foam::meshSearch::findNearestFaceWalk
|
||||
(
|
||||
const point& location,
|
||||
|
|
@ -322,7 +317,6 @@ Foam::label Foam::meshSearch::findCellLinear(const point& location) const
|
|||
}
|
||||
|
||||
|
||||
// walking from seed
|
||||
Foam::label Foam::meshSearch::findCellWalk
|
||||
(
|
||||
const point& location,
|
||||
|
|
@ -502,7 +496,10 @@ Foam::meshSearch::meshSearch
|
|||
mesh_(mesh),
|
||||
cellDecompMode_(cellDecompMode)
|
||||
{
|
||||
if (cellDecompMode_ == polyMesh::FACE_DIAG_TRIS)
|
||||
if
|
||||
(
|
||||
cellDecompMode_ == polyMesh::FACE_DIAG_TRIS
|
||||
|| cellDecompMode_ == polyMesh::CELL_TETS)
|
||||
{
|
||||
// Force construction of face diagonals
|
||||
(void)mesh.tetBasePtIs();
|
||||
|
|
@ -510,7 +507,6 @@ Foam::meshSearch::meshSearch
|
|||
}
|
||||
|
||||
|
||||
// Construct with a custom bounding box
|
||||
Foam::meshSearch::meshSearch
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
|
|
@ -523,7 +519,11 @@ Foam::meshSearch::meshSearch
|
|||
{
|
||||
overallBbPtr_.reset(new treeBoundBox(bb));
|
||||
|
||||
if (cellDecompMode_ == polyMesh::FACE_DIAG_TRIS)
|
||||
if
|
||||
(
|
||||
cellDecompMode_ == polyMesh::FACE_DIAG_TRIS
|
||||
|| cellDecompMode_ == polyMesh::CELL_TETS
|
||||
)
|
||||
{
|
||||
// Force construction of face diagonals
|
||||
(void)mesh.tetBasePtIs();
|
||||
|
|
@ -541,8 +541,8 @@ Foam::meshSearch::~meshSearch()
|
|||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
|
||||
const
|
||||
const Foam::indexedOctree<Foam::treeDataFace>&
|
||||
Foam::meshSearch::boundaryTree() const
|
||||
{
|
||||
if (!boundaryTreePtr_.valid())
|
||||
{
|
||||
|
|
@ -594,8 +594,8 @@ const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
|
|||
}
|
||||
|
||||
|
||||
const Foam::indexedOctree<Foam::treeDataCell>& Foam::meshSearch::cellTree()
|
||||
const
|
||||
const Foam::indexedOctree<Foam::treeDataCell>&
|
||||
Foam::meshSearch::cellTree() const
|
||||
{
|
||||
if (!cellTreePtr_.valid())
|
||||
{
|
||||
|
|
@ -640,92 +640,6 @@ const
|
|||
}
|
||||
|
||||
|
||||
//// Is the point in the cell
|
||||
//// Works by checking if there is a face inbetween the point and the cell
|
||||
//// centre.
|
||||
//// Check for internal uses proper face decomposition or just average normal.
|
||||
//bool Foam::meshSearch::pointInCell(const point& p, label celli) const
|
||||
//{
|
||||
// if (faceDecomp_)
|
||||
// {
|
||||
// const point& ctr = mesh_.cellCentres()[celli];
|
||||
//
|
||||
// vector dir(p - ctr);
|
||||
// scalar magDir = mag(dir);
|
||||
//
|
||||
// // Check if any faces are hit by ray from cell centre to p.
|
||||
// // If none -> p is in cell.
|
||||
// const labelList& cFaces = mesh_.cells()[celli];
|
||||
//
|
||||
// // Make sure half_ray does not pick up any faces on the wrong
|
||||
// // side of the ray.
|
||||
// scalar oldTol = intersection::setPlanarTol(0.0);
|
||||
//
|
||||
// forAll(cFaces, i)
|
||||
// {
|
||||
// label facei = cFaces[i];
|
||||
//
|
||||
// pointHit inter = mesh_.faces()[facei].ray
|
||||
// (
|
||||
// ctr,
|
||||
// dir,
|
||||
// mesh_.points(),
|
||||
// intersection::HALF_RAY,
|
||||
// intersection::VECTOR
|
||||
// );
|
||||
//
|
||||
// if (inter.hit())
|
||||
// {
|
||||
// scalar dist = inter.distance();
|
||||
//
|
||||
// if (dist < magDir)
|
||||
// {
|
||||
// // Valid hit. Hit face so point is not in cell.
|
||||
// intersection::setPlanarTol(oldTol);
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// intersection::setPlanarTol(oldTol);
|
||||
//
|
||||
// // No face inbetween point and cell centre so point is inside.
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// const labelList& f = mesh_.cells()[celli];
|
||||
// const labelList& owner = mesh_.faceOwner();
|
||||
// const vectorField& cf = mesh_.faceCentres();
|
||||
// const vectorField& Sf = mesh_.faceAreas();
|
||||
//
|
||||
// forAll(f, facei)
|
||||
// {
|
||||
// label nFace = f[facei];
|
||||
// vector proj = p - cf[nFace];
|
||||
// vector normal = Sf[nFace];
|
||||
// if (owner[nFace] == celli)
|
||||
// {
|
||||
// if ((normal & proj) > 0)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if ((normal & proj) < 0)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
Foam::label Foam::meshSearch::findNearestCell
|
||||
(
|
||||
const point& location,
|
||||
|
|
@ -941,7 +855,6 @@ bool Foam::meshSearch::isInside(const point& p) const
|
|||
}
|
||||
|
||||
|
||||
// Delete all storage
|
||||
void Foam::meshSearch::clearOut()
|
||||
{
|
||||
boundaryTreePtr_.clear();
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ Foam::labelList Foam::metisDecomp::decompose
|
|||
fineDistribution[i] = finalDecomp[agglom[i]];
|
||||
}
|
||||
|
||||
return finalDecomp;
|
||||
return fineDistribution;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ void Foam::processorMeshes::read()
|
|||
// and fields
|
||||
forAll(databases_, proci)
|
||||
{
|
||||
meshes_.set(proci, NULL);
|
||||
pointProcAddressing_.set(proci, NULL);
|
||||
faceProcAddressing_.set(proci, NULL);
|
||||
cellProcAddressing_.set(proci, NULL);
|
||||
boundaryProcAddressing_.set(proci, NULL);
|
||||
boundaryProcAddressing_.set(proci, nullptr);
|
||||
cellProcAddressing_.set(proci, nullptr);
|
||||
faceProcAddressing_.set(proci, nullptr);
|
||||
pointProcAddressing_.set(proci, nullptr);
|
||||
meshes_.set(proci, nullptr);
|
||||
}
|
||||
|
||||
forAll(databases_, proci)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue