STYLE: use forAll macro in more places, avoid LF-CR endings

This commit is contained in:
Mark Olesen
2010-04-23 18:35:55 +02:00
parent 03338b9ea9
commit 9c32ce1016
56 changed files with 1784 additions and 1789 deletions

View File

@ -213,7 +213,7 @@ void Foam::primitiveEntry::write(Ostream& os) const
{
os.writeKeyword(keyword());
for (label i=0; i<size(); i++)
for (label i=0; i<size(); ++i)
{
os << operator[](i);

View File

@ -125,7 +125,7 @@ void PrimitivePatchInterpolation<Patch>::makeFaceToEdgeWeights() const
faceToEdgeWeightsPtr_ = new scalarList(patch_.nInternalEdges());
scalarList& weights = *faceToEdgeWeightsPtr_;
for (label edgei = 0; edgei < weights.size(); edgei++)
forAll(weights, edgei)
{
vector P = faces[edgeFaces[edgei][0]].centre(points);
vector N = faces[edgeFaces[edgei][1]].centre(points);

View File

@ -363,7 +363,7 @@ Foam::SVD::SVD(const scalarRectangularMatrix& A, const scalar minCondition)
// zero singular values that are less than minCondition*maxS
const scalar minS = minCondition*S_[findMax(S_)];
for (label i = 0; i < S_.size(); i++)
forAll(S_, i)
{
if (S_[i] <= minS)
{

View File

@ -153,7 +153,7 @@ void Foam::walkPatch::faceToFace
indexInFace_.append(fp);
// Visit neighbouring faces in order, starting at fp.
for (label i = 0; i < f.size(); i++)
forAll(f, i)
{
label fp1 = reverse_ ? f.rcIndex(fp) : f.fcIndex(fp);
label nbr = getNeighbour(faceI, fp, f[fp], f[fp1]);

View File

@ -88,7 +88,7 @@ void Foam::attachDetach::attachInterface
// Pout << "Points to be mapped: " << removedPoints << endl;
// Remove all faces from the slave patch
for (label i = 0; i < slavePatch.size(); i++)
forAll(slavePatch, i)
{
ref.setAction(polyRemoveFace(i + slavePatchStart));
// Pout << "Removing face " << i + slavePatchStart << endl;

View File

@ -265,7 +265,7 @@ Foam::List<Foam::polyPatch*> Foam::polyMeshAdder::combinePatches
// Copy patches0 with new sizes. First patches always come from
// mesh0 and will always be present.
for (label patchI = 0; patchI < patches0.size(); patchI++)
forAll(patches0, patchI)
{
// Originates from mesh0. Clone with new size & filter out empty
// patch.
@ -363,7 +363,7 @@ Foam::labelList Foam::polyMeshAdder::getFaceOrder
labelList oldToNew(owner.size(), -1);
// Leave boundary faces in order
for (label faceI = nInternalFaces; faceI < owner.size(); faceI++)
for (label faceI = nInternalFaces; faceI < owner.size(); ++faceI)
{
oldToNew[faceI] = faceI;
}

View File

@ -915,7 +915,7 @@ void Foam::addPatchCellLayer::setRefinement
vector disp = firstLayerDisp[patchPointI];
for (label i = 0; i < addedPoints_[patchPointI].size(); i++)
forAll(addedPoints_[patchPointI], i)
{
pt += disp;
@ -1000,7 +1000,7 @@ void Foam::addPatchCellLayer::setRefinement
face newFace(f.size());
for (label i = 0; i < addedCells[patchFaceI].size(); i++)
forAll(addedCells[patchFaceI], i)
{
forAll(f, fp)
{

View File

@ -262,7 +262,7 @@ void Foam::repatchPolyTopoChanger::changeAnchorPoint
label fVert = fp;
for (label i = 0; i < f.size(); i++)
forAll(f, i)
{
newFace[i] = f[fVert++];

View File

@ -200,7 +200,7 @@ void Foam::enrichedPatch::calcEnrichedFaces
// Go through the points and collect them based on
// weights from lower to higher. This gives the
// correct order of points along the edge.
for (label passI = 0; passI < edgePointWeights.size(); passI++)
forAll(edgePointWeights, passI)
{
// Max weight can only be one, so the sorting is
// done by elimination.
@ -351,7 +351,7 @@ void Foam::enrichedPatch::calcEnrichedFaces
// Go through the points and collect them based on
// weights from lower to higher. This gives the
// correct order of points along the edge.
for (label pass = 0; pass < edgePointWeights.size(); pass++)
forAll(edgePointWeights, passI)
{
// Max weight can only be one, so the sorting is
// done by elimination.

View File

@ -31,10 +31,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(quadraticFitSnGradData, 0);
}
defineTypeNameAndDebug(Foam::quadraticFitSnGradData, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -205,7 +202,7 @@ Foam::label Foam::quadraticFitSnGradData::calcFit
// calculate the matrix of the polynomial components
scalarRectangularMatrix B(C.size(), minSize_, scalar(0));
for (label ip = 0; ip < C.size(); ip++)
forAll(C, ip)
{
const point& p = C[ip];

View File

@ -164,7 +164,7 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit
// Matrix of the polynomial components
scalarRectangularMatrix B(C.size(), minSize_, scalar(0));
for (label ip = 0; ip < C.size(); ip++)
forAll(C, ip)
{
const point& p = C[ip];

View File

@ -258,7 +258,7 @@ void parcel::setRelaxationTimes
scalar vapourSurfaceEnthalpy = 0.0;
scalar vapourFarEnthalpy = 0.0;
for (label k = 0; k < sDB.gasProperties().size(); k++)
forAll(sDB.gasProperties(), k)
{
vapourSurfaceEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(tBoilingSurface);
vapourFarEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(temperature);

View File

@ -177,7 +177,7 @@ void Foam::shellSurfaces::orient()
boundBox shellBb(points[0], points[0]);
// Assume surface is compact!
for (label i = 0; i < points.size(); i++)
forAll(points, i)
{
const point& pt = points[i];
shellBb.min() = min(shellBb.min(), pt);

View File

@ -453,7 +453,7 @@ Foam::Ostream& Foam::operator<< (Ostream& os, const treeLeaf<Type>& leaf)
{
// Storage not trimmed
os << token::SPACE << leaf.size() << token::SPACE << token::BEGIN_LIST;
for (label i = 0; i < leaf.size(); i++)
forAll(leaf, i)
{
os << token::SPACE << leaf.indices()[i];
}

View File

@ -115,7 +115,7 @@ void fftRenumber
List<complex> renumData(data);
label nnprod(1);
for (label i=0; i<nn.size(); i++)
forAll(nn, i)
{
nnprod *= nn[i];
}

View File

@ -229,7 +229,7 @@ void Foam::faceOnlySet::calcSamples
);
// fill sampleSegments
for(label i = samplingPts.size() - 1; i >= startSegmentI; --i)
for (label i = samplingPts.size() - 1; i >= startSegmentI; --i)
{
samplingSegments.append(segmentI);
}

View File

@ -64,7 +64,7 @@ bool Foam::uniformSet::nextSample
samplePt += offset;
sampleI++;
for(; sampleI < nPoints_; sampleI++)
for (; sampleI < nPoints_; sampleI++)
{
scalar s = (samplePt - currentPt) & normOffset;
@ -328,7 +328,7 @@ void Foam::uniformSet::calcSamples
);
// fill sampleSegments
for(label i = samplingPts.size() - 1; i >= startSegmentI; --i)
for (label i = samplingPts.size() - 1; i >= startSegmentI; --i)
{
samplingSegments.append(segmentI);
}

View File

@ -1,482 +1,482 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::kinematicSingleLayer
Description
Kinematic form of single-cell layer surface film model
SourceFiles
kinematicSingleLayer.C
\*---------------------------------------------------------------------------*/
#ifndef kinematicSingleLayer_H
#define kinematicSingleLayer_H
#include "surfaceFilmModel.H"
#include "fvMesh.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
// Forward declaration of classes
class injectionModel;
/*---------------------------------------------------------------------------*\
Class kinematicSingleLayer Declaration
\*---------------------------------------------------------------------------*/
class kinematicSingleLayer
:
public surfaceFilmModel
{
private:
// Private member functions
//- Disallow default bitwise copy construct
kinematicSingleLayer(const kinematicSingleLayer&);
//- Disallow default bitwise assignment
void operator=(const kinematicSingleLayer&);
protected:
// Protected data
// Mesh databases
//- Film region mesh database
fvMesh filmRegion_;
//- Patch normal vectors
volVectorField nHat_;
//- Face area magnitudes / [m2]
volScalarField magSf_;
//- List of patch IDs on the primary region coupled with the film
// region
labelList primaryPatchIDs_;
//- List of patch IDs on oppositte side of the film region
labelList filmTopPatchIDs_;
//- List of patch IDs on the film region coupled with the primary
// region
labelList filmBottomPatchIDs_;
// Solution parameters
//- Momentum predictor
Switch momentumPredictor_;
//- Number of outer correctors
label nOuterCorr_;
//- Number of PISO-like correctors
label nCorr_;
//- Number of non-orthogonal correctors
label nNonOrthCorr_;
//- Cumulative continuity error
scalar cumulativeContErr_;
// Model parameters
//- Skin frition coefficient for film/main region interface
scalar Cf_;
//- Stable film thickness - film cannot detach until this is reached
dimensionedScalar deltaStable_;
// Thermo properties
//- Density / [kg/m3]
volScalarField rho_;
//- Dynamic viscosity / [Pa.s]
volScalarField mu_;
//- Surface tension / [m/s2]
volScalarField sigma_;
// Fields
//- Film thickness / [m]
volScalarField delta_;
//- Velocity / [m/s]
volVectorField U_;
//- Film thickness*density (helper field) / [kg/m2]
volScalarField deltaRho_;
//- Mass flux (includes film thickness) / [kg.m/s]
surfaceScalarField phi_;
// Transfer fields - to the primary region
//- Return the film mass available for transfer
volScalarField massForPrimary_;
//- Return the parcel diameters originating from film
volScalarField diametersForPrimary_;
// Source term fields
// Film region - registered to the film region mesh
// Note: need boundary value mapped from primary region, and then
// pushed into the patch internal field
//- Momementum / [kg/m/s2]
volVectorField USp_;
//- Pressure / [Pa]
volScalarField pSp_;
//- Mass / [kg/m2/s]
volScalarField rhoSp_;
// Primary region - registered to the primary region mesh
// Internal use only - not read-in
//- Momementum / [kg/m/s2]
volVectorField USpPrimary_;
//- Pressure / [Pa]
volScalarField pSpPrimary_;
//- Mass / [kg/m2/s]
volScalarField rhoSpPrimary_;
// Fields mapped from primary region - registered to the film region
// Note: need both boundary AND patch internal fields to be mapped
//- Velocity / [m/s]
volVectorField UPrimary_;
//- Pressure / [Pa]
volScalarField pPrimary_;
// Sub-models
//- Injection
autoPtr<injectionModel> injection_;
// Checks
//- Cumulative mass added via sources [kg]
scalar addedMass_;
// Detached surface properties
//- Cumulative mass detached [kg]
scalar detachedMass_;
// Protected member functions
//- Initialise the film model - called on construction
void initialise();
//- Read control parameters from dictionary
virtual bool read();
//- Reset source term fields
virtual void resetPrimaryRegionSourceTerms();
//- Transfer fields from the primary region to the film region
virtual void transferPrimaryRegionFields();
//- Correct the source terms for film that detaches from film region
virtual void correctDetachedFilm();
// Explicit pressure source contribution
virtual tmp<volScalarField> pu();
// Implicit pressure source coefficient
virtual tmp<volScalarField> pp();
//- Update the film sub-models
virtual void updateSubmodels();
//- Courant number evaluation
virtual scalar CourantNumber() const;
//- Continuity check
virtual void continuityCheck();
//- Return the stress term for the momentum equation
virtual tmp<fvVectorMatrix> tau(volVectorField& dU) const;
//- Constrain a film region master/slave boundaries of a field to a
// given value
template<class Type>
void constrainFilmField
(
Type& field,
const typename Type::cmptType& value
);
// Equations
//- Solve continuity equation
virtual void solveContinuity();
//- Solve for film velocity
virtual tmp<fvVectorMatrix> solveMomentum
(
const volScalarField& pu,
const volScalarField& pp
);
//- Solve coupled velocity-thickness equations
virtual void solveThickness
(
const volScalarField& pu,
const volScalarField& pp,
const fvVectorMatrix& UEqn
);
public:
//- Runtime type information
TypeName("kinematicSingleLayer");
// Constructors
//- Construct from components
kinematicSingleLayer
(
const word& modelType,
const fvMesh& mesh,
const dimensionedVector& g
);
//- Destructor
virtual ~kinematicSingleLayer();
// Member Functions
// Access
//- Return the film mesh database
virtual const fvMesh& film() const;
//- Return the patch normal vectors
inline const volVectorField& nHat() const;
//- Return the face area magnitudes / [m2]
inline const volScalarField& magSf() const;
//- Return the list of coupled patches on the film region
virtual const labelList& filmBottomPatchIDs() const;
//- Return the list of patches oppositte coupled patches
virtual const labelList& filmTopPatchIDs() const;
//- Return the list of coupled patches on the primary region
virtual const labelList& primaryPatchIDs() const;
// Solution parameters
//- Return the momentum predictor
inline const Switch& momentumPredictor() const;
//- Return the number of outer correctors
inline label nOuterCorr() const;
//- Return the number of PISO correctors
inline label nCorr() const;
//- Return the number of non-orthogonal correctors
inline label nNonOrthCorr() const;
// Model parameters
//- Return the skin friction coefficient
inline scalar Cf() const;
// Thermo properties
//- Return const access to the dynamic viscosity / [Pa.s]
inline const volScalarField& mu() const;
//- Return const access to the surface tension / [m/s2]
inline const volScalarField& sigma() const;
// Fields
//- Return const access to the film thickness / [m]
inline const volScalarField& delta() const;
//- Return the film velocity [m/s]
virtual const volVectorField& U() const;
//- Return the film density [kg/m3]
virtual const volScalarField& rho() const;
//- Return the film temperature [K]
virtual const volScalarField& T() const;
//- Return the film specific heat capacity [J/kg/K]
virtual const volScalarField& cp() const;
// Transfer fields - to the primary region
//- Return the film mass available for transfer
virtual const volScalarField& massForPrimary() const;
//- Return the parcel diameters originating from film
virtual const volScalarField& diametersForPrimary() const;
// External helper functions
//- Return true if patchI on the primary region is a coupled patch
// to the film region
virtual bool isFilmPatch(const label patchI) const;
//- External hook to add sources to the film
virtual void addSources
(
const label patchI, // patchI on primary region
const label faceI, // faceI of patchI
const scalar massSource, // [kg]
const vector& momentumSource, // [kg.m/s] (tangential momentum)
const scalar pressureSource, // [kg.m/s] (normal momentum)
const scalar energySource = 0 // [J]
);
// Source fields (read/write access)
// Primary region
//- Momementum / [kg/m/s2]
inline volVectorField& USpPrimary();
//- Pressure / [Pa]
inline volScalarField& pSpPrimary();
//- Mass / [kg/m2/s]
inline volScalarField& rhoSpPrimary();
// Film region
//- Momementum / [kg/m/s2]
inline volVectorField& USp();
//- Pressure / [Pa]
inline volScalarField& pSp();
//- Mass / [kg/m2/s]
inline volScalarField& rhoSp();
// Sub-models
//- Injection
inline injectionModel& injection();
// Helper functions
//- Return the gravity tangential component contributions
inline tmp<volVectorField> gTan() const;
//- Return the gravity normal-to-patch component contribution
inline tmp<volScalarField> gNorm() const;
//- Return the gravity normal-to-patch component contribution
// Clipped so that only non-zero if g & nHat_ < 0
inline tmp<volScalarField> gNormClipped() const;
// Evolution
//- Evolve the film equations
virtual void evolveFilm();
// I-O
//- Provide some feedback
virtual void info() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "kinematicSingleLayerTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "kinematicSingleLayerI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::kinematicSingleLayer
Description
Kinematic form of single-cell layer surface film model
SourceFiles
kinematicSingleLayer.C
\*---------------------------------------------------------------------------*/
#ifndef kinematicSingleLayer_H
#define kinematicSingleLayer_H
#include "surfaceFilmModel.H"
#include "fvMesh.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
// Forward declaration of classes
class injectionModel;
/*---------------------------------------------------------------------------*\
Class kinematicSingleLayer Declaration
\*---------------------------------------------------------------------------*/
class kinematicSingleLayer
:
public surfaceFilmModel
{
private:
// Private member functions
//- Disallow default bitwise copy construct
kinematicSingleLayer(const kinematicSingleLayer&);
//- Disallow default bitwise assignment
void operator=(const kinematicSingleLayer&);
protected:
// Protected data
// Mesh databases
//- Film region mesh database
fvMesh filmRegion_;
//- Patch normal vectors
volVectorField nHat_;
//- Face area magnitudes / [m2]
volScalarField magSf_;
//- List of patch IDs on the primary region coupled with the film
// region
labelList primaryPatchIDs_;
//- List of patch IDs on oppositte side of the film region
labelList filmTopPatchIDs_;
//- List of patch IDs on the film region coupled with the primary
// region
labelList filmBottomPatchIDs_;
// Solution parameters
//- Momentum predictor
Switch momentumPredictor_;
//- Number of outer correctors
label nOuterCorr_;
//- Number of PISO-like correctors
label nCorr_;
//- Number of non-orthogonal correctors
label nNonOrthCorr_;
//- Cumulative continuity error
scalar cumulativeContErr_;
// Model parameters
//- Skin frition coefficient for film/main region interface
scalar Cf_;
//- Stable film thickness - film cannot detach until this is reached
dimensionedScalar deltaStable_;
// Thermo properties
//- Density / [kg/m3]
volScalarField rho_;
//- Dynamic viscosity / [Pa.s]
volScalarField mu_;
//- Surface tension / [m/s2]
volScalarField sigma_;
// Fields
//- Film thickness / [m]
volScalarField delta_;
//- Velocity / [m/s]
volVectorField U_;
//- Film thickness*density (helper field) / [kg/m2]
volScalarField deltaRho_;
//- Mass flux (includes film thickness) / [kg.m/s]
surfaceScalarField phi_;
// Transfer fields - to the primary region
//- Return the film mass available for transfer
volScalarField massForPrimary_;
//- Return the parcel diameters originating from film
volScalarField diametersForPrimary_;
// Source term fields
// Film region - registered to the film region mesh
// Note: need boundary value mapped from primary region, and then
// pushed into the patch internal field
//- Momementum / [kg/m/s2]
volVectorField USp_;
//- Pressure / [Pa]
volScalarField pSp_;
//- Mass / [kg/m2/s]
volScalarField rhoSp_;
// Primary region - registered to the primary region mesh
// Internal use only - not read-in
//- Momementum / [kg/m/s2]
volVectorField USpPrimary_;
//- Pressure / [Pa]
volScalarField pSpPrimary_;
//- Mass / [kg/m2/s]
volScalarField rhoSpPrimary_;
// Fields mapped from primary region - registered to the film region
// Note: need both boundary AND patch internal fields to be mapped
//- Velocity / [m/s]
volVectorField UPrimary_;
//- Pressure / [Pa]
volScalarField pPrimary_;
// Sub-models
//- Injection
autoPtr<injectionModel> injection_;
// Checks
//- Cumulative mass added via sources [kg]
scalar addedMass_;
// Detached surface properties
//- Cumulative mass detached [kg]
scalar detachedMass_;
// Protected member functions
//- Initialise the film model - called on construction
void initialise();
//- Read control parameters from dictionary
virtual bool read();
//- Reset source term fields
virtual void resetPrimaryRegionSourceTerms();
//- Transfer fields from the primary region to the film region
virtual void transferPrimaryRegionFields();
//- Correct the source terms for film that detaches from film region
virtual void correctDetachedFilm();
// Explicit pressure source contribution
virtual tmp<volScalarField> pu();
// Implicit pressure source coefficient
virtual tmp<volScalarField> pp();
//- Update the film sub-models
virtual void updateSubmodels();
//- Courant number evaluation
virtual scalar CourantNumber() const;
//- Continuity check
virtual void continuityCheck();
//- Return the stress term for the momentum equation
virtual tmp<fvVectorMatrix> tau(volVectorField& dU) const;
//- Constrain a film region master/slave boundaries of a field to a
// given value
template<class Type>
void constrainFilmField
(
Type& field,
const typename Type::cmptType& value
);
// Equations
//- Solve continuity equation
virtual void solveContinuity();
//- Solve for film velocity
virtual tmp<fvVectorMatrix> solveMomentum
(
const volScalarField& pu,
const volScalarField& pp
);
//- Solve coupled velocity-thickness equations
virtual void solveThickness
(
const volScalarField& pu,
const volScalarField& pp,
const fvVectorMatrix& UEqn
);
public:
//- Runtime type information
TypeName("kinematicSingleLayer");
// Constructors
//- Construct from components
kinematicSingleLayer
(
const word& modelType,
const fvMesh& mesh,
const dimensionedVector& g
);
//- Destructor
virtual ~kinematicSingleLayer();
// Member Functions
// Access
//- Return the film mesh database
virtual const fvMesh& film() const;
//- Return the patch normal vectors
inline const volVectorField& nHat() const;
//- Return the face area magnitudes / [m2]
inline const volScalarField& magSf() const;
//- Return the list of coupled patches on the film region
virtual const labelList& filmBottomPatchIDs() const;
//- Return the list of patches oppositte coupled patches
virtual const labelList& filmTopPatchIDs() const;
//- Return the list of coupled patches on the primary region
virtual const labelList& primaryPatchIDs() const;
// Solution parameters
//- Return the momentum predictor
inline const Switch& momentumPredictor() const;
//- Return the number of outer correctors
inline label nOuterCorr() const;
//- Return the number of PISO correctors
inline label nCorr() const;
//- Return the number of non-orthogonal correctors
inline label nNonOrthCorr() const;
// Model parameters
//- Return the skin friction coefficient
inline scalar Cf() const;
// Thermo properties
//- Return const access to the dynamic viscosity / [Pa.s]
inline const volScalarField& mu() const;
//- Return const access to the surface tension / [m/s2]
inline const volScalarField& sigma() const;
// Fields
//- Return const access to the film thickness / [m]
inline const volScalarField& delta() const;
//- Return the film velocity [m/s]
virtual const volVectorField& U() const;
//- Return the film density [kg/m3]
virtual const volScalarField& rho() const;
//- Return the film temperature [K]
virtual const volScalarField& T() const;
//- Return the film specific heat capacity [J/kg/K]
virtual const volScalarField& cp() const;
// Transfer fields - to the primary region
//- Return the film mass available for transfer
virtual const volScalarField& massForPrimary() const;
//- Return the parcel diameters originating from film
virtual const volScalarField& diametersForPrimary() const;
// External helper functions
//- Return true if patchI on the primary region is a coupled patch
// to the film region
virtual bool isFilmPatch(const label patchI) const;
//- External hook to add sources to the film
virtual void addSources
(
const label patchI, // patchI on primary region
const label faceI, // faceI of patchI
const scalar massSource, // [kg]
const vector& momentumSource, // [kg.m/s] (tangential momentum)
const scalar pressureSource, // [kg.m/s] (normal momentum)
const scalar energySource = 0 // [J]
);
// Source fields (read/write access)
// Primary region
//- Momementum / [kg/m/s2]
inline volVectorField& USpPrimary();
//- Pressure / [Pa]
inline volScalarField& pSpPrimary();
//- Mass / [kg/m2/s]
inline volScalarField& rhoSpPrimary();
// Film region
//- Momementum / [kg/m/s2]
inline volVectorField& USp();
//- Pressure / [Pa]
inline volScalarField& pSp();
//- Mass / [kg/m2/s]
inline volScalarField& rhoSp();
// Sub-models
//- Injection
inline injectionModel& injection();
// Helper functions
//- Return the gravity tangential component contributions
inline tmp<volVectorField> gTan() const;
//- Return the gravity normal-to-patch component contribution
inline tmp<volScalarField> gNorm() const;
//- Return the gravity normal-to-patch component contribution
// Clipped so that only non-zero if g & nHat_ < 0
inline tmp<volScalarField> gNormClipped() const;
// Evolution
//- Evolve the film equations
virtual void evolveFilm();
// I-O
//- Provide some feedback
virtual void info() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "kinematicSingleLayerTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "kinematicSingleLayerI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,62 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "kinematicSingleLayer.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::surfaceFilmModels::kinematicSingleLayer::constrainFilmField
(
Type& field,
const typename Type::cmptType& value
)
{
forAll(filmBottomPatchIDs_, i)
{
label patchI = filmBottomPatchIDs_[i];
field.boundaryField()[patchI] = value;
if (debug)
{
Info<< "Constraining " << field.name()
<< " boundary " << field.boundaryField()[patchI].patch().name()
<< " to " << value << endl;
}
}
forAll(filmTopPatchIDs_, i)
{
label patchI = filmTopPatchIDs_[i];
field.boundaryField()[patchI] = value;
if (debug)
{
Info<< "Constraining " << field.name()
<< " boundary " << field.boundaryField()[patchI].patch().name()
<< " to " << value << endl;
}
}
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "kinematicSingleLayer.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::surfaceFilmModels::kinematicSingleLayer::constrainFilmField
(
Type& field,
const typename Type::cmptType& value
)
{
forAll(filmBottomPatchIDs_, i)
{
label patchI = filmBottomPatchIDs_[i];
field.boundaryField()[patchI] = value;
if (debug)
{
Info<< "Constraining " << field.name()
<< " boundary " << field.boundaryField()[patchI].patch().name()
<< " to " << value << endl;
}
}
forAll(filmTopPatchIDs_, i)
{
label patchI = filmTopPatchIDs_[i];
field.boundaryField()[patchI] = value;
if (debug)
{
Info<< "Constraining " << field.name()
<< " boundary " << field.boundaryField()[patchI].patch().name()
<< " to " << value << endl;
}
}
}
// ************************************************************************* //

View File

@ -137,7 +137,7 @@ Foam::tmp<Foam::fvScalarMatrix> Foam::surfaceFilmModels::thermoSingleLayer::q
dimensionedScalar("zero", dimTemperature, 0.0)
);
for (label i=0; i<filmBottomPatchIDs_.size(); i++)
forAll(filmBottomPatchIDs_, i)
{
label patchI = filmBottomPatchIDs_[i];
const polyPatch& pp = filmRegion_.boundaryMesh()[patchI];

View File

@ -160,8 +160,8 @@ Foam::scalar Foam::ODEChemistryModel<CompType, ThermoType>::omega
pf = 1.0;
pr = 1.0;
label Nl = R.lhs().size();
label Nr = R.rhs().size();
const label Nl = R.lhs().size();
const label Nr = R.rhs().size();
label slRef = 0;
lRef = R.lhs()[slRef].index;
@ -331,7 +331,7 @@ void Foam::ODEChemistryModel<CompType, ThermoType>::jacobian
// length of the first argument must be nSpecie()
dcdt = omega(c2, T, p);
for (label ri=0; ri<reactions_.size(); ri++)
forAll(reactions_, ri)
{
const Reaction<ThermoType>& R = reactions_[ri];

View File

@ -75,7 +75,7 @@ Foam::scalar Foam::EulerImplicit<CompType, ThermoType>::solve
RR.source()[i] = c[i]/dt;
}
for (label i=0; i<this->model_.reactions().size(); i++)
forAll(this->model_.reactions(), i)
{
const Reaction<ThermoType>& R = this->model_.reactions()[i];
@ -100,7 +100,7 @@ Foam::scalar Foam::EulerImplicit<CompType, ThermoType>::solve
}
}
for (label s=0; s<R.lhs().size(); s++)
forAll(R.lhs(), s)
{
label si = R.lhs()[s].index;
scalar sl = R.lhs()[s].stoichCoeff;
@ -108,7 +108,7 @@ Foam::scalar Foam::EulerImplicit<CompType, ThermoType>::solve
RR[si][lRef] += sl*pf*corr;
}
for (label s=0; s<R.rhs().size(); s++)
forAll(R.rhs(), s)
{
label si = R.rhs()[s].index;
scalar sr = R.rhs()[s].stoichCoeff;

View File

@ -86,7 +86,7 @@ Foam::scalar Foam::ode<CompType, ThermoType>::solve
dtEst
);
for (label i=0; i<c.size(); i++)
forAll(c, i)
{
c[i] = max(0.0, c1[i]);
}

View File

@ -66,7 +66,7 @@ Foam::scalar Foam::sequential<CompType, ThermoType>::solve
scalar pf, cf, pb, cb;
label lRef, rRef;
for (label i=0; i<this->model_.reactions().size(); i++)
forAll(this->model_.reactions(), i)
{
const Reaction<ThermoType>& R = this->model_.reactions()[i];
@ -95,7 +95,7 @@ Foam::scalar Foam::sequential<CompType, ThermoType>::solve
// update species
for (label s=0; s<R.lhs().size(); s++)
forAll(R.lhs(), s)
{
label si = R.lhs()[s].index;
scalar sl = R.lhs()[s].stoichCoeff;
@ -103,7 +103,7 @@ Foam::scalar Foam::sequential<CompType, ThermoType>::solve
c[si] = max(0.0, c[si]);
}
for (label s=0; s<R.rhs().size(); s++)
forAll(R.rhs(), s)
{
label si = R.rhs()[s].index;
scalar sr = R.rhs()[s].stoichCoeff;

View File

@ -47,7 +47,7 @@ void Foam::Reaction<ReactionThermo>::setThermo
);
}
for (label i=0; i<lhs_.size(); i++)
forAll(lhs_, i)
{
operator-=
(

View File

@ -450,7 +450,7 @@ bool Foam::faceTriangulation::split
label index1 = -1;
label index2 = -1;
for (label iter = 0; iter < f.size(); iter++)
forAll(f, iter)
{
findDiagonal
(

View File

@ -33,10 +33,8 @@ License
#include "PackedBoolList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(Foam::triSurface, 0);
}
defineTypeNameAndDebug(Foam::triSurface, 0);
Foam::fileName Foam::triSurface::triSurfInstance(const Time& d)