Compare commits

..

No commits in common. "ionicWind" and "version-4.1" have entirely different histories.

142 changed files with 923 additions and 1654 deletions

View file

@ -1,23 +0,0 @@
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

View file

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
OpenFOAM is Copyright (C) 2011-2017 OpenFOAM Foundation OpenFOAM(R) is Copyright (C) 2011 OpenFOAM Foundation
Contact: OpenFOAM Foundation, http://openfoam.org/contact Contact: OpenFOAM Foundation (OpenFOAM.Foundation@gmail.com)
You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms 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 of GNU General Public License version 3, which is displayed below, or

View file

@ -1,9 +1,9 @@
#include "createMeshes.H" #include "createMeshes.H"
if (!fluidRegions.size() && !solidRegions.size()) if (!fluidRegions.size())
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "No region meshes present" << exit(FatalError); << "No fluid meshes present" << exit(FatalError);
} }
fvMesh& mesh = fluidRegions.size() ? fluidRegions[0] : solidRegions[0]; fvMesh& mesh = fluidRegions[0];

View file

@ -24,9 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "relativeVelocityModel.H" #include "relativeVelocityModel.H"
#include "fixedValueFvPatchFields.H"
#include "slipFvPatchFields.H"
#include "partialSlipFvPatchFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -36,34 +33,6 @@ namespace Foam
defineRunTimeSelectionTable(relativeVelocityModel, dictionary); 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 * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -86,12 +55,11 @@ Foam::relativeVelocityModel::relativeVelocityModel
"Udm", "Udm",
alphac_.time().timeName(), alphac_.time().timeName(),
alphac_.mesh(), alphac_.mesh(),
IOobject::READ_IF_PRESENT, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
alphac_.mesh(), alphac_.mesh(),
dimensionedVector("Udm", dimVelocity, Zero), dimensionedVector("Udm", dimVelocity, Zero)
UdmPatchFieldTypes()
) )
{} {}

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,16 +52,12 @@ class relativeVelocityModel
{ {
// Private Member Functions // Private Member Functions
//- Return the list of patchFieldTypes for Udm derived from U
wordList UdmPatchFieldTypes() const;
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
relativeVelocityModel(const relativeVelocityModel&); relativeVelocityModel(const relativeVelocityModel&);
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const relativeVelocityModel&); void operator=(const relativeVelocityModel&);
protected: protected:
// Protected data // Protected data

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -101,11 +101,7 @@ Foam::turbulentDispersionModels::Burns::D() const
*sqr(pair_.dispersed().d()) *sqr(pair_.dispersed().d())
) )
*pair_.continuous().rho() *pair_.continuous().rho()
*pair_.dispersed() *(1.0 + pair_.dispersed()/max(pair_.continuous(), residualAlpha_));
*(
1.0/max(pair_.dispersed(), residualAlpha_)
+ 1.0/max(pair_.continuous(), residualAlpha_)
);
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -101,11 +101,7 @@ Foam::turbulentDispersionModels::Burns::D() const
*sqr(pair_.dispersed().d()) *sqr(pair_.dispersed().d())
) )
*pair_.continuous().rho() *pair_.continuous().rho()
*pair_.dispersed() *(1.0 + pair_.dispersed()/max(pair_.continuous(), residualAlpha_));
*(
1.0/max(pair_.dispersed(), residualAlpha_)
+ 1.0/max(pair_.continuous(), residualAlpha_)
);
} }

View file

