mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -526,7 +526,7 @@ $(Fields)/symmTensorField/symmTensorField.C
|
||||
$(Fields)/tensorField/tensorField.C
|
||||
$(Fields)/complexFields/complexFields.C
|
||||
|
||||
$(Fields)/labelField/labelIOField.
|
||||
$(Fields)/labelField/labelIOField.C
|
||||
$(Fields)/labelField/labelFieldIOField.C
|
||||
$(Fields)/scalarField/scalarIOField.C
|
||||
$(Fields)/scalarField/scalarFieldIOField.C
|
||||
|
||||
@ -51,8 +51,13 @@ class subCycleField
|
||||
//- Reference to the field being sub-cycled
|
||||
GeometricField& gf_;
|
||||
|
||||
//- Reference to the field old-time field being sub-cycled
|
||||
// Needed to avoid calls to oldTime() which may cause
|
||||
// unexpected updates of the old-time field
|
||||
GeometricField& gf0_;
|
||||
|
||||
//- Copy of the "real" old-time value of the field
|
||||
GeometricField gf0_;
|
||||
GeometricField gf_0_;
|
||||
|
||||
|
||||
public:
|
||||
@ -63,19 +68,33 @@ public:
|
||||
subCycleField(GeometricField& gf)
|
||||
:
|
||||
gf_(gf),
|
||||
gf0_(gf.oldTime())
|
||||
gf0_(gf.oldTime()),
|
||||
gf_0_(gf0_.name() + "_", gf0_)
|
||||
{}
|
||||
|
||||
|
||||
//- Destructor
|
||||
~subCycleField()
|
||||
{
|
||||
// Reset the old-time field
|
||||
gf0_ = gf_0_;
|
||||
|
||||
// Correct the time index of the field to correspond to the global time
|
||||
gf_.timeIndex() = gf_.time().timeIndex();
|
||||
gf0_.timeIndex() = gf_.time().timeIndex();
|
||||
}
|
||||
|
||||
// Reset the old-time field value
|
||||
gf_.oldTime() = gf0_;
|
||||
gf_.oldTime().timeIndex() = gf0_.timeIndex();
|
||||
|
||||
//- Correct the time index of the field to correspond to
|
||||
// the sub-cycling time.
|
||||
//
|
||||
// The time index is incremented to protect the old-time value from
|
||||
// being updated at the beginning of the time-loop in the case of
|
||||
// outer iteration
|
||||
void updateTimeIndex()
|
||||
{
|
||||
gf_.timeIndex() = gf_.time().timeIndex() + 1;
|
||||
gf0_.timeIndex() = gf_.time().timeIndex() + 1;
|
||||
}
|
||||
};
|
||||
|
||||
@ -106,16 +125,18 @@ public:
|
||||
//- Construct field and number of sub-cycles
|
||||
subCycle(GeometricField& gf, const label nSubCycles)
|
||||
:
|
||||
|
||||
subCycleField<GeometricField>(gf),
|
||||
subCycleTime(const_cast<Time&>(gf.time()), nSubCycles)
|
||||
{}
|
||||
{
|
||||
// Update the field time index to correspond to the sub-cycle time
|
||||
this->updateTimeIndex();
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
// End the subCycleTime, which restores the time state
|
||||
~subCycle()
|
||||
{
|
||||
// End the subCycleTime, which restores the time state
|
||||
endSubCycle();
|
||||
}
|
||||
};
|
||||
|
||||
@ -372,6 +372,12 @@ Foam::dimensionSet Foam::sqrt(const dimensionSet& ds)
|
||||
}
|
||||
|
||||
|
||||
Foam::dimensionSet Foam::cbrt(const dimensionSet& ds)
|
||||
{
|
||||
return pow(ds, 1.0/3.0);
|
||||
}
|
||||
|
||||
|
||||
Foam::dimensionSet Foam::magSqr(const dimensionSet& ds)
|
||||
{
|
||||
return pow(ds, 2);
|
||||
|
||||
@ -76,6 +76,7 @@ dimensionSet pow6(const dimensionSet&);
|
||||
dimensionSet pow025(const dimensionSet&);
|
||||
|
||||
dimensionSet sqrt(const dimensionSet&);
|
||||
dimensionSet cbrt(const dimensionSet&);
|
||||
dimensionSet magSqr(const dimensionSet&);
|
||||
dimensionSet mag(const dimensionSet&);
|
||||
dimensionSet sign(const dimensionSet&);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -377,6 +377,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
||||
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
||||
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
|
||||
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
||||
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
|
||||
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
||||
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
||||
UNARY_FUNCTION(scalar, scalar, neg, neg)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -85,6 +85,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
||||
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
||||
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
|
||||
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
||||
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
|
||||
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
||||
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
||||
UNARY_FUNCTION(scalar, scalar, neg, neg)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -105,6 +105,7 @@ UNARY_FUNCTION(scalar, scalar, pow5)
|
||||
UNARY_FUNCTION(scalar, scalar, pow6)
|
||||
UNARY_FUNCTION(scalar, scalar, pow025)
|
||||
UNARY_FUNCTION(scalar, scalar, sqrt)
|
||||
UNARY_FUNCTION(scalar, scalar, cbrt)
|
||||
UNARY_FUNCTION(scalar, scalar, sign)
|
||||
UNARY_FUNCTION(scalar, scalar, pos)
|
||||
UNARY_FUNCTION(scalar, scalar, neg)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -98,6 +98,7 @@ UNARY_FUNCTION(scalar, scalar, pow5)
|
||||
UNARY_FUNCTION(scalar, scalar, pow6)
|
||||
UNARY_FUNCTION(scalar, scalar, pow025)
|
||||
UNARY_FUNCTION(scalar, scalar, sqrt)
|
||||
UNARY_FUNCTION(scalar, scalar, cbrt)
|
||||
UNARY_FUNCTION(scalar, scalar, sign)
|
||||
UNARY_FUNCTION(scalar, scalar, pos)
|
||||
UNARY_FUNCTION(scalar, scalar, neg)
|
||||
|
||||
@ -128,6 +128,7 @@ UNARY_FUNCTION(scalar, scalar, pow5)
|
||||
UNARY_FUNCTION(scalar, scalar, pow6)
|
||||
UNARY_FUNCTION(scalar, scalar, pow025)
|
||||
UNARY_FUNCTION(scalar, scalar, sqrt)
|
||||
UNARY_FUNCTION(scalar, scalar, cbrt)
|
||||
UNARY_FUNCTION(scalar, scalar, sign)
|
||||
UNARY_FUNCTION(scalar, scalar, pos)
|
||||
UNARY_FUNCTION(scalar, scalar, neg)
|
||||
|
||||
@ -103,6 +103,7 @@ UNARY_FUNCTION(scalar, scalar, pow5)
|
||||
UNARY_FUNCTION(scalar, scalar, pow6)
|
||||
UNARY_FUNCTION(scalar, scalar, pow025)
|
||||
UNARY_FUNCTION(scalar, scalar, sqrt)
|
||||
UNARY_FUNCTION(scalar, scalar, cbrt)
|
||||
UNARY_FUNCTION(scalar, scalar, sign)
|
||||
UNARY_FUNCTION(scalar, scalar, pos)
|
||||
UNARY_FUNCTION(scalar, scalar, neg)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -448,6 +448,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
||||
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
||||
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
|
||||
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
||||
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
|
||||
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
||||
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
||||
UNARY_FUNCTION(scalar, scalar, neg, neg)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -93,6 +93,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5)
|
||||
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
|
||||
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
|
||||
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
|
||||
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
|
||||
UNARY_FUNCTION(scalar, scalar, sign, sign)
|
||||
UNARY_FUNCTION(scalar, scalar, pos, pos)
|
||||
UNARY_FUNCTION(scalar, scalar, neg, neg)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "SlicedGeometricField.H"
|
||||
#include "processorFvPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -40,7 +41,8 @@ slicedBoundaryField
|
||||
(
|
||||
const Mesh& mesh,
|
||||
const Field<Type>& completeField,
|
||||
const bool preserveCouples
|
||||
const bool preserveCouples,
|
||||
const bool preserveProcessorOnly
|
||||
)
|
||||
{
|
||||
tmp<FieldField<PatchField, Type> > tbf
|
||||
@ -52,7 +54,15 @@ slicedBoundaryField
|
||||
|
||||
forAll(mesh.boundary(), patchi)
|
||||
{
|
||||
if (preserveCouples && mesh.boundary()[patchi].coupled())
|
||||
if
|
||||
(
|
||||
preserveCouples
|
||||
&& mesh.boundary()[patchi].coupled()
|
||||
&& (
|
||||
!preserveProcessorOnly
|
||||
|| isA<processorFvPatch>(mesh.boundary()[patchi])
|
||||
)
|
||||
)
|
||||
{
|
||||
// For coupled patched construct the correct patch field type
|
||||
bf.set
|
||||
@ -243,7 +253,8 @@ SlicedGeometricField
|
||||
const dimensionSet& ds,
|
||||
const Field<Type>& completeIField,
|
||||
const Field<Type>& completeBField,
|
||||
const bool preserveCouples
|
||||
const bool preserveCouples,
|
||||
const bool preserveProcessorOnly
|
||||
)
|
||||
:
|
||||
GeometricField<Type, PatchField, GeoMesh>
|
||||
@ -252,7 +263,13 @@ SlicedGeometricField
|
||||
mesh,
|
||||
ds,
|
||||
Field<Type>(),
|
||||
slicedBoundaryField(mesh, completeBField, preserveCouples)
|
||||
slicedBoundaryField
|
||||
(
|
||||
mesh,
|
||||
completeBField,
|
||||
preserveCouples,
|
||||
preserveProcessorOnly
|
||||
)
|
||||
)
|
||||
{
|
||||
// Set the internalField to the slice of the complete field
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -83,7 +83,8 @@ private:
|
||||
(
|
||||
const Mesh& mesh,
|
||||
const Field<Type>& completeField,
|
||||
const bool preserveCouples
|
||||
const bool preserveCouples,
|
||||
const bool preserveProcessorOnly = false
|
||||
);
|
||||
|
||||
//- Slice the given field and a create a PtrList of SlicedPatchField
|
||||
@ -133,7 +134,8 @@ public:
|
||||
const dimensionSet&,
|
||||
const Field<Type>& completeIField,
|
||||
const Field<Type>& completeBField,
|
||||
const bool preserveCouples=true
|
||||
const bool preserveCouples=true,
|
||||
const bool preserveProcessorOnly = false
|
||||
);
|
||||
|
||||
//- Construct from GeometricField. Reuses full internal and
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -303,14 +303,12 @@ void Foam::meshReader::createPolyBoundary()
|
||||
|
||||
Info<< "Added " << nMissingFaces << " unmatched faces" << endl;
|
||||
|
||||
// Add missing faces to last patch ('Default_Empty' etc.)
|
||||
if (nMissingFaces > 0)
|
||||
{
|
||||
patchSizes_.last() = nMissingFaces;
|
||||
}
|
||||
else
|
||||
{
|
||||
patchStarts_.setSize(patchStarts_.size() - 1);
|
||||
}
|
||||
|
||||
|
||||
// reset the size of the face list
|
||||
meshFaces_.setSize(nCreatedFaces);
|
||||
|
||||
@ -13,5 +13,5 @@ LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lsampling \
|
||||
-lmeshTools \
|
||||
-lsolidThermo \
|
||||
/*-lsolidThermo*/ \
|
||||
-lcompressibleTurbulenceModel
|
||||
|
||||
@ -296,6 +296,12 @@ Foam::MRFZone::MRFZone
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::vector Foam::MRFZone::Omega() const
|
||||
{
|
||||
return omega_->value(mesh_.time().timeOutputValue())*axis_;
|
||||
}
|
||||
|
||||
|
||||
void Foam::MRFZone::addCoriolis
|
||||
(
|
||||
const volVectorField& U,
|
||||
@ -312,7 +318,7 @@ void Foam::MRFZone::addCoriolis
|
||||
vectorField& ddtUc = ddtU.internalField();
|
||||
const vectorField& Uc = U.internalField();
|
||||
|
||||
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
|
||||
const vector Omega = this->Omega();
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
@ -334,7 +340,7 @@ void Foam::MRFZone::addCoriolis(fvVectorMatrix& UEqn) const
|
||||
vectorField& Usource = UEqn.source();
|
||||
const vectorField& U = UEqn.psi();
|
||||
|
||||
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
|
||||
const vector Omega = this->Omega();
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
@ -360,7 +366,7 @@ void Foam::MRFZone::addCoriolis
|
||||
vectorField& Usource = UEqn.source();
|
||||
const vectorField& U = UEqn.psi();
|
||||
|
||||
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
|
||||
const vector Omega = this->Omega();
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
@ -374,7 +380,7 @@ void Foam::MRFZone::relativeVelocity(volVectorField& U) const
|
||||
{
|
||||
const volVectorField& C = mesh_.C();
|
||||
|
||||
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
|
||||
const vector Omega = this->Omega();
|
||||
|
||||
const labelList& cells = mesh_.cellZones()[cellZoneID_];
|
||||
|
||||
@ -412,7 +418,7 @@ void Foam::MRFZone::absoluteVelocity(volVectorField& U) const
|
||||
{
|
||||
const volVectorField& C = mesh_.C();
|
||||
|
||||
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
|
||||
const vector Omega = this->Omega();
|
||||
|
||||
const labelList& cells = mesh_.cellZones()[cellZoneID_];
|
||||
|
||||
@ -480,7 +486,7 @@ void Foam::MRFZone::absoluteFlux
|
||||
|
||||
void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const
|
||||
{
|
||||
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
|
||||
const vector Omega = this->Omega();
|
||||
|
||||
|
||||
// Included patches
|
||||
|
||||
@ -47,7 +47,7 @@ SourceFiles
|
||||
#include "volFieldsFwd.H"
|
||||
#include "surfaceFieldsFwd.H"
|
||||
#include "fvMatricesFwd.H"
|
||||
#include "fvMatrices.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "DataEntry.H"
|
||||
#include "autoPtr.H"
|
||||
|
||||
@ -164,6 +164,9 @@ public:
|
||||
//- Return const access to the MRF active flag
|
||||
inline bool active() const;
|
||||
|
||||
//- Return the current Omega vector
|
||||
vector Omega() const;
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ License
|
||||
#include "fvMesh.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "fvMatrices.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -133,6 +133,8 @@ void fvMesh::makeC() const
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Construct as slices. Only preserve processor (not e.g. cyclic)
|
||||
|
||||
CPtr_ = new slicedVolVectorField
|
||||
(
|
||||
IOobject
|
||||
@ -148,33 +150,10 @@ void fvMesh::makeC() const
|
||||
*this,
|
||||
dimLength,
|
||||
cellCentres(),
|
||||
faceCentres()
|
||||
faceCentres(),
|
||||
true, //preserveCouples
|
||||
true //preserveProcOnly
|
||||
);
|
||||
|
||||
|
||||
// Need to correct for cyclics transformation since absolute quantity.
|
||||
// Ok on processor patches since hold opposite cell centre (no
|
||||
// transformation)
|
||||
slicedVolVectorField& C = *CPtr_;
|
||||
|
||||
forAll(C.boundaryField(), patchi)
|
||||
{
|
||||
if
|
||||
(
|
||||
isA<cyclicFvPatchVectorField>(C.boundaryField()[patchi])
|
||||
|| isA<cyclicAMIFvPatchVectorField>(C.boundaryField()[patchi])
|
||||
)
|
||||
{
|
||||
// Note: cyclic is not slice but proper field
|
||||
C.boundaryField()[patchi] == static_cast<const vectorField&>
|
||||
(
|
||||
static_cast<const List<vector>&>
|
||||
(
|
||||
boundary_[patchi].patchSlice(faceCentres())
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/postProcessing/functionObjects/forces/lnInclude \
|
||||
|
||||
LIB_LIBS = \
|
||||
|
||||
@ -4,6 +4,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/edgeMesh/lnInclude \
|
||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||
-I$(LIB_SRC)/triSurface/lnInclude
|
||||
|
||||
@ -167,7 +167,7 @@ class autoSnapDriver
|
||||
void correctAttraction
|
||||
(
|
||||
const DynamicList<point>& surfacePoints,
|
||||
const DynamicList<label>& surfaceCount,
|
||||
const DynamicList<label>& surfaceCounts,
|
||||
const point& edgePt,
|
||||
const vector& edgeNormal, // normalised normal
|
||||
const point& pt,
|
||||
@ -213,7 +213,7 @@ class autoSnapDriver
|
||||
|
||||
DynamicList<point>& surfacePoints,
|
||||
DynamicList<vector>& surfaceNormals,
|
||||
DynamicList<label>& surfaceCount
|
||||
DynamicList<label>& surfaceCounts
|
||||
) const;
|
||||
void binFeatureFaces
|
||||
(
|
||||
@ -224,13 +224,13 @@ class autoSnapDriver
|
||||
const scalarField& snapDist,
|
||||
const label pointI,
|
||||
|
||||
const List<List<point> >& pointFaceNormals,
|
||||
const List<List<point> >& pointFaceSurfNormals,
|
||||
const List<List<point> >& pointFaceDisp,
|
||||
const List<List<point> >& pointFaceCentres,
|
||||
|
||||
DynamicList<point>& surfacePoints,
|
||||
DynamicList<vector>& surfaceNormals,
|
||||
DynamicList<label>& surfaceCount
|
||||
DynamicList<label>& surfaceCounts
|
||||
) const;
|
||||
|
||||
|
||||
@ -259,7 +259,7 @@ class autoSnapDriver
|
||||
const indirectPrimitivePatch& pp,
|
||||
const scalarField& snapDist,
|
||||
|
||||
const List<List<point> >& pointFaceNormals,
|
||||
const List<List<point> >& pointFaceSurfNormals,
|
||||
const List<List<point> >& pointFaceDisp,
|
||||
const List<List<point> >& pointFaceCentres,
|
||||
const labelListList& pointFacePatchID,
|
||||
@ -277,7 +277,7 @@ class autoSnapDriver
|
||||
const indirectPrimitivePatch&,
|
||||
const scalarField&,
|
||||
|
||||
const List<List<point> >& pointFaceNormals,
|
||||
const List<List<point> >& pointFaceSurfNormals,
|
||||
const List<List<point> >& pointFaceDisp,
|
||||
const List<List<point> >& pointFaceCentres,
|
||||
const labelListList& pointFacePatchID,
|
||||
|
||||
@ -690,7 +690,7 @@ void Foam::autoSnapDriver::calcNearestFacePointProperties
|
||||
void Foam::autoSnapDriver::correctAttraction
|
||||
(
|
||||
const DynamicList<point>& surfacePoints,
|
||||
const DynamicList<label>& surfaceCount,
|
||||
const DynamicList<label>& surfaceCounts,
|
||||
const point& edgePt,
|
||||
const vector& edgeNormal, // normalised normal
|
||||
const point& pt,
|
||||
@ -702,7 +702,7 @@ void Foam::autoSnapDriver::correctAttraction
|
||||
scalar tang = ((pt-edgePt)&edgeNormal);
|
||||
|
||||
labelList order;
|
||||
Foam::sortedOrder(surfaceCount, order);
|
||||
Foam::sortedOrder(surfaceCounts, order);
|
||||
|
||||
if (order[0] < order[1])
|
||||
{
|
||||
@ -763,7 +763,7 @@ void Foam::autoSnapDriver::binFeatureFace
|
||||
|
||||
DynamicList<point>& surfacePoints,
|
||||
DynamicList<vector>& surfaceNormals,
|
||||
DynamicList<label>& surfaceCount
|
||||
DynamicList<label>& surfaceCounts
|
||||
) const
|
||||
{
|
||||
// What to do with very far attraction? For now just ignore the face
|
||||
@ -783,7 +783,7 @@ void Foam::autoSnapDriver::binFeatureFace
|
||||
)
|
||||
{
|
||||
same = true;
|
||||
surfaceCount[j]++;
|
||||
surfaceCounts[j]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -796,7 +796,7 @@ void Foam::autoSnapDriver::binFeatureFace
|
||||
{
|
||||
surfacePoints.append(pt);
|
||||
surfaceNormals.append(faceSurfaceNormal);
|
||||
surfaceCount.append(1);
|
||||
surfaceCounts.append(1);
|
||||
}
|
||||
else if (surfacePoints.size() == 2)
|
||||
{
|
||||
@ -810,7 +810,7 @@ void Foam::autoSnapDriver::binFeatureFace
|
||||
// Definitely makes a feature point
|
||||
surfacePoints.append(pt);
|
||||
surfaceNormals.append(faceSurfaceNormal);
|
||||
surfaceCount.append(1);
|
||||
surfaceCounts.append(1);
|
||||
}
|
||||
}
|
||||
else if (surfacePoints.size() == 3)
|
||||
@ -834,7 +834,7 @@ void Foam::autoSnapDriver::binFeatureFace
|
||||
// Different feature point
|
||||
surfacePoints.append(pt);
|
||||
surfaceNormals.append(faceSurfaceNormal);
|
||||
surfaceCount.append(1);
|
||||
surfaceCounts.append(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -860,15 +860,15 @@ void Foam::autoSnapDriver::binFeatureFaces
|
||||
|
||||
DynamicList<point>& surfacePoints,
|
||||
DynamicList<vector>& surfaceNormals,
|
||||
DynamicList<label>& surfaceCount
|
||||
DynamicList<label>& surfaceCounts
|
||||
) const
|
||||
{
|
||||
const List<point>& pfNormals = pointFaceSurfNormals[pointI];
|
||||
const List<point>& pfSurfNormals = pointFaceSurfNormals[pointI];
|
||||
const List<point>& pfDisp = pointFaceDisp[pointI];
|
||||
const List<point>& pfCentres = pointFaceCentres[pointI];
|
||||
|
||||
// Collect all different directions
|
||||
forAll(pfNormals, i)
|
||||
forAll(pfSurfNormals, i)
|
||||
{
|
||||
binFeatureFace
|
||||
(
|
||||
@ -879,12 +879,12 @@ void Foam::autoSnapDriver::binFeatureFaces
|
||||
snapDist[pointI],
|
||||
|
||||
pfCentres[i],
|
||||
pfNormals[i],
|
||||
pfSurfNormals[i],
|
||||
pfDisp[i],
|
||||
|
||||
surfacePoints,
|
||||
surfaceNormals,
|
||||
surfaceCount
|
||||
surfaceCounts
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -914,7 +914,7 @@ void Foam::autoSnapDriver::featureAttractionUsingReconstruction
|
||||
// Collect all different directions
|
||||
DynamicList<point> surfacePoints(4);
|
||||
DynamicList<vector> surfaceNormals(4);
|
||||
DynamicList<label> surfaceCount(4);
|
||||
DynamicList<label> surfaceCounts(4);
|
||||
|
||||
binFeatureFaces
|
||||
(
|
||||
@ -931,7 +931,7 @@ void Foam::autoSnapDriver::featureAttractionUsingReconstruction
|
||||
|
||||
surfacePoints,
|
||||
surfaceNormals,
|
||||
surfaceCount
|
||||
surfaceCounts
|
||||
);
|
||||
|
||||
const point& pt = pp.localPoints()[pointI];
|
||||
@ -966,11 +966,13 @@ void Foam::autoSnapDriver::featureAttractionUsingReconstruction
|
||||
vector d = r.refPoint()-pt;
|
||||
d -= (d&n)*n;
|
||||
|
||||
//- This does not help much but distorts a perfectly aligned mesh
|
||||
// so disabled for now.
|
||||
//// Correct for attraction to non-dominant face
|
||||
//correctAttraction
|
||||
//(
|
||||
// surfacePoints,
|
||||
// surfaceCount,
|
||||
// surfaceCounts,
|
||||
// r.refPoint(),
|
||||
// n, // normalised normal
|
||||
// pt,
|
||||
@ -1813,8 +1815,8 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
|
||||
}
|
||||
|
||||
// Reverse: from pp point to nearest feature
|
||||
vectorField allPatchAttraction(pp.nPoints(), vector::zero);
|
||||
List<pointConstraint> allPatchConstraints(pp.nPoints());
|
||||
vectorField rawPatchAttraction(pp.nPoints(), vector::zero);
|
||||
List<pointConstraint> rawPatchConstraints(pp.nPoints());
|
||||
|
||||
determineFeatures
|
||||
(
|
||||
@ -1837,15 +1839,15 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
|
||||
edgeAttractors,
|
||||
edgeConstraints,
|
||||
// pp point to nearest feature
|
||||
allPatchAttraction,
|
||||
allPatchConstraints
|
||||
rawPatchAttraction,
|
||||
rawPatchConstraints
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Baffle handling
|
||||
// ~~~~~~~~~~~~~~~
|
||||
// Override pointAttractor, edgeAttractor, allPatchAttration etc. to
|
||||
// Override pointAttractor, edgeAttractor, rawPatchAttration etc. to
|
||||
// implement 'baffle' handling.
|
||||
// Baffle: the mesh pp point originates from a loose standing
|
||||
// baffle.
|
||||
@ -1983,8 +1985,8 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
|
||||
featI,
|
||||
edgeAttractors,
|
||||
edgeConstraints,
|
||||
allPatchAttraction,
|
||||
allPatchConstraints
|
||||
rawPatchAttraction,
|
||||
rawPatchConstraints
|
||||
);
|
||||
|
||||
if (!nearInfo.hit())
|
||||
@ -2033,8 +2035,8 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
|
||||
vector::zero;
|
||||
|
||||
// Store for later use
|
||||
allPatchAttraction[pointI] = featPt-pt;
|
||||
allPatchConstraints[pointI] =
|
||||
rawPatchAttraction[pointI] = featPt-pt;
|
||||
rawPatchConstraints[pointI] =
|
||||
pointConstraints[featI][featPointI];
|
||||
|
||||
if (oldPointI != -1)
|
||||
@ -2053,8 +2055,8 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
|
||||
edgeFeatI,
|
||||
edgeAttractors,
|
||||
edgeConstraints,
|
||||
allPatchAttraction,
|
||||
allPatchConstraints
|
||||
rawPatchAttraction,
|
||||
rawPatchConstraints
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -2084,8 +2086,8 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
|
||||
featI,
|
||||
edgeAttractors,
|
||||
edgeConstraints,
|
||||
allPatchAttraction,
|
||||
allPatchConstraints
|
||||
rawPatchAttraction,
|
||||
rawPatchConstraints
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -2296,11 +2298,11 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
|
||||
if
|
||||
(
|
||||
patchConstraints[pointI].first() <= 1
|
||||
&& allPatchConstraints[pointI].first() > 1
|
||||
&& rawPatchConstraints[pointI].first() > 1
|
||||
)
|
||||
{
|
||||
patchAttraction[pointI] = allPatchAttraction[pointI];
|
||||
patchConstraints[pointI] = allPatchConstraints[pointI];
|
||||
patchAttraction[pointI] = rawPatchAttraction[pointI];
|
||||
patchConstraints[pointI] = rawPatchConstraints[pointI];
|
||||
|
||||
if (multiPatchStr.valid())
|
||||
{
|
||||
@ -2434,7 +2436,7 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
|
||||
// Snap edges to feature edges
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Walk existing edges and snap remaining ones (that are marked as
|
||||
// feature edges in allPatchConstraints)
|
||||
// feature edges in rawPatchConstraints)
|
||||
|
||||
stringFeatureEdges
|
||||
(
|
||||
@ -2444,8 +2446,8 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
|
||||
pp,
|
||||
snapDist,
|
||||
|
||||
allPatchAttraction,
|
||||
allPatchConstraints,
|
||||
rawPatchAttraction,
|
||||
rawPatchConstraints,
|
||||
|
||||
patchAttraction,
|
||||
patchConstraints
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/triSurface/lnInclude
|
||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-ltriSurface
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -27,12 +27,42 @@ License
|
||||
#include "searchableSurfacesQueries.H"
|
||||
#include "ListOps.H"
|
||||
#include "Time.H"
|
||||
//#include "vtkSetWriter.H"
|
||||
#include "DynamicField.H"
|
||||
//#include "OBJstream.H"
|
||||
#include "PatchTools.H"
|
||||
#include "triSurfaceMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(Foam::searchableSurfaces, 0);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
//- Is edge connected to triangle
|
||||
bool Foam::searchableSurfaces::connected
|
||||
(
|
||||
const triSurface& s,
|
||||
const label edgeI,
|
||||
const pointIndexHit& hit
|
||||
)
|
||||
{
|
||||
const triFace& localFace = s.localFaces()[hit.index()];
|
||||
const edge& e = s.edges()[edgeI];
|
||||
|
||||
forAll(localFace, i)
|
||||
{
|
||||
if (e.otherVertex(localFace[i]) != -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct with length.
|
||||
@ -378,6 +408,468 @@ Foam::pointIndexHit Foam::searchableSurfaces::facesIntersection
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::searchableSurfaces::checkClosed(const bool report) const
|
||||
{
|
||||
if (report)
|
||||
{
|
||||
Info<< "Checking for closedness." << endl;
|
||||
}
|
||||
|
||||
bool hasError = false;
|
||||
|
||||
forAll(*this, surfI)
|
||||
{
|
||||
if (!operator[](surfI).hasVolumeType())
|
||||
{
|
||||
hasError = true;
|
||||
|
||||
if (report)
|
||||
{
|
||||
Info<< " " << names()[surfI]
|
||||
<< " : not closed" << endl;
|
||||
}
|
||||
|
||||
if (isA<triSurface>(operator[](surfI)))
|
||||
{
|
||||
const triSurface& s = dynamic_cast<const triSurface&>
|
||||
(
|
||||
operator[](surfI)
|
||||
);
|
||||
const labelListList& edgeFaces = s.edgeFaces();
|
||||
|
||||
label nSingleEdges = 0;
|
||||
forAll(edgeFaces, edgeI)
|
||||
{
|
||||
if (edgeFaces[edgeI].size() == 1)
|
||||
{
|
||||
nSingleEdges++;
|
||||
}
|
||||
}
|
||||
|
||||
label nMultEdges = 0;
|
||||
forAll(edgeFaces, edgeI)
|
||||
{
|
||||
if (edgeFaces[edgeI].size() > 2)
|
||||
{
|
||||
nMultEdges++;
|
||||
}
|
||||
}
|
||||
|
||||
if (report && (nSingleEdges != 0 || nMultEdges != 0))
|
||||
{
|
||||
Info<< " connected to one face : "
|
||||
<< nSingleEdges << nl
|
||||
<< " connected to >2 faces : "
|
||||
<< nMultEdges << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (report)
|
||||
{
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return returnReduce(hasError, orOp<bool>());
|
||||
}
|
||||
|
||||
|
||||
bool Foam::searchableSurfaces::checkNormalOrientation(const bool report) const
|
||||
{
|
||||
if (report)
|
||||
{
|
||||
Info<< "Checking for normal orientation." << endl;
|
||||
}
|
||||
|
||||
bool hasError = false;
|
||||
|
||||
forAll(*this, surfI)
|
||||
{
|
||||
if (isA<triSurface>(operator[](surfI)))
|
||||
{
|
||||
const triSurface& s = dynamic_cast<const triSurface&>
|
||||
(
|
||||
operator[](surfI)
|
||||
);
|
||||
|
||||
labelHashSet borderEdge(s.size()/1000);
|
||||
PatchTools::checkOrientation(s, false, &borderEdge);
|
||||
// Colour all faces into zones using borderEdge
|
||||
labelList normalZone;
|
||||
label nZones = PatchTools::markZones(s, borderEdge, normalZone);
|
||||
if (nZones > 1)
|
||||
{
|
||||
hasError = true;
|
||||
|
||||
if (report)
|
||||
{
|
||||
Info<< " " << names()[surfI]
|
||||
<< " : has multiple orientation zones ("
|
||||
<< nZones << ")" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (report)
|
||||
{
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return returnReduce(hasError, orOp<bool>());
|
||||
}
|
||||
|
||||
|
||||
bool Foam::searchableSurfaces::checkSizes
|
||||
(
|
||||
const scalar maxRatio,
|
||||
const bool report
|
||||
) const
|
||||
{
|
||||
if (report)
|
||||
{
|
||||
Info<< "Checking for size." << endl;
|
||||
}
|
||||
|
||||
bool hasError = false;
|
||||
|
||||
forAll(*this, i)
|
||||
{
|
||||
const boundBox& bb = operator[](i).bounds();
|
||||
|
||||
for (label j = i+1; j < size(); j++)
|
||||
{
|
||||
scalar ratio = bb.mag()/operator[](j).bounds().mag();
|
||||
|
||||
if (ratio > maxRatio || ratio < 1.0/maxRatio)
|
||||
{
|
||||
hasError = true;
|
||||
|
||||
if (report)
|
||||
{
|
||||
Info<< " " << names()[i]
|
||||
<< " bounds differ from " << names()[j]
|
||||
<< " by more than a factor 100:" << nl
|
||||
<< " bounding box : " << bb << nl
|
||||
<< " bounding box : " << operator[](j).bounds()
|
||||
<< endl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (report)
|
||||
{
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return returnReduce(hasError, orOp<bool>());
|
||||
}
|
||||
|
||||
|
||||
bool Foam::searchableSurfaces::checkIntersection
|
||||
(
|
||||
const scalar tolerance,
|
||||
const autoPtr<writer<scalar> >& setWriter,
|
||||
const bool report
|
||||
) const
|
||||
{
|
||||
if (report)
|
||||
{
|
||||
Info<< "Checking for intersection." << endl;
|
||||
}
|
||||
|
||||
//cpuTime timer;
|
||||
|
||||
bool hasError = false;
|
||||
|
||||
forAll(*this, i)
|
||||
{
|
||||
if (isA<triSurfaceMesh>(operator[](i)))
|
||||
{
|
||||
const triSurfaceMesh& s0 = dynamic_cast<const triSurfaceMesh&>
|
||||
(
|
||||
operator[](i)
|
||||
);
|
||||
const edgeList& edges0 = s0.edges();
|
||||
const pointField& localPoints0 = s0.localPoints();
|
||||
|
||||
// Collect all the edge vectors
|
||||
pointField start(edges0.size());
|
||||
pointField end(edges0.size());
|
||||
forAll(edges0, edgeI)
|
||||
{
|
||||
const edge& e = edges0[edgeI];
|
||||
start[edgeI] = localPoints0[e[0]];
|
||||
end[edgeI] = localPoints0[e[1]];
|
||||
}
|
||||
|
||||
// Test all other surfaces for intersection
|
||||
forAll(*this, j)
|
||||
{
|
||||
List<pointIndexHit> hits;
|
||||
|
||||
if (i == j)
|
||||
{
|
||||
// Slightly shorten the edges to prevent finding lots of
|
||||
// intersections. The fast triangle intersection routine
|
||||
// has problems with rays passing through a point of the
|
||||
// triangle.
|
||||
vectorField d
|
||||
(
|
||||
max(tolerance, 10*s0.tolerance())
|
||||
*(end-start)
|
||||
);
|
||||
start += d;
|
||||
end -= d;
|
||||
}
|
||||
|
||||
operator[](j).findLineAny(start, end, hits);
|
||||
|
||||
label nHits = 0;
|
||||
DynamicField<point> intersections(edges0.size()/100);
|
||||
DynamicField<scalar> intersectionEdge(intersections.capacity());
|
||||
|
||||
forAll(hits, edgeI)
|
||||
{
|
||||
if
|
||||
(
|
||||
hits[edgeI].hit()
|
||||
&& (i != j || !connected(s0, edgeI, hits[edgeI]))
|
||||
)
|
||||
{
|
||||
intersections.append(hits[edgeI].hitPoint());
|
||||
intersectionEdge.append(1.0*edgeI);
|
||||
nHits++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nHits > 0)
|
||||
{
|
||||
if (report)
|
||||
{
|
||||
Info<< " " << names()[i]
|
||||
<< " intersects " << names()[j]
|
||||
<< " at " << nHits
|
||||
<< " locations."
|
||||
<< endl;
|
||||
|
||||
//vtkSetWriter<scalar> setWriter;
|
||||
if (setWriter.valid())
|
||||
{
|
||||
scalarField dist(mag(intersections));
|
||||
coordSet track
|
||||
(
|
||||
names()[i] + '_' + names()[j],
|
||||
"xyz",
|
||||
intersections.xfer(),
|
||||
dist
|
||||
);
|
||||
wordList valueSetNames(1, "edgeIndex");
|
||||
List<const scalarField*> valueSets
|
||||
(
|
||||
1,
|
||||
&intersectionEdge
|
||||
);
|
||||
|
||||
fileName fName
|
||||
(
|
||||
setWriter().getFileName(track, valueSetNames)
|
||||
);
|
||||
Info<< " Writing intersection locations to "
|
||||
<< fName << endl;
|
||||
OFstream os
|
||||
(
|
||||
s0.searchableSurface::time().path()
|
||||
/fName
|
||||
);
|
||||
setWriter().write
|
||||
(
|
||||
track,
|
||||
valueSetNames,
|
||||
valueSets,
|
||||
os
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
hasError = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (report)
|
||||
{
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return returnReduce(hasError, orOp<bool>());
|
||||
}
|
||||
|
||||
|
||||
bool Foam::searchableSurfaces::checkQuality
|
||||
(
|
||||
const scalar minQuality,
|
||||
const bool report
|
||||
) const
|
||||
{
|
||||
if (report)
|
||||
{
|
||||
Info<< "Checking for triangle quality." << endl;
|
||||
}
|
||||
|
||||
bool hasError = false;
|
||||
|
||||
forAll(*this, surfI)
|
||||
{
|
||||
if (isA<triSurface>(operator[](surfI)))
|
||||
{
|
||||
const triSurface& s = dynamic_cast<const triSurface&>
|
||||
(
|
||||
operator[](surfI)
|
||||
);
|
||||
|
||||
label nBadTris = 0;
|
||||
forAll(s, faceI)
|
||||
{
|
||||
const labelledTri& f = s[faceI];
|
||||
|
||||
scalar q = triPointRef
|
||||
(
|
||||
s.points()[f[0]],
|
||||
s.points()[f[1]],
|
||||
s.points()[f[2]]
|
||||
).quality();
|
||||
|
||||
if (q < minQuality)
|
||||
{
|
||||
nBadTris++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nBadTris > 0)
|
||||
{
|
||||
hasError = true;
|
||||
|
||||
if (report)
|
||||
{
|
||||
Info<< " " << names()[surfI]
|
||||
<< " : has " << nBadTris << " bad quality triangles "
|
||||
<< " (quality < " << minQuality << ")" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (report)
|
||||
{
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return returnReduce(hasError, orOp<bool>());
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Check all surfaces. Return number of failures.
|
||||
Foam::label Foam::searchableSurfaces::checkTopology
|
||||
(
|
||||
const bool report
|
||||
) const
|
||||
{
|
||||
label noFailedChecks = 0;
|
||||
|
||||
if (checkClosed(report))
|
||||
{
|
||||
noFailedChecks++;
|
||||
}
|
||||
|
||||
if (checkNormalOrientation(report))
|
||||
{
|
||||
noFailedChecks++;
|
||||
}
|
||||
return noFailedChecks;
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::searchableSurfaces::checkGeometry
|
||||
(
|
||||
const scalar maxRatio,
|
||||
const scalar tol,
|
||||
const autoPtr<writer<scalar> >& setWriter,
|
||||
const scalar minQuality,
|
||||
const bool report
|
||||
) const
|
||||
{
|
||||
label noFailedChecks = 0;
|
||||
|
||||
if (maxRatio > 0 && checkSizes(maxRatio, report))
|
||||
{
|
||||
noFailedChecks++;
|
||||
}
|
||||
|
||||
if (checkIntersection(tol, setWriter, report))
|
||||
{
|
||||
noFailedChecks++;
|
||||
}
|
||||
|
||||
if (checkQuality(minQuality, report))
|
||||
{
|
||||
noFailedChecks++;
|
||||
}
|
||||
|
||||
return noFailedChecks;
|
||||
}
|
||||
|
||||
|
||||
void Foam::searchableSurfaces::writeStats
|
||||
(
|
||||
const List<wordList>& patchTypes,
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
Info<< "Statistics." << endl;
|
||||
forAll(*this, surfI)
|
||||
{
|
||||
Info<< " " << names()[surfI] << ':' << endl;
|
||||
|
||||
const searchableSurface& s = operator[](surfI);
|
||||
|
||||
Info<< " type : " << s.type() << nl
|
||||
<< " size : " << s.globalSize() << nl;
|
||||
if (isA<triSurfaceMesh>(s))
|
||||
{
|
||||
const triSurfaceMesh& ts = dynamic_cast<const triSurfaceMesh&>(s);
|
||||
Info<< " edges : " << ts.nEdges() << nl
|
||||
<< " points : " << ts.points().size() << nl;
|
||||
}
|
||||
Info<< " bounds : " << s.bounds() << nl
|
||||
<< " closed : " << Switch(s.hasVolumeType()) << endl;
|
||||
|
||||
if (patchTypes.size() && patchTypes[surfI].size() >= 1)
|
||||
{
|
||||
wordList unique(HashSet<word>(patchTypes[surfI]).sortedToc());
|
||||
Info<< " patches : ";
|
||||
forAll(unique, i)
|
||||
{
|
||||
Info<< unique[i];
|
||||
if (i < unique.size()-1)
|
||||
{
|
||||
Info<< ',';
|
||||
}
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::searchableSurface& Foam::searchableSurfaces::operator[]
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,6 +37,7 @@ SourceFiles
|
||||
|
||||
#include "searchableSurface.H"
|
||||
#include "labelPair.H"
|
||||
#include "writer.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -44,6 +45,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class triSurface;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class searchableSurfaces Declaration
|
||||
@ -70,6 +72,15 @@ class searchableSurfaces
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Is edge on face
|
||||
static bool connected
|
||||
(
|
||||
const triSurface& s,
|
||||
const label edgeI,
|
||||
const pointIndexHit& hit
|
||||
);
|
||||
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
searchableSurfaces(const searchableSurfaces&);
|
||||
|
||||
@ -189,6 +200,49 @@ public:
|
||||
) const;
|
||||
|
||||
|
||||
// Checking
|
||||
|
||||
//- Are all surfaces closed and manifold
|
||||
bool checkClosed(const bool report) const;
|
||||
|
||||
//- Are all (triangulated) surfaces consistent normal orientation
|
||||
bool checkNormalOrientation(const bool report) const;
|
||||
|
||||
//- Are all bounding boxes of similar size
|
||||
bool checkSizes(const scalar maxRatio, const bool report) const;
|
||||
|
||||
//- Do surfaces self-intersect or intersect others
|
||||
bool checkIntersection
|
||||
(
|
||||
const scalar tol,
|
||||
const autoPtr<writer<scalar> >&,
|
||||
const bool report
|
||||
) const;
|
||||
|
||||
//- Check triangle quality
|
||||
bool checkQuality
|
||||
(
|
||||
const scalar minQuality,
|
||||
const bool report
|
||||
) const;
|
||||
|
||||
//- All topological checks. Return number of failed checks
|
||||
label checkTopology(const bool report) const;
|
||||
|
||||
//- All geometric checks. Return number of failed checks
|
||||
label checkGeometry
|
||||
(
|
||||
const scalar maxRatio,
|
||||
const scalar tolerance,
|
||||
const autoPtr<writer<scalar> >& setWriter,
|
||||
const scalar minQuality,
|
||||
const bool report
|
||||
) const;
|
||||
|
||||
//- Write some stats
|
||||
void writeStats(const List<wordList>&, Ostream&) const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Return const and non-const reference to searchableSurface by index.
|
||||
|
||||
@ -625,6 +625,12 @@ Foam::triSurfaceMesh::edgeTree() const
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::triSurfaceMesh::tolerance() const
|
||||
{
|
||||
return tolerance_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::wordList& Foam::triSurfaceMesh::regions() const
|
||||
{
|
||||
if (regions_.empty())
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -182,6 +182,7 @@ public:
|
||||
//- Demand driven contruction of octree for boundary edges
|
||||
const indexedOctree<treeDataEdge>& edgeTree() const;
|
||||
|
||||
scalar tolerance() const;
|
||||
|
||||
// searchableSurface implementation
|
||||
|
||||
|
||||
@ -238,6 +238,38 @@ Foam::Ostream& Foam::OBJstream::write(const linePointRef& ln)
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::OBJstream::write
|
||||
(
|
||||
const triPointRef& f,
|
||||
const bool lines
|
||||
)
|
||||
{
|
||||
label start = nVertices_;
|
||||
write(f.a());
|
||||
write(f.b());
|
||||
write(f.c());
|
||||
if (lines)
|
||||
{
|
||||
write('l');
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
write(' ') << start+1+i;
|
||||
}
|
||||
write(' ') << start+1 << '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
write('f');
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
write(' ') << start+1+i;
|
||||
}
|
||||
write('\n');
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::OBJstream::write
|
||||
(
|
||||
const face& f,
|
||||
|
||||
@ -39,13 +39,14 @@ SourceFiles
|
||||
#include "point.H"
|
||||
#include "edge.H"
|
||||
#include "face.H"
|
||||
#include "triPointRef.H"
|
||||
#include "linePointRef.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class OBJstream Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -134,6 +135,9 @@ public:
|
||||
//- Write line
|
||||
Ostream& write(const linePointRef&);
|
||||
|
||||
//- Write triangle as points with lines or filled polygon
|
||||
Ostream& write(const triPointRef&, const bool lines = true);
|
||||
|
||||
//- Write face as points with lines or filled polygon
|
||||
Ostream& write
|
||||
(
|
||||
|
||||
@ -34,16 +34,56 @@ namespace Foam
|
||||
defineRunTimeSelectionTable(basicThermo, fvMesh);
|
||||
}
|
||||
|
||||
const Foam::word Foam::basicThermo::dictName("thermophysicalProperties");
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::basicThermo::basicThermo(const fvMesh& mesh)
|
||||
Foam::volScalarField& Foam::basicThermo::lookupOrConstruct
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const char* name
|
||||
) const
|
||||
{
|
||||
if (!mesh.objectRegistry::foundObject<volScalarField>(name))
|
||||
{
|
||||
volScalarField* fPtr
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
name,
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
// Transfer ownership of this object to the objectRegistry
|
||||
fPtr->store(fPtr);
|
||||
}
|
||||
|
||||
return const_cast<volScalarField&>
|
||||
(
|
||||
mesh.objectRegistry::lookupObject<volScalarField>(name)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::basicThermo::basicThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thermophysicalProperties",
|
||||
phasePropertyName(dictName, phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
@ -51,24 +91,15 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
|
||||
)
|
||||
),
|
||||
|
||||
p_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
),
|
||||
phaseName_(phaseName),
|
||||
|
||||
p_(lookupOrConstruct(mesh, "p")),
|
||||
|
||||
T_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"T",
|
||||
phasePropertyName("T"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -81,7 +112,7 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"alpha",
|
||||
phasePropertyName("alpha"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -98,14 +129,15 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
|
||||
Foam::basicThermo::basicThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thermophysicalProperties",
|
||||
phasePropertyName(dictName, phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -114,24 +146,15 @@ Foam::basicThermo::basicThermo
|
||||
dict
|
||||
),
|
||||
|
||||
p_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
),
|
||||
phaseName_(phaseName),
|
||||
|
||||
p_(lookupOrConstruct(mesh, "p")),
|
||||
|
||||
T_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"T",
|
||||
phasePropertyName("T"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -144,7 +167,7 @@ Foam::basicThermo::basicThermo
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"alpha",
|
||||
phasePropertyName("alpha"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -160,10 +183,11 @@ Foam::basicThermo::basicThermo
|
||||
|
||||
Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return New<basicThermo>(mesh);
|
||||
return New<basicThermo>(mesh, phaseName);
|
||||
}
|
||||
|
||||
|
||||
@ -175,16 +199,52 @@ Foam::basicThermo::~basicThermo()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::basicThermo& Foam::basicThermo::lookupThermo
|
||||
(
|
||||
const fvPatchScalarField& pf
|
||||
)
|
||||
{
|
||||
if (pf.db().foundObject<basicThermo>(dictName))
|
||||
{
|
||||
return pf.db().lookupObject<basicThermo>(dictName);
|
||||
}
|
||||
else
|
||||
{
|
||||
HashTable<const basicThermo*> thermos =
|
||||
pf.db().lookupClass<basicThermo>();
|
||||
|
||||
for
|
||||
(
|
||||
HashTable<const basicThermo*>::iterator iter = thermos.begin();
|
||||
iter != thermos.end();
|
||||
++iter
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
&(iter()->he().dimensionedInternalField())
|
||||
== &(pf.dimensionedInternalField())
|
||||
)
|
||||
{
|
||||
return *iter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pf.db().lookupObject<basicThermo>(dictName);
|
||||
}
|
||||
|
||||
|
||||
void Foam::basicThermo::validate
|
||||
(
|
||||
const word& app,
|
||||
const word& a
|
||||
) const
|
||||
{
|
||||
if (!(he().name() == a))
|
||||
if (!(he().name() == phasePropertyName(a)))
|
||||
{
|
||||
FatalErrorIn(app)
|
||||
<< "Supported energy type is " << a
|
||||
<< "Supported energy type is " << phasePropertyName(a)
|
||||
<< ", thermodynamics package provides " << he().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -197,10 +257,17 @@ void Foam::basicThermo::validate
|
||||
const word& b
|
||||
) const
|
||||
{
|
||||
if (!(he().name() == a || he().name() == b))
|
||||
if
|
||||
(
|
||||
!(
|
||||
he().name() == phasePropertyName(a)
|
||||
|| he().name() == phasePropertyName(b)
|
||||
)
|
||||
)
|
||||
{
|
||||
FatalErrorIn(app)
|
||||
<< "Supported energy types are " << a << " and " << b
|
||||
<< "Supported energy types are " << phasePropertyName(a)
|
||||
<< " and " << phasePropertyName(b)
|
||||
<< ", thermodynamics package provides " << he().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -217,14 +284,16 @@ void Foam::basicThermo::validate
|
||||
if
|
||||
(
|
||||
!(
|
||||
he().name() == a
|
||||
|| he().name() == b
|
||||
|| he().name() == c
|
||||
he().name() == phasePropertyName(a)
|
||||
|| he().name() == phasePropertyName(b)
|
||||
|| he().name() == phasePropertyName(c)
|
||||
)
|
||||
)
|
||||
{
|
||||
FatalErrorIn(app)
|
||||
<< "Supported energy types are " << a << ", " << b << " and " << c
|
||||
<< "Supported energy types are " << phasePropertyName(a)
|
||||
<< ", " << phasePropertyName(b)
|
||||
<< " and " << phasePropertyName(c)
|
||||
<< ", thermodynamics package provides " << he().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -242,16 +311,18 @@ void Foam::basicThermo::validate
|
||||
if
|
||||
(
|
||||
!(
|
||||
he().name() == a
|
||||
|| he().name() == b
|
||||
|| he().name() == c
|
||||
|| he().name() == d
|
||||
he().name() == phasePropertyName(a)
|
||||
|| he().name() == phasePropertyName(b)
|
||||
|| he().name() == phasePropertyName(c)
|
||||
|| he().name() == phasePropertyName(d)
|
||||
)
|
||||
)
|
||||
{
|
||||
FatalErrorIn(app)
|
||||
<< "Supported energy types are " << a << ", " << b
|
||||
<< ", " << c << " and " << d
|
||||
<< "Supported energy types are " << phasePropertyName(a)
|
||||
<< ", " << phasePropertyName(b)
|
||||
<< ", " << phasePropertyName(c)
|
||||
<< " and " << phasePropertyName(d)
|
||||
<< ", thermodynamics package provides " << he().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -59,10 +59,14 @@ protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Phase-name
|
||||
const word& phaseName_;
|
||||
|
||||
|
||||
// Fields
|
||||
|
||||
//- Pressure [Pa]
|
||||
volScalarField p_;
|
||||
volScalarField& p_;
|
||||
|
||||
//- Temperature [K]
|
||||
volScalarField T_;
|
||||
@ -76,6 +80,12 @@ protected:
|
||||
//- Construct as copy (not implemented)
|
||||
basicThermo(const basicThermo&);
|
||||
|
||||
volScalarField& lookupOrConstruct
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const char* name
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -89,18 +99,27 @@ public:
|
||||
autoPtr,
|
||||
basicThermo,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
basicThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
basicThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
//- Construct from mesh
|
||||
basicThermo(const fvMesh&, const dictionary&);
|
||||
//- Construct from mesh, dictionary and phase name
|
||||
basicThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const dictionary&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
@ -115,14 +134,27 @@ public:
|
||||
|
||||
//- Generic New for each of the related thermodynamics packages
|
||||
template<class Thermo>
|
||||
static autoPtr<Thermo> New(const fvMesh&);
|
||||
static autoPtr<Thermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
//- Generic New for each of the related thermodynamics packages
|
||||
template<class Thermo>
|
||||
static autoPtr<Thermo> New(const fvMesh&, const dictionary&);
|
||||
static autoPtr<Thermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const dictionary&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
//- Specialisation of the Generic New for basicThermo
|
||||
static autoPtr<basicThermo> New(const fvMesh&);
|
||||
static autoPtr<basicThermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -131,6 +163,24 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
static const word dictName;
|
||||
|
||||
static word phasePropertyName
|
||||
(
|
||||
const word& name,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return name + phaseName;
|
||||
}
|
||||
|
||||
word phasePropertyName(const word& name) const
|
||||
{
|
||||
return basicThermo::phasePropertyName(name, phaseName_);
|
||||
}
|
||||
|
||||
static const basicThermo& lookupThermo(const fvPatchScalarField& pf);
|
||||
|
||||
//- Check that the thermodynamics package is consistent
|
||||
// with energy forms supported by the application
|
||||
void validate
|
||||
@ -356,7 +406,7 @@ public:
|
||||
) const = 0;
|
||||
|
||||
|
||||
//- Read thermophysicalProperties dictionary
|
||||
//- Read thermophysical properties dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
@ -136,14 +136,15 @@ typename Table::iterator Foam::basicThermo::lookupThermo
|
||||
template<class Thermo>
|
||||
Foam::autoPtr<Thermo> Foam::basicThermo::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
IOdictionary thermoDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thermophysicalProperties",
|
||||
phasePropertyName(dictName, phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
@ -159,7 +160,7 @@ Foam::autoPtr<Thermo> Foam::basicThermo::New
|
||||
Thermo::fvMeshConstructorTablePtr_
|
||||
);
|
||||
|
||||
return autoPtr<Thermo>(cstrIter()(mesh));
|
||||
return autoPtr<Thermo>(cstrIter()(mesh, phaseName));
|
||||
}
|
||||
|
||||
|
||||
@ -167,7 +168,8 @@ template<class Thermo>
|
||||
Foam::autoPtr<Thermo> Foam::basicThermo::New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
typename Thermo::dictionaryConstructorTable::iterator cstrIter =
|
||||
@ -177,7 +179,7 @@ Foam::autoPtr<Thermo> Foam::basicThermo::New
|
||||
Thermo::dictionaryConstructorTablePtr_
|
||||
);
|
||||
|
||||
return autoPtr<Thermo>(cstrIter()(mesh, dict));
|
||||
return autoPtr<Thermo>(cstrIter()(mesh, dict, phaseName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -101,9 +101,7 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs()
|
||||
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
const basicThermo& thermo =
|
||||
db().lookupObject<basicThermo>("thermophysicalProperties");
|
||||
|
||||
const basicThermo& thermo = basicThermo::lookupThermo(*this);
|
||||
label patchID = patch().index();
|
||||
|
||||
const scalarField& pp = thermo.p().boundaryField()[patchID];
|
||||
|
||||
@ -101,9 +101,7 @@ void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs()
|
||||
|
||||
if (this->cyclicAMIPatch().owner())
|
||||
{
|
||||
const basicThermo& thermo =
|
||||
db().lookupObject<basicThermo>("thermophysicalProperties");
|
||||
|
||||
const basicThermo& thermo = basicThermo::lookupThermo(*this);
|
||||
label patchID = patch().index();
|
||||
|
||||
const scalarField& pp = thermo.p().boundaryField()[patchID];
|
||||
|
||||
@ -97,12 +97,7 @@ void Foam::fixedEnergyFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const basicThermo& thermo = db().lookupObject<basicThermo>
|
||||
(
|
||||
"thermophysicalProperties"
|
||||
);
|
||||
|
||||
|
||||
const basicThermo& thermo = basicThermo::lookupThermo(*this);
|
||||
const label patchi = patch().index();
|
||||
|
||||
const scalarField& pw = thermo.p().boundaryField()[patchi];
|
||||
|
||||
@ -97,9 +97,7 @@ void Foam::gradientEnergyFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const basicThermo& thermo =
|
||||
db().lookupObject<basicThermo>("thermophysicalProperties");
|
||||
|
||||
const basicThermo& thermo = basicThermo::lookupThermo(*this);
|
||||
const label patchi = patch().index();
|
||||
|
||||
const scalarField& pw = thermo.p().boundaryField()[patchi];
|
||||
|
||||
@ -102,11 +102,7 @@ void Foam::mixedEnergyFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const basicThermo& thermo = db().lookupObject<basicThermo>
|
||||
(
|
||||
"thermophysicalProperties"
|
||||
);
|
||||
|
||||
const basicThermo& thermo = basicThermo::lookupThermo(*this);
|
||||
const label patchi = patch().index();
|
||||
|
||||
const scalarField& pw = thermo.p().boundaryField()[patchi];
|
||||
|
||||
@ -149,11 +149,7 @@ void Foam::wallHeatTransferFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const basicThermo& thermo = db().lookupObject<basicThermo>
|
||||
(
|
||||
"thermophysicalProperties"
|
||||
);
|
||||
|
||||
const basicThermo& thermo = basicThermo::lookupThermo(*this);
|
||||
const label patchi = patch().index();
|
||||
|
||||
const scalarField& pw = thermo.p().boundaryField()[patchi];
|
||||
|
||||
@ -36,16 +36,21 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::fluidThermo::fluidThermo(const fvMesh& mesh)
|
||||
Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const word& phaseName)
|
||||
:
|
||||
basicThermo(mesh)
|
||||
basicThermo(mesh, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const dictionary& dict)
|
||||
Foam::fluidThermo::fluidThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicThermo(mesh, dict)
|
||||
basicThermo(mesh, dict, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
@ -53,10 +58,11 @@ Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const dictionary& dict)
|
||||
|
||||
Foam::autoPtr<Foam::fluidThermo> Foam::fluidThermo::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return basicThermo::New<fluidThermo>(mesh);
|
||||
return basicThermo::New<fluidThermo>(mesh, phaseName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -63,21 +63,34 @@ public:
|
||||
autoPtr,
|
||||
fluidThermo,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
fluidThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
fluidThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
//- Construct from mesh
|
||||
fluidThermo(const fvMesh&, const dictionary&);
|
||||
//- Construct from mesh and phase name
|
||||
fluidThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const dictionary&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<fluidThermo> New(const fvMesh&);
|
||||
static autoPtr<fluidThermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -128,16 +128,20 @@ void Foam::heThermo<BasicThermo, MixtureType>::init()
|
||||
|
||||
|
||||
template<class BasicThermo, class MixtureType>
|
||||
Foam::heThermo<BasicThermo, MixtureType>::heThermo(const fvMesh& mesh)
|
||||
Foam::heThermo<BasicThermo, MixtureType>::heThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
BasicThermo(mesh),
|
||||
BasicThermo(mesh, phaseName),
|
||||
MixtureType(*this, mesh),
|
||||
|
||||
he_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
MixtureType::thermoType::heName(),
|
||||
BasicThermo::phasePropertyName(MixtureType::thermoType::heName()),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -156,17 +160,18 @@ template<class BasicThermo, class MixtureType>
|
||||
Foam::heThermo<BasicThermo, MixtureType>::heThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
BasicThermo(mesh, dict),
|
||||
BasicThermo(mesh, dict, phaseName),
|
||||
MixtureType(*this, mesh),
|
||||
|
||||
he_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
MixtureType::thermoType::heName(),
|
||||
BasicThermo::phasePropertyName(MixtureType::thermoType::heName()),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
|
||||
@ -89,10 +89,19 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
heThermo(const fvMesh&);
|
||||
heThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
//- Construct from mesh and dictionary
|
||||
heThermo(const fvMesh&, const dictionary&);
|
||||
heThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const dictionary&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -284,7 +293,7 @@ public:
|
||||
) const;
|
||||
|
||||
|
||||
//- Read thermophysicalProperties dictionary
|
||||
//- Read thermophysical properties dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
@ -102,9 +102,13 @@ void Foam::hePsiThermo<BasicPsiThermo, MixtureType>::calculate()
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasicPsiThermo, class MixtureType>
|
||||
Foam::hePsiThermo<BasicPsiThermo, MixtureType>::hePsiThermo(const fvMesh& mesh)
|
||||
Foam::hePsiThermo<BasicPsiThermo, MixtureType>::hePsiThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
heThermo<BasicPsiThermo, MixtureType>(mesh)
|
||||
heThermo<BasicPsiThermo, MixtureType>(mesh, phaseName)
|
||||
{
|
||||
calculate();
|
||||
|
||||
|
||||
@ -68,8 +68,12 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
hePsiThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
hePsiThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -36,15 +36,15 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::psiThermo::psiThermo(const fvMesh& mesh)
|
||||
Foam::psiThermo::psiThermo(const fvMesh& mesh, const word& phaseName)
|
||||
:
|
||||
fluidThermo(mesh),
|
||||
fluidThermo(mesh, phaseName),
|
||||
|
||||
psi_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"psi",
|
||||
phasePropertyName("psi"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -58,7 +58,7 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh)
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mu",
|
||||
phasePropertyName("mu"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -74,10 +74,11 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh)
|
||||
|
||||
Foam::autoPtr<Foam::psiThermo> Foam::psiThermo::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return basicThermo::New<psiThermo>(mesh);
|
||||
return basicThermo::New<psiThermo>(mesh, phaseName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -81,19 +81,27 @@ public:
|
||||
autoPtr,
|
||||
psiThermo,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
psiThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
psiThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<psiThermo> New(const fvMesh&);
|
||||
static autoPtr<psiThermo> New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -107,9 +107,13 @@ void Foam::heRhoThermo<BasicPsiThermo, MixtureType>::calculate()
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasicPsiThermo, class MixtureType>
|
||||
Foam::heRhoThermo<BasicPsiThermo, MixtureType>::heRhoThermo(const fvMesh& mesh)
|
||||
Foam::heRhoThermo<BasicPsiThermo, MixtureType>::heRhoThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
heThermo<BasicPsiThermo, MixtureType>(mesh)
|
||||
heThermo<BasicPsiThermo, MixtureType>(mesh, phaseName)
|
||||
{
|
||||
calculate();
|
||||
}
|
||||
|
||||
@ -69,8 +69,12 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
heRhoThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
heRhoThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -36,14 +36,14 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::rhoThermo::rhoThermo(const fvMesh& mesh)
|
||||
Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const word& phaseName)
|
||||
:
|
||||
fluidThermo(mesh),
|
||||
fluidThermo(mesh, phaseName),
|
||||
rho_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoThermo",
|
||||
phasePropertyName("rhoThermo"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -57,7 +57,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh)
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"psi",
|
||||
phasePropertyName("psi"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -71,7 +71,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh)
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mu",
|
||||
phasePropertyName("mu"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -83,14 +83,19 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh)
|
||||
{}
|
||||
|
||||
|
||||
Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict)
|
||||
Foam::rhoThermo::rhoThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
fluidThermo(mesh, dict),
|
||||
fluidThermo(mesh, dict, phaseName),
|
||||
rho_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoThermo",
|
||||
phasePropertyName("rhoThermo"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -104,7 +109,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict)
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"psi",
|
||||
phasePropertyName("psi"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -118,7 +123,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict)
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mu",
|
||||
phasePropertyName("mu"),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -134,10 +139,11 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict)
|
||||
|
||||
Foam::autoPtr<Foam::rhoThermo> Foam::rhoThermo::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return basicThermo::New<rhoThermo>(mesh);
|
||||
return basicThermo::New<rhoThermo>(mesh, phaseName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -85,22 +85,35 @@ public:
|
||||
autoPtr,
|
||||
rhoThermo,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
rhoThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
rhoThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
//- Construct from mesh
|
||||
rhoThermo(const fvMesh&, const dictionary&);
|
||||
//- Construct from mesh, dictionary and phase name
|
||||
rhoThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const dictionary&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<rhoThermo> New(const fvMesh&);
|
||||
static autoPtr<rhoThermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -36,9 +36,13 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::psiReactionThermo::psiReactionThermo(const fvMesh& mesh)
|
||||
Foam::psiReactionThermo::psiReactionThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
psiThermo(mesh)
|
||||
psiThermo(mesh, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
@ -46,10 +50,11 @@ Foam::psiReactionThermo::psiReactionThermo(const fvMesh& mesh)
|
||||
|
||||
Foam::autoPtr<Foam::psiReactionThermo> Foam::psiReactionThermo::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return basicThermo::New<psiReactionThermo>(mesh);
|
||||
return basicThermo::New<psiReactionThermo>(mesh, phaseName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -66,21 +66,29 @@ public:
|
||||
autoPtr,
|
||||
psiReactionThermo,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
psiReactionThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
psiReactionThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Standard selection based on fvMesh
|
||||
static autoPtr<psiReactionThermo> New(const fvMesh&);
|
||||
static autoPtr<psiReactionThermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -121,10 +121,11 @@ void Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::calculate()
|
||||
template<class BasicPsiThermo, class MixtureType>
|
||||
Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::heheuPsiThermo
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
heThermo<psiuReactionThermo, MixtureType>(mesh),
|
||||
heThermo<psiuReactionThermo, MixtureType>(mesh, phaseName),
|
||||
Tu_
|
||||
(
|
||||
IOobject
|
||||
|
||||
@ -76,8 +76,12 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
heheuPsiThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
heheuPsiThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -100,9 +100,13 @@ void psiuReactionThermo::heuBoundaryCorrection(volScalarField& heu)
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
psiuReactionThermo::psiuReactionThermo(const fvMesh& mesh)
|
||||
psiuReactionThermo::psiuReactionThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
psiReactionThermo(mesh)
|
||||
psiReactionThermo(mesh, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
@ -110,10 +114,11 @@ psiuReactionThermo::psiuReactionThermo(const fvMesh& mesh)
|
||||
|
||||
Foam::autoPtr<Foam::psiuReactionThermo> Foam::psiuReactionThermo::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return basicThermo::New<psiuReactionThermo>(mesh);
|
||||
return basicThermo::New<psiuReactionThermo>(mesh, phaseName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -73,20 +73,28 @@ public:
|
||||
autoPtr,
|
||||
psiuReactionThermo,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
psiuReactionThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
psiuReactionThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
static autoPtr<psiuReactionThermo> New(const fvMesh&);
|
||||
static autoPtr<psiuReactionThermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -36,9 +36,13 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::rhoReactionThermo::rhoReactionThermo(const fvMesh& mesh)
|
||||
Foam::rhoReactionThermo::rhoReactionThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
rhoThermo(mesh)
|
||||
rhoThermo(mesh, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
@ -46,10 +50,11 @@ Foam::rhoReactionThermo::rhoReactionThermo(const fvMesh& mesh)
|
||||
|
||||
Foam::autoPtr<Foam::rhoReactionThermo> Foam::rhoReactionThermo::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return basicThermo::New<rhoReactionThermo>(mesh);
|
||||
return basicThermo::New<rhoReactionThermo>(mesh, phaseName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -66,21 +66,29 @@ public:
|
||||
autoPtr,
|
||||
rhoReactionThermo,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
rhoReactionThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
rhoReactionThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Standard selection based on fvMesh
|
||||
static autoPtr<rhoReactionThermo> New(const fvMesh&);
|
||||
static autoPtr<rhoReactionThermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -38,19 +38,24 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::solidReactionThermo::solidReactionThermo(const fvMesh& mesh)
|
||||
Foam::solidReactionThermo::solidReactionThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
solidThermo(mesh)
|
||||
solidThermo(mesh, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
Foam::solidReactionThermo::solidReactionThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
solidThermo(mesh, dict)
|
||||
solidThermo(mesh, dict, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
@ -58,20 +63,22 @@ Foam::solidReactionThermo::solidReactionThermo
|
||||
|
||||
Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return basicThermo::New<solidReactionThermo>(mesh);
|
||||
return basicThermo::New<solidReactionThermo>(mesh, phaseName);
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return basicThermo::New<solidReactionThermo>(mesh, dict);
|
||||
return basicThermo::New<solidReactionThermo>(mesh, dict, phaseName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -67,8 +67,8 @@ public:
|
||||
autoPtr,
|
||||
solidReactionThermo,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
// Declare run-time constructor selection tables
|
||||
@ -77,31 +77,46 @@ public:
|
||||
autoPtr,
|
||||
solidReactionThermo,
|
||||
dictionary,
|
||||
(const fvMesh& mesh, const dictionary& dict),
|
||||
(mesh, dict)
|
||||
(const fvMesh& mesh, const dictionary& dict, const word& phaseName),
|
||||
(mesh, dict, phaseName)
|
||||
);
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
solidReactionThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
solidReactionThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
solidReactionThermo(const fvMesh&, const dictionary&);
|
||||
//- Construct from mesh, dictionary and phase name
|
||||
solidReactionThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const dictionary&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Standard selection based on fvMesh
|
||||
static autoPtr<solidReactionThermo> New(const fvMesh&);
|
||||
static autoPtr<solidReactionThermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
//- Standard selection based on fvMesh amd dictionary
|
||||
static autoPtr<solidReactionThermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const dictionary&
|
||||
const dictionary&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~solidReactionThermo();
|
||||
|
||||
|
||||
@ -127,9 +127,13 @@ void Foam::heSolidThermo<BasicSolidThermo, MixtureType>::calculate()
|
||||
|
||||
template<class BasicSolidThermo, class MixtureType>
|
||||
Foam::heSolidThermo<BasicSolidThermo, MixtureType>::
|
||||
heSolidThermo(const fvMesh& mesh)
|
||||
heSolidThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
heThermo<BasicSolidThermo, MixtureType>(mesh)
|
||||
heThermo<BasicSolidThermo, MixtureType>(mesh, phaseName)
|
||||
{
|
||||
calculate();
|
||||
}
|
||||
@ -137,9 +141,14 @@ heSolidThermo(const fvMesh& mesh)
|
||||
|
||||
template<class BasicSolidThermo, class MixtureType>
|
||||
Foam::heSolidThermo<BasicSolidThermo, MixtureType>::
|
||||
heSolidThermo(const fvMesh& mesh, const dictionary& dict)
|
||||
heSolidThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
heThermo<BasicSolidThermo, MixtureType>(mesh, dict)
|
||||
heThermo<BasicSolidThermo, MixtureType>(mesh, dict, phaseName)
|
||||
{
|
||||
calculate();
|
||||
}
|
||||
|
||||
@ -68,11 +68,20 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
heSolidThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
heSolidThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
//- Construct from mesh and dictionary
|
||||
heSolidThermo(const fvMesh&, const dictionary&);
|
||||
//- Construct from mesh, dictionary and phase name
|
||||
heSolidThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const dictionary&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -39,9 +39,13 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::solidThermo::solidThermo(const fvMesh& mesh)
|
||||
Foam::solidThermo::solidThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicThermo(mesh),
|
||||
basicThermo(mesh, phaseName),
|
||||
rho_
|
||||
(
|
||||
IOobject
|
||||
@ -61,10 +65,11 @@ Foam::solidThermo::solidThermo(const fvMesh& mesh)
|
||||
Foam::solidThermo::solidThermo
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicThermo(mesh, dict),
|
||||
basicThermo(mesh, dict, phaseName),
|
||||
rho_
|
||||
(
|
||||
IOobject
|
||||
@ -85,20 +90,22 @@ Foam::solidThermo::solidThermo
|
||||
|
||||
Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return basicThermo::New<solidThermo>(mesh);
|
||||
return basicThermo::New<solidThermo>(mesh, phaseName);
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
return basicThermo::New<solidThermo>(mesh, dict);
|
||||
return basicThermo::New<solidThermo>(mesh, dict, phaseName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -77,8 +77,8 @@ public:
|
||||
autoPtr,
|
||||
solidThermo,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
// Declare run-time constructor selection tables
|
||||
@ -87,26 +87,44 @@ public:
|
||||
autoPtr,
|
||||
solidThermo,
|
||||
dictionary,
|
||||
(const fvMesh& mesh, const dictionary& dict),
|
||||
(mesh, dict)
|
||||
(const fvMesh& mesh, const dictionary& dict, const word& phaseName),
|
||||
(mesh, dict, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
solidThermo(const fvMesh&);
|
||||
//- Construct from mesh and phase name
|
||||
solidThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
//- Construct from mesh and dict
|
||||
solidThermo(const fvMesh&, const dictionary& dict);
|
||||
//- Construct from mesh, dictionary and phase name
|
||||
solidThermo
|
||||
(
|
||||
const fvMesh&,
|
||||
const dictionary& dict,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
//- Return a pointer to a new solidThermo created from
|
||||
// the solidThermophysicalProperties dictionary
|
||||
static autoPtr<solidThermo> New(const fvMesh&);
|
||||
static autoPtr<solidThermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
//- Return a pointer to a new solidThermo created from
|
||||
// local dictionary
|
||||
static autoPtr<solidThermo> New(const fvMesh&, const dictionary&);
|
||||
static autoPtr<solidThermo> New
|
||||
(
|
||||
const fvMesh&,
|
||||
const dictionary&,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -15,4 +15,3 @@ LIB_LIBS = \
|
||||
-lmeshTools \
|
||||
-lsolidSpecie \
|
||||
-lradiationModels
|
||||
|
||||
|
||||
Reference in New Issue
Block a user