@ -31,7 +31,7 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \ -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
-ledgeMesh \ -ledgeMesh \
-ltriSurface \ -ltriSurface \
-ldynamicMesh \ -ldynamicMesh \

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -62,7 +62,7 @@ Foam::tmp<Foam::Field<Type>> filterFarPoints
) )
{ {
tmp<Field<Type>> tNewField(new Field<Type>(field.size())); tmp<Field<Type>> tNewField(new Field<Type>(field.size()));
Field<Type>& newField = tNewField.ref(); Field<Type>& newField = tNewField();
label added = 0; label added = 0;
label count = 0; label count = 0;
@ -160,7 +160,7 @@ Foam::tmp<Foam::triadField> buildAlignmentField(const T& mesh)
( (
new triadField(mesh.vertexCount(), triad::unset) new triadField(mesh.vertexCount(), triad::unset)
); );
triadField& alignments = tAlignments.ref(); triadField& alignments = tAlignments();
for for
( (
@ -188,7 +188,7 @@ Foam::tmp<Foam::pointField> buildPointField(const T& mesh)
( (
new pointField(mesh.vertexCount(), point(GREAT, GREAT, GREAT)) new pointField(mesh.vertexCount(), point(GREAT, GREAT, GREAT))
); );
pointField& points = tPoints.ref(); pointField& points = tPoints();
for for
( (

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,7 +30,6 @@ License
#include "scalarIOField.H" #include "scalarIOField.H"
#include "labelIOField.H" #include "labelIOField.H"
#include "pointConversion.H" #include "pointConversion.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View file

@ -30,7 +30,7 @@ EXE_LIBS = \
-lconformalVoronoiMesh \ -lconformalVoronoiMesh \
-lmeshTools \ -lmeshTools \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \ -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
-ledgeMesh \ -ledgeMesh \
-lfileFormats \ -lfileFormats \
-ltriSurface \ -ltriSurface \

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -311,7 +311,7 @@ tmp<scalarField> signedDistance
) )
{ {
tmp<scalarField> tfld(new scalarField(points.size(), Foam::sqr(GREAT))); tmp<scalarField> tfld(new scalarField(points.size(), Foam::sqr(GREAT)));
scalarField& fld = tfld.ref(); scalarField& fld = tfld();
// Find nearest // Find nearest
List<pointIndexHit> nearest; List<pointIndexHit> nearest;
@ -647,8 +647,7 @@ int main(int argc, char *argv[])
forAll(fvm.C().boundaryField(), patchi) forAll(fvm.C().boundaryField(), patchi)
{ {
const pointField& cc = fvm.C().boundaryField()[patchi]; const pointField& cc = fvm.C().boundaryField()[patchi];
fvPatchScalarField& fld = fvPatchScalarField& fld = cellDistance.boundaryField()[patchi];
cellDistance.boundaryFieldRef()[patchi];
scalarField patchDistSqr scalarField patchDistSqr
( (
fld.patch().patchInternalField(distSqr) fld.patch().patchInternalField(distSqr)

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,7 +33,6 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "CGAL/number_utils.h"
#include "CGAL/Delaunay_triangulation_2.h" #include "CGAL/Delaunay_triangulation_2.h"
#ifdef CGAL_INEXACT #ifdef CGAL_INEXACT

View file

@ -35,6 +35,6 @@ EXE_LIBS = \
-ltriSurface \ -ltriSurface \
-ldynamicMesh \ -ldynamicMesh \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \ -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
-lsampling \ -lsampling \
-lfileFormats -lfileFormats

View file

@ -15,5 +15,4 @@ EXE_LIBS = \
-lgenericPatchFields \ -lgenericPatchFields \
-lrenumberMethods \ -lrenumberMethods \
$(LINK_FLAGS) \ $(LINK_FLAGS) \
-ldecompositionMethods \ -ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp
-L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -84,12 +84,10 @@ int main(int argc, char *argv[])
#include "createNamedPolyMesh.H" #include "createNamedPolyMesh.H"
const fileName setsSubPath(mesh.dbDir()/polyMesh::meshSubDir/"sets");
// Search for list of objects for the time of the mesh // Search for list of objects for the time of the mesh
word setsInstance = runTime.findInstance word setsInstance = runTime.findInstance
( (
setsSubPath, polyMesh::meshSubDir/"sets",
word::null, word::null,
IOobject::MUST_READ, IOobject::MUST_READ,
mesh.facesInstance() mesh.facesInstance()
@ -97,7 +95,7 @@ int main(int argc, char *argv[])
IOobjectList objects(mesh, setsInstance, polyMesh::meshSubDir/"sets"); IOobjectList objects(mesh, setsInstance, polyMesh::meshSubDir/"sets");
Info<< "Searched : " << setsInstance/setsSubPath Info<< "Searched : " << setsInstance/polyMesh::meshSubDir/"sets"
<< nl << nl
<< "Found : " << objects.names() << nl << "Found : " << objects.names() << nl
<< endl; << endl;

View file

@ -8,6 +8,6 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lgenericPatchFields \ -lgenericPatchFields \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \ -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
-lmeshTools \ -lmeshTools \
-ldynamicMesh -ldynamicMesh

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,7 +42,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Turbulence constants - file-scope // turbulence constants - file-scope
static const scalar Cmu(0.09); static const scalar Cmu(0.09);
static const scalar kappa(0.41); static const scalar kappa(0.41);
@ -130,14 +130,14 @@ int main(int argc, char *argv[])
if (isA<incompressible::RASModel>(turbulence())) if (isA<incompressible::RASModel>(turbulence()))
{ {
// Calculate nut // Calculate nut - reference nut is calculated by the turbulence model
turbulence->validate(); // on its construction
tmp<volScalarField> tnut = turbulence->nut(); tmp<volScalarField> tnut = turbulence->nut();
volScalarField& nut = const_cast<volScalarField&>(tnut()); volScalarField& nut = tnut.ref();
volScalarField S(mag(dev(symm(fvc::grad(U))))); volScalarField S(mag(dev(symm(fvc::grad(U)))));
nut = (1 - mask)*nut + mask*sqr(kappa*min(y, ybl))*::sqrt(2)*S; 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 // by using nut from turbulence model
if (args.optionFound("writenut")) if (args.optionFound("writenut"))
@ -151,11 +151,11 @@ int main(int argc, char *argv[])
// Turbulence k // Turbulence k
tmp<volScalarField> tk = turbulence->k(); tmp<volScalarField> tk = turbulence->k();
volScalarField& k = const_cast<volScalarField&>(tk()); volScalarField& k = tk.ref();
scalar ck0 = pow025(Cmu)*kappa; scalar ck0 = pow025(Cmu)*kappa;
k = (1 - mask)*k + mask*sqr(nut/(ck0*min(y, ybl))); 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 // local manipulations
// k.correctBoundaryConditions(); // k.correctBoundaryConditions();
@ -165,11 +165,11 @@ int main(int argc, char *argv[])
// Turbulence epsilon // Turbulence epsilon
tmp<volScalarField> tepsilon = turbulence->epsilon(); tmp<volScalarField> tepsilon = turbulence->epsilon();
volScalarField& epsilon = const_cast<volScalarField&>(tepsilon()); volScalarField& epsilon = tepsilon.ref();
scalar ce0 = ::pow(Cmu, 0.75)/kappa; scalar ce0 = ::pow(Cmu, 0.75)/kappa;
epsilon = (1 - mask)*epsilon + mask*ce0*k*sqrt(k)/min(y, ybl); 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 // turbulence model
// epsilon.correctBoundaryConditions(); // epsilon.correctBoundaryConditions();
@ -193,7 +193,7 @@ int main(int argc, char *argv[])
dimensionedScalar k0("VSMALL", k.dimensions(), VSMALL); dimensionedScalar k0("VSMALL", k.dimensions(), VSMALL);
omega = (1 - mask)*omega + mask*epsilon/(Cmu*k + k0); 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 // turbulence model
// omega.correctBoundaryConditions(); // omega.correctBoundaryConditions();
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
volScalarField nuTilda(nuTildaHeader, mesh); volScalarField nuTilda(nuTildaHeader, mesh);
nuTilda = nut; nuTilda = nut;
// Do not correct BC // do not correct BC
// nuTilda.correctBoundaryConditions(); // nuTilda.correctBoundaryConditions();
Info<< "Writing nuTilda\n" << endl; Info<< "Writing nuTilda\n" << endl;

View file

@ -107,7 +107,7 @@ do
##DEBUG echo "remove>$wildcard<" 1>&2 ##DEBUG echo "remove>$wildcard<" 1>&2
if [ -n "$wildcard" ] if [ -n "$wildcard" ]
then then
dirList=$(echo "$dirList:" | sed -e "s|${wildcard}[^:]*:||g") dirList=$(echo "$dirList:" | sed -e "s@${wildcard}[^:]*:@@g")
fi fi
done done

View file

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -32,6 +32,6 @@
Script=${0##*/} Script=${0##*/}
echo $Script "has been superceded by the foamList utility:" echo $Script "has been superceded by the foamList utility:"
echo "foamList -switches" echo "foamList -debug"
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View file

@ -1,39 +0,0 @@
#!/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))'"
#------------------------------------------------------------------------------

View file

@ -1,37 +0,0 @@
#!/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)'"
#------------------------------------------------------------------------------

View file

@ -168,7 +168,7 @@ STRIP_FROM_INC_PATH =
# support long names like on DOS, Mac, or CD-ROM. # support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO. # The default value is: NO.
SHORT_NAMES = NO SHORT_NAMES = YES
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # 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 # first line (until the first dot) of a Javadoc-style comment as the brief

View file

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -32,7 +32,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
export WM_PROJECT=OpenFOAM export WM_PROJECT=OpenFOAM
export WM_PROJECT_VERSION=4.x export WM_PROJECT_VERSION=4.1
################################################################################ ################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade # USER EDITABLE PART: Changes made here may be lost with the next upgrade
@ -43,12 +43,15 @@ export WM_PROJECT_VERSION=4.x
# Please set to the appropriate path if the default is not correct. # Please set to the appropriate path if the default is not correct.
# #
[ $BASH_SOURCE ] && \ [ $BASH_SOURCE ] && \
export FOAM_INST_DIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) || \ export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \
export FOAM_INST_DIR=$HOME/$WM_PROJECT export FOAM_INST_DIR=$HOME/$WM_PROJECT
# export FOAM_INST_DIR=~$WM_PROJECT # export FOAM_INST_DIR=~$WM_PROJECT
# export FOAM_INST_DIR=/opt/$WM_PROJECT # export FOAM_INST_DIR=/opt/$WM_PROJECT
# export FOAM_INST_DIR=/usr/local/$WM_PROJECT # export FOAM_INST_DIR=/usr/local/$WM_PROJECT
# #
# Build foamyHexMesh
export FOAMY_HEX_MESH=yes
#
# END OF (NORMAL) USER EDITABLE PART # END OF (NORMAL) USER EDITABLE PART
################################################################################ ################################################################################

View file

@ -9,5 +9,6 @@
#includeEtc "caseDicts/postProcessing/forces/forces.cfg" #includeEtc "caseDicts/postProcessing/forces/forces.cfg"
type forceCoeffs; type forceCoeffs;
rhoInf 1; // Redundant for incompressible
// ************************************************************************* // // ************************************************************************* //

View file

@ -25,6 +25,6 @@ dragDir (1 0 0);
CofR (0 0 0); CofR (0 0 0);
pitchAxis (0 1 0); pitchAxis (0 1 0);
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg" #includeEtc "caseDicts/postProcessing/forces/forceCoeffsCompressible.cfg"
// ************************************************************************* // // ************************************************************************* //

View file

@ -8,7 +8,4 @@
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg" #includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
rho rhoInf;
rhoInf 1; // Redundant, but currently read in
// ************************************************************************* // // ************************************************************************* //

View file

@ -24,6 +24,6 @@ dragDir (1 0 0);
CofR (0 0 0); CofR (0 0 0);
pitchAxis (0 1 0); pitchAxis (0 1 0);
#includeEtc "caseDicts/postProcessing/forces/forceCoeffsIncompressible.cfg" #includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
// ************************************************************************* // // ************************************************************************* //

View file

@ -12,6 +12,7 @@ libs ("libforces.so");
writeControl timeStep; writeControl timeStep;
writeInterval 1; writeInterval 1;
rho rhoInf; // Incompressible solver
log off; log off;
// ************************************************************************* // // ************************************************************************* //

View file

@ -16,6 +16,6 @@ patches (patch1 patch2);
CofR (0 0 0); CofR (0 0 0);
pitchAxis (0 1 0); pitchAxis (0 1 0);
#includeEtc "caseDicts/postProcessing/forces/forces.cfg" #includeEtc "caseDicts/postProcessing/forces/forcesCompressible.cfg"
// ************************************************************************* // // ************************************************************************* //

View file

@ -8,6 +8,6 @@
#includeEtc "caseDicts/postProcessing/forces/forces.cfg" #includeEtc "caseDicts/postProcessing/forces/forces.cfg"
rho rhoInf; rhoInf 1; // Redundant
// ************************************************************************* // // ************************************************************************* //

View file

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/forces/forcesIncompressible.cfg" #includeEtc "caseDicts/postProcessing/forces/forces.cfg"
rhoInf 1.225; // Fluid density rhoInf 1.225; // Fluid density
patches (patch1 patch2); patches (patch1 patch2);

View file

@ -1,27 +0,0 @@
/*--------------------------------*- 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;
// ************************************************************************* //

View file

@ -34,8 +34,6 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
# Clean the PATH # 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-"` 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 if ( $status == 0 ) setenv PATH $cleaned

View file

@ -18,7 +18,7 @@ FoamFile
Documentation Documentation
{ {
docBrowser "firefox -file %f"; docBrowser "firefox %f";
doxyDocDirs doxyDocDirs
( (
"$WM_PROJECT_USER_DIR/html" "$WM_PROJECT_USER_DIR/html"

View file

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -31,7 +31,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
setenv WM_PROJECT OpenFOAM setenv WM_PROJECT OpenFOAM
setenv WM_PROJECT_VERSION 4.x setenv WM_PROJECT_VERSION 4.1
################################################################################ ################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade # USER EDITABLE PART: Changes made here may be lost with the next upgrade
@ -43,11 +43,15 @@ setenv WM_PROJECT_VERSION 4.x
# #
setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' | \ setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' | \
sed 's%/'$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 $HOME/$WM_PROJECT
# setenv FOAM_INST_DIR ~$WM_PROJECT # setenv FOAM_INST_DIR ~$WM_PROJECT
# setenv FOAM_INST_DIR /opt/$WM_PROJECT # setenv FOAM_INST_DIR /opt/$WM_PROJECT
# setenv FOAM_INST_DIR /usr/local/$WM_PROJECT # setenv FOAM_INST_DIR /usr/local/$WM_PROJECT
# #
# Build foamyHexMesh
setenv FOAMY_HEX_MESH yes
#
# END OF (NORMAL) USER EDITABLE PART # END OF (NORMAL) USER EDITABLE PART
################################################################################ ################################################################################

View file

@ -46,7 +46,7 @@ divSchemes
div(phi,K) $turbulence; div(phi,K) $turbulence;
div(phi,Ekp) $turbulence; div(phi,Ekp) $turbulence;
div(phid,p) Gauss upwind; div(phid,p) bounded Gauss upwind;
div((phi|interpolate(rho)),p) bounded Gauss upwind; div((phi|interpolate(rho)),p) bounded Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;

View file

@ -64,24 +64,23 @@ Description
libs | Libraries containing implementation | yes | libs | Libraries containing implementation | yes |
region | Name of region for multi-region cases | no | region | Name of region for multi-region cases | no |
enabled | On/off switch | no | yes enabled | On/off switch | no | yes
log | Log information to standard output | no | yes
timeStart| Start time | no | timeStart| Start time | no |
timeEnd | End time | no | timeEnd | End time | no |
executeControl | See time controls below | no | timeStep evaluateControl | See time controls below | no | timeStep
executeInterval | Steps between each execute phase | no | evaluateInterval | Steps between output | no |
writeControl | See time controls below | no | timeStep writeControl | See time controls below | no | timeStep
writeInterval | Steps between each write phase | no | writeInterval | Steps between output | no |
\endtable \endtable
Time controls: Time controls:
\table \table
Option | Description Option | Description
timeStep | Execute/write every 'Interval' time-steps timeStep | Execute/write every 'writeInterval' time-steps
writeTime | Execute/write every 'Interval' output times writeTime | Execute/write every 'writeInterval' output times
adjustableRunTime | Execute/write every 'Interval' run time period adjustableRunTime | Execute/write every 'writeInterval' run time period
runTime | Execute/write every 'Interval' run time period runTime | Execute/write every 'writeInterval' run time period
clockTime | Execute/write every 'Interval' clock time period clockTime | Execute/write every 'writeInterval' clock time period
cpuTime | Execute/write every 'Interval' CPU time period cpuTime | Execute/write every 'writeInterval' CPU time period
none | Execute/write every time-step none | Execute/write every time-step
\endtable \endtable
@ -92,14 +91,6 @@ Description
libraries and the \c libs entry is used to specify which library should be libraries and the \c libs entry is used to specify which library should be
loaded. 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 Class
Foam::functionObject Foam::functionObject

View file

@ -59,7 +59,7 @@ bool Foam::functionObjects::regionFunctionObject::store
if (cacheable && fieldName == tfield().name()) if (cacheable && fieldName == tfield().name())
{ {
WarningInFunction WarningInFunction
<< "Cannot store cache-able field with the name used in the cache." << "Cannot store cache-able field with the named used in the cache."
<< nl << nl
<< " Either choose a different name or cache the field" << " Either choose a different name or cache the field"
<< " and use the 'writeObjects' functionObject." << " and use the 'writeObjects' functionObject."

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -211,7 +211,7 @@ DimensionedField<Type, GeoMesh>::DimensionedField
const DimensionedField<Type, GeoMesh>& df const DimensionedField<Type, GeoMesh>& df
) )
: :
regIOobject(newName, df, newName != df.name()), regIOobject(newName, df, newName == df.name()),
Field<Type>(df), Field<Type>(df),
mesh_(df.mesh_), mesh_(df.mesh_),
dimensions_(df.dimensions_) dimensions_(df.dimensions_)

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1164,18 +1164,11 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
this->dimensions() = gf.dimensions(); this->dimensions() = gf.dimensions();
if (tgf.isTmp())
{
// Transfer the storage from the tmp // Transfer the storage from the tmp
primitiveFieldRef().transfer primitiveFieldRef().transfer
( (
const_cast<Field<Type>&>(gf.primitiveField()) const_cast<Field<Type>&>(gf.primitiveField())
); );
}
else
{
primitiveFieldRef() = gf.primitiveField();
}
boundaryFieldRef() = gf.boundaryField(); boundaryFieldRef() = gf.boundaryField();

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,9 +35,6 @@ namespace Foam
} }
const Foam::label Foam::lduMatrix::solver::defaultMaxIter_ = 1000;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::lduMatrix::lduMatrix(const lduMesh& mesh) Foam::lduMatrix::lduMatrix(const lduMesh& mesh)

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -106,9 +106,6 @@ public:
//- Dictionary of controls //- Dictionary of controls
dictionary controlDict_; dictionary controlDict_;
//- Default maximum number of iterations in the solver
static const label defaultMaxIter_;
//- Maximum number of iterations in the solver //- Maximum number of iterations in the solver
label maxIter_; label maxIter_;

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -157,7 +157,7 @@ Foam::lduMatrix::solver::solver
void Foam::lduMatrix::solver::readControls() void Foam::lduMatrix::solver::readControls()
{ {
maxIter_ = controlDict_.lookupOrDefault<label>("maxIter", defaultMaxIter_); maxIter_ = controlDict_.lookupOrDefault<label>("maxIter", 1000);
minIter_ = controlDict_.lookupOrDefault<label>("minIter", 0); minIter_ = controlDict_.lookupOrDefault<label>("minIter", 0);
tolerance_ = controlDict_.lookupOrDefault<scalar>("tolerance", 1e-6); tolerance_ = controlDict_.lookupOrDefault<scalar>("tolerance", 1e-6);
relTol_ = controlDict_.lookupOrDefault<scalar>("relTol", 0); relTol_ = controlDict_.lookupOrDefault<scalar>("relTol", 0);

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -204,16 +204,6 @@ 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; return solverPerf;
} }

View file

@ -223,7 +223,7 @@ Foam::solverPerformance Foam::PBiCGStab::solve
// --- Calculate omega from tA and sA // --- Calculate omega from tA and sA
// (cheaper than using zA with preconditioned tA) // (cheaper than using zA with preconditioned tA)
omega = gSumProd(tA, sA, matrix().mesh().comm())/tAtA; omega = gSumProd(tA, sA)/tAtA;
// --- Update solution and residual // --- Update solution and residual
for (label cell=0; cell<nCells; cell++) for (label cell=0; cell<nCells; cell++)

View file

@ -123,7 +123,7 @@ Foam::vector Foam::eigenValues(const tensor& t)
} }
// Two identical roots and one distinct root // Two identical roots and one distinct root
else if (mag(QQ) > SMALL && mag(PPP/QQ - 1) < SMALL) else if (mag(PPP/QQ - 1) < SMALL)
{ {
scalar sqrtP = sqrt(P); scalar sqrtP = sqrt(P);
scalar signQ = sign(Q); scalar signQ = sign(Q);

View file

@ -27,19 +27,17 @@ Class
Description Description
Polynomial templated on size (order): Polynomial templated on size (order):
\verbatim poly = sum(coeff_[i]*x^i) logCoeff*log(x)
poly = sum(coeffs[i]*x^i) + logCoeff*log(x)
\endverbatim
where <tt> 0 <= i <= N </tt> where 0 \<= i \<= N
- integer powers, starting at zero - integer powers, starting at zero
- \c value(x) to evaluate the poly for a given value - value(x) to evaluate the poly for a given value
- \c derivative(x) returns derivative at value - derivative(x) returns derivative at value
- \c integral(x1, x2) returns integral between two scalar values - integral(x1, x2) returns integral between two scalar values
- \c integral() to return a new, integral coeff polynomial - integral() to return a new, integral coeff polynomial
- increases the size (order) - increases the size (order)
- \c integralMinus1() to return a new, integral coeff polynomial where - integralMinus1() to return a new, integral coeff polynomial where
the base poly starts at order -1 the base poly starts at order -1
SourceFiles SourceFiles

View file

@ -27,18 +27,16 @@ Class
Description Description
Polynomial function representation Polynomial function representation
\verbatim poly = logCoeff*log(x) + sum(coeff_[i]*x^i)
poly = logCoeff*log(x) + sum(coeffs[i]*x^i)
\endverbatim
where <tt> 0 <= i <= N </tt> where 0 \<= i \<= N
- integer powers, starting at zero - integer powers, starting at zero
- \c value(x) to evaluate the poly for a given value - value(x) to evaluate the poly for a given value
- \c integrate(x1, x2) between two scalar values - integrate(x1, x2) between two scalar values
- \c integral() to return a new, integral coeff polynomial - integral() to return a new, integral coeff polynomial
- increases the size (order) - increases the size (order)
- \c integralMinus1() to return a new, integral coeff polynomial where - integralMinus1() to return a new, integral coeff polynomial where
the base poly starts at order -1 the base poly starts at order -1
See also See also

View file

@ -376,7 +376,7 @@ kOmegaSST<TurbulenceModel, BasicTurbulenceModel>::kOmegaSST
template<class TurbulenceModel, class BasicTurbulenceModel> template<class TurbulenceModel, class BasicTurbulenceModel>
bool kOmegaSST<TurbulenceModel, BasicTurbulenceModel>::read() bool kOmegaSST<TurbulenceModel, BasicTurbulenceModel>::read()
{ {
if (TurbulenceModel::read()) if (BasicTurbulenceModel::read())
{ {
alphaK1_.readIfPresent(this->coeffDict()); alphaK1_.readIfPresent(this->coeffDict());
alphaK2_.readIfPresent(this->coeffDict()); alphaK2_.readIfPresent(this->coeffDict());

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,7 +33,7 @@ namespace Foam
namespace LESModels namespace LESModels
{ {
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>
void dynamicLagrangian<BasicTurbulenceModel>::correctNut void dynamicLagrangian<BasicTurbulenceModel>::correctNut
@ -159,9 +159,7 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
} }
// Local references // Local references
const alphaField& alpha = this->alpha_; const surfaceScalarField& phi = this->phi_;
const rhoField& rho = this->rho_;
const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_;
const volVectorField& U = this->U_; const volVectorField& U = this->U_;
fv::options& fvOptions(fv::options::New(this->mesh_)); fv::options& fvOptions(fv::options::New(this->mesh_));
@ -185,19 +183,19 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
volScalarField invT volScalarField invT
( (
alpha*rho*(1.0/(theta_.value()*this->delta()))*pow(flm_*fmm_, 1.0/8.0) (1.0/(theta_.value()*this->delta()))*pow(flm_*fmm_, 1.0/8.0)
); );
volScalarField LM(L && M); volScalarField LM(L && M);
fvScalarMatrix flmEqn fvScalarMatrix flmEqn
( (
fvm::ddt(alpha, rho, flm_) fvm::ddt(flm_)
+ fvm::div(alphaRhoPhi, flm_) + fvm::div(phi, flm_)
== ==
invT*LM invT*LM
- fvm::Sp(invT, flm_) - fvm::Sp(invT, flm_)
+ fvOptions(alpha, rho, flm_) + fvOptions(flm_)
); );
flmEqn.relax(); flmEqn.relax();
@ -210,12 +208,12 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
fvScalarMatrix fmmEqn fvScalarMatrix fmmEqn
( (
fvm::ddt(alpha, rho, fmm_) fvm::ddt(fmm_)
+ fvm::div(alphaRhoPhi, fmm_) + fvm::div(phi, fmm_)
== ==
invT*MM invT*MM
- fvm::Sp(invT, fmm_) - fvm::Sp(invT, fmm_)
+ fvOptions(alpha, rho, fmm_) + fvOptions(fmm_)
); );
fmmEqn.relax(); fmmEqn.relax();

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -153,7 +153,7 @@ LaunderSharmaKE<BasicTurbulenceModel>::LaunderSharmaKE
( (
"C3", "C3",
this->coeffDict_, this->coeffDict_,
0 -0.33
) )
), ),
sigmak_ sigmak_
@ -273,7 +273,7 @@ void LaunderSharmaKE<BasicTurbulenceModel>::correct()
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_) - fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
== ==
C1_*alpha*rho*G*epsilon_/k_ 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_) - fvm::Sp(C2_*f2()*alpha*rho*epsilon_/k_, epsilon_)
+ alpha*rho*E + alpha*rho*E
+ epsilonSource() + epsilonSource()

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -137,7 +137,7 @@ RNGkEpsilon<BasicTurbulenceModel>::RNGkEpsilon
( (
"C3", "C3",
this->coeffDict_, this->coeffDict_,
0 -0.33
) )
), ),
sigmak_ sigmak_
@ -282,7 +282,7 @@ void RNGkEpsilon<BasicTurbulenceModel>::correct()
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_) - fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
== ==
(C1_ - R)*alpha*rho*G*epsilon_/k_ (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_) - fvm::Sp(C2_*alpha*rho*epsilon_/k_, epsilon_)
+ epsilonSource() + epsilonSource()
+ fvOptions(alpha, rho, epsilon_) + fvOptions(alpha, rho, epsilon_)

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -137,7 +137,7 @@ kEpsilon<BasicTurbulenceModel>::kEpsilon
( (
"C3", "C3",
this->coeffDict_, this->coeffDict_,
0 -0.33
) )
), ),
sigmak_ sigmak_
@ -259,7 +259,7 @@ void kEpsilon<BasicTurbulenceModel>::correct()
- fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_) - fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
== ==
C1_*alpha()*rho()*G*epsilon_()/k_() 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_) - fvm::Sp(C2_*alpha()*rho()*epsilon_()/k_(), epsilon_)
+ epsilonSource() + epsilonSource()
+ fvOptions(alpha, rho, epsilon_) + fvOptions(alpha, rho, epsilon_)

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -125,7 +125,7 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs()
void Foam::fixedShearStressFvPatchVectorField::write(Ostream& os) const void Foam::fixedShearStressFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchVectorField::write(os); fixedValueFvPatchVectorField::write(os);
os.writeKeyword("tau") << tau0_ << token::END_STATEMENT << nl; os.writeKeyword("tau") << tau0_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -153,7 +153,7 @@ public:
//- Evaluate the patchField //- Evaluate the patchField
virtual void evaluate virtual void evaluate
( (
const Pstream::commsTypes commsType=Pstream::blocking const Pstream::commsTypes commsType=Pstream::Pstream::blocking
); );

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -147,7 +147,7 @@ namespace Foam
os << nl; os << nl;
} }
} } // end namespace
template<class Type> template<class Type>
@ -183,24 +183,17 @@ void Foam::csvSetWriter<Type>::writeCoordHeader
Ostream& os Ostream& os
) const ) const
{ {
const word axisName(points.axis());
if (points.hasVectorAxis()) if (points.hasVectorAxis())
{ {
for forAll(points, i)
(
word::const_iterator iter = axisName.begin();
iter != axisName.end();
++iter
)
{ {
os << *iter; os << points.axis()[i];
writeSeparator(os); writeSeparator(os);
} }
} }
else else
{ {
os << axisName; os << points.axis();
writeSeparator(os); writeSeparator(os);
} }
} }

View file

@ -33,9 +33,6 @@ Description
\f[ \f[
p_rgh = p - \rho g.(h - hRef) p_rgh = p - \rho g.(h - hRef)
\f]
\f[
p = p0 - 0.5 \rho |U|^2 p = p0 - 0.5 \rho |U|^2
\f] \f]

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1255,7 +1255,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdtUfCorr
ddt0_<GeometricField<Type, fvPatchField, volMesh>> ddt0_<GeometricField<Type, fvPatchField, volMesh>>
( (
"ddt0(" + rho.name() + ',' + U.name() + ')', "ddt0(" + rho.name() + ',' + U.name() + ')',
rho.dimensions()*U.dimensions() U.dimensions()
); );
DDt0Field<GeometricField<Type, fvsPatchField, surfaceMesh>>& dUfdt0 = DDt0Field<GeometricField<Type, fvsPatchField, surfaceMesh>>& dUfdt0 =
@ -1350,7 +1350,7 @@ CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr
ddt0_<GeometricField<Type, fvPatchField, volMesh>> ddt0_<GeometricField<Type, fvPatchField, volMesh>>
( (
"ddt0(" + rho.name() + ',' + U.name() + ')', "ddt0(" + rho.name() + ',' + U.name() + ')',
rho.dimensions()*U.dimensions() U.dimensions()
); );
DDt0Field<fluxFieldType>& dphidt0 = DDt0Field<fluxFieldType>& dphidt0 =

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -202,8 +202,8 @@ void Foam::MULES::limiterCorr
scalarField psiMaxn(psiIf.size(), psiMin); scalarField psiMaxn(psiIf.size(), psiMin);
scalarField psiMinn(psiIf.size(), psiMax); scalarField psiMinn(psiIf.size(), psiMax);
scalarField sumPhip(psiIf.size(), 0.0); scalarField sumPhip(psiIf.size(), VSMALL);
scalarField mSumPhim(psiIf.size(), 0.0); scalarField mSumPhim(psiIf.size(), VSMALL);
forAll(phiCorrIf, facei) forAll(phiCorrIf, facei)
{ {
@ -361,7 +361,7 @@ void Foam::MULES::limiterCorr
max(min max(min
( (
(sumlPhip[celli] + psiMaxn[celli]) (sumlPhip[celli] + psiMaxn[celli])
/(mSumPhim[celli] + ROOTVSMALL), /(mSumPhim[celli] - SMALL),
1.0), 0.0 1.0), 0.0
); );
@ -369,7 +369,7 @@ void Foam::MULES::limiterCorr
max(min max(min
( (
(mSumlPhim[celli] + psiMinn[celli]) (mSumlPhim[celli] + psiMinn[celli])
/(sumPhip[celli] + ROOTVSMALL), /(sumPhip[celli] + SMALL),
1.0), 0.0 1.0), 0.0
); );
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -236,8 +236,8 @@ void Foam::MULES::limiter
scalarField sumPhiBD(psiIf.size(), 0.0); scalarField sumPhiBD(psiIf.size(), 0.0);
scalarField sumPhip(psiIf.size(), 0.0); scalarField sumPhip(psiIf.size(), VSMALL);
scalarField mSumPhim(psiIf.size(), 0.0); scalarField mSumPhim(psiIf.size(), VSMALL);
forAll(phiCorrIf, facei) forAll(phiCorrIf, facei)
{ {
@ -428,7 +428,7 @@ void Foam::MULES::limiter
max(min max(min
( (
(sumlPhip[celli] + psiMaxn[celli]) (sumlPhip[celli] + psiMaxn[celli])
/(mSumPhim[celli] + ROOTVSMALL), /(mSumPhim[celli] - SMALL),
1.0), 0.0 1.0), 0.0
); );
@ -436,7 +436,7 @@ void Foam::MULES::limiter
max(min max(min
( (
(mSumlPhim[celli] + psiMinn[celli]) (mSumlPhim[celli] + psiMinn[celli])
/(sumPhip[celli] + ROOTVSMALL), /(sumPhip[celli] + SMALL),
1.0), 0.0 1.0), 0.0
); );
} }

View file

@ -52,11 +52,11 @@ bool Foam::functionObjects::MachNo::calc()
if if
( (
foundObject<volVectorField>(fieldName_) foundObject<volVectorField>(fieldName_)
&& foundObject<fluidThermo>(fluidThermo::dictName) && mesh_.foundObject<fluidThermo>(fluidThermo::dictName)
) )
{ {
const fluidThermo& thermo = const fluidThermo& thermo =
lookupObject<fluidThermo>(fluidThermo::dictName); mesh_.lookupObject<fluidThermo>(fluidThermo::dictName);
const volVectorField& U = lookupObject<volVectorField>(fieldName_); const volVectorField& U = lookupObject<volVectorField>(fieldName_);

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,7 +40,7 @@ namespace functionObjects
} }
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::functionObjects::fieldAverage::resetFields() void Foam::functionObjects::fieldAverage::resetFields()
{ {
@ -67,27 +67,6 @@ void Foam::functionObjects::fieldAverage::resetFields()
void Foam::functionObjects::fieldAverage::initialize() 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(); resetFields();
// Add mean fields to the field lists // Add mean fields to the field lists
@ -116,11 +95,15 @@ void Foam::functionObjects::fieldAverage::initialize()
void Foam::functionObjects::fieldAverage::restart() void Foam::functionObjects::fieldAverage::restart()
{ {
Log << " Restarting averaging at time " << obr_.time().timeName() Log
<< " Restarting averaging at time " << obr_.time().timeName()
<< nl << endl; << nl << endl;
totalIter_.clear(); totalIter_.clear();
totalIter_.setSize(faItems_.size(), 1);
totalTime_.clear(); totalTime_.clear();
totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue());
initialize(); initialize();
} }
@ -151,7 +134,8 @@ void Foam::functionObjects::fieldAverage::calcAverages()
periodIndex_++; periodIndex_++;
} }
Log << type() << " " << name() << " write:" << nl Log
<< type() << " " << name() << " write:" << nl
<< " Calculating averages" << nl; << " Calculating averages" << nl;
addMeanSqrToPrime2Mean<scalar, scalar>(); addMeanSqrToPrime2Mean<scalar, scalar>();
@ -222,6 +206,12 @@ void Foam::functionObjects::fieldAverage::writeAveragingProperties() const
void Foam::functionObjects::fieldAverage::readAveragingProperties() 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) if ((restartOnRestart_ || restartOnOutput_) && log)
{ {
Info<< " Starting averaging at time " << obr_.time().timeName() Info<< " Starting averaging at time " << obr_.time().timeName()
@ -242,7 +232,8 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
if (!propsDictHeader.headerOk()) if (!propsDictHeader.headerOk())
{ {
Log << " Starting averaging at time " Log
<< " Starting averaging at time "
<< obr_.time().timeName() << nl; << obr_.time().timeName() << nl;
return; return;
@ -252,12 +243,6 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
Log << " Restarting averaging for fields:" << nl; 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) forAll(faItems_, fieldi)
{ {
const word& fieldName = faItems_[fieldi].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
@ -268,7 +253,8 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
totalIter_[fieldi] = readLabel(fieldDict.lookup("totalIter")); totalIter_[fieldi] = readLabel(fieldDict.lookup("totalIter"));
totalTime_[fieldi] = readScalar(fieldDict.lookup("totalTime")); totalTime_[fieldi] = readScalar(fieldDict.lookup("totalTime"));
Log << " " << fieldName Log
<< " " << fieldName
<< " iters = " << totalIter_[fieldi] << " iters = " << totalIter_[fieldi]
<< " time = " << totalTime_[fieldi] << nl; << " time = " << totalTime_[fieldi] << nl;
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -56,7 +56,7 @@ fieldCoordinateSystemTransform
: :
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
fieldSet_(), fieldSet_(),
coordSys_(mesh_, dict.subDict("coordinateSystem")) coordSys_(mesh_, dict)
{ {
read(dict); read(dict);

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,18 +45,13 @@ Description
UMean UMean
UPrime2Mean UPrime2Mean
); );
coordinateSystem coordinateSystem
{ {
origin (0.001 0 0); origin (0.001 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0.15 0); e1 (1 0.15 0);
e3 (0 0 -1); e3 (0 0 -1);
} }
} }
}
\endverbatim \endverbatim
Usage Usage

View file

@ -40,15 +40,11 @@ functions
coordinateSystem coordinateSystem
{ {
origin (0 0 0); origin (0.001 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0.15 0); e1 (1 0.15 0);
e3 (0 0 -1); e3 (0 0 -1);
} }
} }
} }
}
// ************************************************************************* // // ************************************************************************* //

View file

@ -39,6 +39,13 @@ namespace functionObjects
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
bool Foam::functionObjects::fieldExpression::calc()
{
NotImplemented;
return false;
}
void Foam::functionObjects::fieldExpression::setResultName void Foam::functionObjects::fieldExpression::setResultName
( (
const word& typeName, const word& typeName,
@ -114,8 +121,8 @@ bool Foam::functionObjects::fieldExpression::execute()
if (!calc()) if (!calc())
{ {
Warning Warning
<< " functionObjects::" << type() << " " << name() << "functionObject " << type() << ": Cannot find required field "
<< " failed to execute." << endl; << fieldName_ << endl;
// Clear the result field from the objectRegistry if present // Clear the result field from the objectRegistry if present
clear(); clear();

View file

@ -71,13 +71,10 @@ protected:
// Protected member functions // Protected member functions
virtual bool calc() = 0; virtual bool calc();
void setResultName(const word& typeName, const word& defaultArg); void setResultName(const word& typeName, const word& defaultArg);
template<class Type>
bool foundObject(const word& name);
private: private:
@ -136,12 +133,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "fieldExpressionTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View file

@ -1,52 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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;
}
}
// ************************************************************************* //

View file

@ -28,7 +28,7 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
This function object calculates the value and location of scalar minimum This function object calculates the value and location of scalar minimim
and maximum for a list of user-specified fields. For variables with a rank 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 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 is reported. When operating in parallel, the processor owning the value

View file

@ -84,52 +84,52 @@ Type Foam::functionObjects::fieldValues::volRegion::processValues
{ {
case opSum: case opSum:
{ {
result = gSum(values); result = sum(values);
break; break;
} }
case opSumMag: case opSumMag:
{ {
result = gSum(cmptMag(values)); result = sum(cmptMag(values));
break; break;
} }
case opAverage: case opAverage:
{ {
result = gSum(values)/nCells_; result = sum(values)/values.size();
break; break;
} }
case opWeightedAverage: case opWeightedAverage:
{ {
result = gSum(weightField*values)/gSum(weightField); result = sum(weightField*values)/sum(weightField);
break; break;
} }
case opVolAverage: case opVolAverage:
{ {
result = gSum(V*values)/volume_; result = sum(V*values)/sum(V);
break; break;
} }
case opWeightedVolAverage: case opWeightedVolAverage:
{ {
result = gSum(weightField*V*values)/gSum(weightField*V); result = sum(weightField*V*values)/sum(weightField*V);
break; break;
} }
case opVolIntegrate: case opVolIntegrate:
{ {
result = gSum(V*values); result = sum(V*values);
break; break;
} }
case opMin: case opMin:
{ {
result = gMin(values); result = min(values);
break; break;
} }
case opMax: case opMax:
{ {
result = gMax(values); result = max(values);
break; break;
} }
case opCoV: case opCoV:
{ {
Type meanValue = gSum(values*V)/volume_; Type meanValue = sum(values*V)/sum(V);
const label nComp = pTraits<Type>::nComponents; const label nComp = pTraits<Type>::nComponents;
@ -139,7 +139,7 @@ Type Foam::functionObjects::fieldValues::volRegion::processValues
scalar mean = component(meanValue, d); scalar mean = component(meanValue, d);
scalar& res = setComponent(result, d); scalar& res = setComponent(result, d);
res = sqrt(gSum(V*sqr(vals - mean))/volume_)/mean; res = sqrt(sum(V*sqr(vals - mean))/sum(V))/mean;
} }
break; break;
@ -173,10 +173,14 @@ bool Foam::functionObjects::fieldValues::volRegion::writeValues
weightField = setFieldValues<scalar>(weightFieldName_, true); weightField = setFieldValues<scalar>(weightFieldName_, true);
} }
Type result = processValues(values, V, weightField); // Combine onto master
combineFields(values);
combineFields(V);
combineFields(weightField);
if (Pstream::master()) if (Pstream::master())
{ {
Type result = processValues(values, V, weightField);
// Add to result dictionary, over-writing any previous entry // Add to result dictionary, over-writing any previous entry
resultDict_.add(fieldName, result, true); resultDict_.add(fieldName, result, true);

View file

@ -39,7 +39,7 @@ bool Foam::functionObjects::grad::calcGrad()
( (
resultName_, resultName_,
fvc::grad(lookupObject<VolFieldType>(fieldName_)), fvc::grad(lookupObject<VolFieldType>(fieldName_)),
mesh_.changing() && mesh_.cache(resultName_) true
); );
} }
else if (foundObject<SurfaceFieldType>(fieldName_)) else if (foundObject<SurfaceFieldType>(fieldName_))
@ -48,7 +48,7 @@ bool Foam::functionObjects::grad::calcGrad()
( (
resultName_, resultName_,
fvc::grad(lookupObject<SurfaceFieldType>(fieldName_)), fvc::grad(lookupObject<SurfaceFieldType>(fieldName_)),
mesh_.changing() && mesh_.cache(resultName_) true
); );
} }
else else

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -324,7 +324,22 @@ bool Foam::functionObjects::streamLine::read(const dictionary& dict)
Info<< type() << " " << name() << ":" << nl; Info<< type() << " " << name() << ":" << nl;
dict.lookup("fields") >> fields_; dict.lookup("fields") >> fields_;
UName_ = dict.lookupOrDefault("U", word("U")); 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) if (findIndex(fields_, UName_) == -1)
{ {

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,20 +40,16 @@ Description
libs ("libfieldFunctionObjects.so"); libs ("libfieldFunctionObjects.so");
... ...
setFormat vtk; setFormat vtk;
U U;
trackForward yes; trackForward yes;
fields fields
( (
U U
p p
); );
lifeTime 10000; lifeTime 10000;
trackLength 1e-3; trackLength 1e-3;
nSubCycle 5; nSubCycle 5;
cloudName particleTracks; cloudName particleTracks;
seedSampleSet uniform; seedSampleSet uniform;
uniformCoeffs uniformCoeffs
{ {
@ -71,7 +67,7 @@ Usage
Property | Description | Required | Default value Property | Description | Required | Default value
type | Type name: streamLine | yes | type | Type name: streamLine | yes |
setFormat | Output data type | yes | setFormat | Output data type | yes |
U | Tracking velocity field name | no | U U | Tracking velocity field name | yes |
fields | Fields to sample | yes | fields | Fields to sample | yes |
lifetime | Maximum number of particle tracking steps | yes | lifetime | Maximum number of particle tracking steps | yes |
trackLength | Tracking segment length | no | trackLength | Tracking segment length | no |

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -441,7 +441,24 @@ bool Foam::functionObjects::wallBoundedStreamLine::read(const dictionary& dict)
{ {
//dict_ = dict; //dict_ = dict;
dict.lookup("fields") >> fields_; dict.lookup("fields") >> fields_;
if (dict.found("U"))
{
dict.lookup("U") >> UName_; 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) if (findIndex(fields_, UName_) == -1)
{ {

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -64,8 +64,6 @@ void Foam::functionObjects::wallShearStress::calcShearStress
volVectorField& shearStress volVectorField& shearStress
) )
{ {
shearStress.dimensions().reset(Reff.dimensions());
forAllConstIter(labelHashSet, patchSet_, iter) forAllConstIter(labelHashSet, patchSet_, iter)
{ {
label patchi = iter.key(); label patchi = iter.key();

View file

@ -141,7 +141,7 @@ Foam::functionObjects::yPlus::yPlus
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("0", dimless, 0.0) dimensionedScalar("0", dimless, 0.0)
@ -150,7 +150,6 @@ Foam::functionObjects::yPlus::yPlus
mesh.objectRegistry::store(yPlusPtr); mesh.objectRegistry::store(yPlusPtr);
read(dict);
resetName(typeName); resetName(typeName);
} }

View file

@ -156,9 +156,6 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict)
// Free stream velocity magnitude // Free stream velocity magnitude
dict.lookup("magUInf") >> magUInf_; dict.lookup("magUInf") >> magUInf_;
// Reference (free stream) density
dict.lookup("rhoInf") >> rhoRef_;
// Reference length and area scales // Reference length and area scales
dict.lookup("lRef") >> lRef_; dict.lookup("lRef") >> lRef_;
dict.lookup("Aref") >> Aref_; dict.lookup("Aref") >> Aref_;

View file

@ -639,7 +639,7 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
// Reference density needed for incompressible calculations // Reference density needed for incompressible calculations
if (rhoName_ == "rhoInf") if (rhoName_ == "rhoInf")
{ {
dict.lookup("rhoInf") >> rhoRef_; rhoRef_ = readScalar(dict.lookup("rhoInf"));
} }
// Reference pressure, 0 by default // Reference pressure, 0 by default

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -254,7 +254,7 @@ bool Foam::functionObjects::scalarTransport::execute()
FatalErrorInFunction FatalErrorInFunction
<< "Incompatible dimensions for phi: " << phi.dimensions() << nl << "Incompatible dimensions for phi: " << phi.dimensions() << nl
<< "Dimensions should be " << dimMass/dimTime << " or " << "Dimensions should be " << dimMass/dimTime << " or "
<< dimVolume/dimTime << exit(FatalError); << dimVolume/dimTime << endl;
} }
Info<< endl; Info<< endl;

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,7 +47,7 @@ namespace Foam
); );
} }
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::codedFunctionObject::prepare void Foam::codedFunctionObject::prepare
( (
@ -284,16 +284,6 @@ 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_); updateLibrary(name_);
return redirectFunctionObject().read(dict); return redirectFunctionObject().read(dict);
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,20 +28,19 @@ Group
grpUtilitiesFunctionObjects grpUtilitiesFunctionObjects
Description Description
Provides a general interface to enable dynamic code compilation. This function object provides a general interface to enable dynamic code
compilation.
The entries are: The entries are
\plaintable codeInclude : include files
codeInclude | include files codeOptions : include paths; inserted into EXE_INC in Make/options
codeOptions | include paths; inserted into EXE_INC in Make/options codeLibs : link line; inserted into LIB_LIBS in Make/options
codeLibs | link line; inserted into LIB_LIBS in Make/options codeData : c++; local member data (null constructed);
codeData | c++; local member data (null constructed); localCode : c++; local static functions
localCode | c++; local static functions; codeRead : c++; upon functionObject::read();
codeRead | c++; upon functionObject::read(); codeExecute : c++;upon functionObject::execute();
codeExecute | c++; upon functionObject::execute(); codeWrite : c++; upon functionObject::write()
codeWrite | c++; upon functionObject::write() codeEnd : c++; upon functionObject::end();
codeEnd | c++; upon functionObject::end();
\endplaintable
Example of function object specification: Example of function object specification:
\verbatim \verbatim
@ -57,11 +56,12 @@ Description
// Lookup U // Lookup U
const volVectorField& U = mesh().lookupObject<volVectorField>("U"); const volVectorField& U = mesh().lookupObject<volVectorField>("U");
// Write // Write
mag(U)().write(); mag(U).write();
#};" }
} }
\endverbatim \endverbatim
See also See also
Foam::functionObject Foam::functionObject
Foam::codedBase Foam::codedBase

View file

@ -0,0 +1,4 @@
systemCall.C
systemCallFunctionObject.C
LIB = $(FOAM_LIBBIN)/libsystemCall

View file

@ -261,12 +261,7 @@ void Foam::Cloud<ParticleType>::move(TrackData& td, const scalar trackTime)
{ {
// If we are running in parallel and the particle is on a // If we are running in parallel and the particle is on a
// boundary face // boundary face
if if (Pstream::parRun() && p.face() >= pMesh().nInternalFaces())
(
Pstream::parRun()
&& td.switchProcessor
&& p.face() >= pMesh().nInternalFaces()
)
{ {
label patchi = pbm.whichPatch(p.face()); label patchi = pbm.whichPatch(p.face());

View file

@ -96,8 +96,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
pc_, pc_,
this->Tc_, this->Tc_,
X, X,
dMassPC, dMassPC
this->rhoc_
); );
// Limit phase change mass by availability of each specie // Limit phase change mass by availability of each specie

View file

@ -30,7 +30,6 @@ License
#include "NoPhaseChange.H" #include "NoPhaseChange.H"
#include "LiquidEvaporation.H" #include "LiquidEvaporation.H"
#include "LiquidEvaporationConvDiff.H"
#include "LiquidEvaporationBoil.H" #include "LiquidEvaporationBoil.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -40,7 +39,6 @@ License
makePhaseChangeModel(CloudType); \ makePhaseChangeModel(CloudType); \
makePhaseChangeModelType(NoPhaseChange, CloudType); \ makePhaseChangeModelType(NoPhaseChange, CloudType); \
makePhaseChangeModelType(LiquidEvaporation, CloudType); \ makePhaseChangeModelType(LiquidEvaporation, CloudType); \
makePhaseChangeModelType(LiquidEvaporationConvDiff, CloudType); \
makePhaseChangeModelType(LiquidEvaporationBoil, CloudType); makePhaseChangeModelType(LiquidEvaporationBoil, CloudType);

View file

@ -142,8 +142,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC, scalarField& dMassPC
const scalar rhoc
) const ) const
{ {
// immediately evaporate mass that has reached critical condition // immediately evaporate mass that has reached critical condition
@ -197,8 +196,8 @@ void Foam::LiquidEvaporation<CloudType>::calculate
// vapour concentration at surface [kmol/m3] at film temperature // vapour concentration at surface [kmol/m3] at film temperature
const scalar Cs = pSat/(RR*Ts); const scalar Cs = pSat/(RR*Ts);
// vapour concentration in bulk gas [kmol/m3] at bulk gas temperature // vapour concentration in bulk gas [kmol/m3] at film temperature
const scalar Cinf = Xc[gid]*pc/(RR*Tc); const scalar Cinf = Xc[gid]*pc/(RR*Ts);
// molar flux of vapour [kmol/m2/s] // molar flux of vapour [kmol/m2/s]
const scalar Ni = max(kc*(Cs - Cinf), 0.0); const scalar Ni = max(kc*(Cs - Cinf), 0.0);

View file

@ -119,8 +119,7 @@ public:
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC, scalarField& dMassPC
const scalar rhoc
) const; ) const;
//- Return the enthalpy per unit mass //- Return the enthalpy per unit mass

View file

@ -142,8 +142,7 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC, scalarField& dMassPC
const scalar rhoc
) const ) const
{ {
// immediately evaporate mass that has reached critical condition // immediately evaporate mass that has reached critical condition

View file

@ -129,8 +129,7 @@ public:
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC, scalarField& dMassPC
const scalar rhoc
) const; ) const;
//- Return the enthalpy per unit mass //- Return the enthalpy per unit mass

View file

@ -1,287 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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);
}
// ************************************************************************* //

View file

@ -1,157 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //

View file

@ -78,8 +78,7 @@ void Foam::NoPhaseChange<CloudType>::calculate
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC, scalarField& dMassPC
const scalar rhoc
) const ) const
{ {
// Nothing to do... // Nothing to do...

View file

@ -94,8 +94,7 @@ public:
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC, scalarField& dMassPC
const scalar rhoc
) const; ) const;
}; };

View file

@ -166,8 +166,7 @@ public:
const scalar pc, const scalar pc,
const scalar Tc, const scalar Tc,
const scalarField& X, const scalarField& X,
scalarField& dMassPC, scalarField& dMassPC
const scalar rhoc
) const = 0; ) const = 0;
//- Return the enthalpy per unit mass //- Return the enthalpy per unit mass

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -53,6 +53,7 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New
) << "Unknown coordinateRotation type " ) << "Unknown coordinateRotation type "
<< rotType << nl << nl << rotType << nl << nl
<< "Valid coordinateRotation types are :" << nl << "Valid coordinateRotation types are :" << nl
<< "[default: axes ]"
<< dictionaryConstructorTablePtr_->sortedToc() << dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError); << exit(FatalIOError);
} }
@ -86,6 +87,7 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New
) << "Unknown coordinateRotation type " ) << "Unknown coordinateRotation type "
<< rotType << nl << nl << rotType << nl << nl
<< "Valid coordinateRotation types are :" << nl << "Valid coordinateRotation types are :" << nl
<< "[default: axes ]"
<< dictionaryConstructorTablePtr_->sortedToc() << dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError); << exit(FatalIOError);
} }

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -117,6 +117,7 @@ Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const
} }
// linear searching
Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const
{ {
const vectorField& centres = mesh_.cellCentres(); const vectorField& centres = mesh_.cellCentres();
@ -136,6 +137,7 @@ Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const
} }
// walking from seed
Foam::label Foam::meshSearch::findNearestCellWalk Foam::label Foam::meshSearch::findNearestCellWalk
( (
const point& location, const point& location,
@ -172,6 +174,7 @@ Foam::label Foam::meshSearch::findNearestCellWalk
} }
// tree based searching
Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
{ {
// Search nearest cell centre. // Search nearest cell centre.
@ -211,6 +214,7 @@ Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
} }
// linear searching
Foam::label Foam::meshSearch::findNearestFaceLinear(const point& location) const Foam::label Foam::meshSearch::findNearestFaceLinear(const point& location) const
{ {
const vectorField& centres = mesh_.faceCentres(); const vectorField& centres = mesh_.faceCentres();
@ -230,6 +234,7 @@ Foam::label Foam::meshSearch::findNearestFaceLinear(const point& location) const
} }
// walking from seed
Foam::label Foam::meshSearch::findNearestFaceWalk Foam::label Foam::meshSearch::findNearestFaceWalk
( (
const point& location, const point& location,
@ -317,6 +322,7 @@ Foam::label Foam::meshSearch::findCellLinear(const point& location) const
} }
// walking from seed
Foam::label Foam::meshSearch::findCellWalk Foam::label Foam::meshSearch::findCellWalk
( (
const point& location, const point& location,
@ -496,10 +502,7 @@ Foam::meshSearch::meshSearch
mesh_(mesh), mesh_(mesh),
cellDecompMode_(cellDecompMode) cellDecompMode_(cellDecompMode)
{ {
if if (cellDecompMode_ == polyMesh::FACE_DIAG_TRIS)
(
cellDecompMode_ == polyMesh::FACE_DIAG_TRIS
|| cellDecompMode_ == polyMesh::CELL_TETS)
{ {
// Force construction of face diagonals // Force construction of face diagonals
(void)mesh.tetBasePtIs(); (void)mesh.tetBasePtIs();
@ -507,6 +510,7 @@ Foam::meshSearch::meshSearch
} }
// Construct with a custom bounding box
Foam::meshSearch::meshSearch Foam::meshSearch::meshSearch
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -519,11 +523,7 @@ Foam::meshSearch::meshSearch
{ {
overallBbPtr_.reset(new treeBoundBox(bb)); overallBbPtr_.reset(new treeBoundBox(bb));
if if (cellDecompMode_ == polyMesh::FACE_DIAG_TRIS)
(
cellDecompMode_ == polyMesh::FACE_DIAG_TRIS
|| cellDecompMode_ == polyMesh::CELL_TETS
)
{ {
// Force construction of face diagonals // Force construction of face diagonals
(void)mesh.tetBasePtIs(); (void)mesh.tetBasePtIs();
@ -541,8 +541,8 @@ Foam::meshSearch::~meshSearch()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::indexedOctree<Foam::treeDataFace>& const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
Foam::meshSearch::boundaryTree() const const
{ {
if (!boundaryTreePtr_.valid()) if (!boundaryTreePtr_.valid())
{ {
@ -594,8 +594,8 @@ Foam::meshSearch::boundaryTree() const
} }
const Foam::indexedOctree<Foam::treeDataCell>& const Foam::indexedOctree<Foam::treeDataCell>& Foam::meshSearch::cellTree()
Foam::meshSearch::cellTree() const const
{ {
if (!cellTreePtr_.valid()) if (!cellTreePtr_.valid())
{ {
@ -640,6 +640,92 @@ Foam::meshSearch::cellTree() 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 Foam::label Foam::meshSearch::findNearestCell
( (
const point& location, const point& location,
@ -855,6 +941,7 @@ bool Foam::meshSearch::isInside(const point& p) const
} }
// Delete all storage
void Foam::meshSearch::clearOut() void Foam::meshSearch::clearOut()
{ {
boundaryTreePtr_.clear(); boundaryTreePtr_.clear();

View file

@ -291,7 +291,7 @@ Foam::labelList Foam::metisDecomp::decompose
fineDistribution[i] = finalDecomp[agglom[i]]; fineDistribution[i] = finalDecomp[agglom[i]];
} }
return fineDistribution; return finalDecomp;
} }

View file

@ -35,11 +35,11 @@ void Foam::processorMeshes::read()
// and fields // and fields
forAll(databases_, proci) forAll(databases_, proci)
{ {
boundaryProcAddressing_.set(proci, nullptr); meshes_.set(proci, NULL);
cellProcAddressing_.set(proci, nullptr); pointProcAddressing_.set(proci, NULL);
faceProcAddressing_.set(proci, nullptr); faceProcAddressing_.set(proci, NULL);
pointProcAddressing_.set(proci, nullptr); cellProcAddressing_.set(proci, NULL);
meshes_.set(proci, nullptr); boundaryProcAddressing_.set(proci, NULL);
} }
forAll(databases_, proci) forAll(databases_, proci)

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