Change field loop index from "fieldI" to "fieldi"

This commit is contained in:
Henry Weller
2016-05-02 18:20:48 +01:00
parent f83975a701
commit 3cd9b4f5d7
67 changed files with 378 additions and 378 deletions

View File

@ -33,7 +33,7 @@ void Foam::addToFieldList
( (
PtrList<GeoField>& fieldList, PtrList<GeoField>& fieldList,
const IOobject& obj, const IOobject& obj,
const label fieldI, const label fieldi,
const typename GeoField::Mesh& mesh const typename GeoField::Mesh& mesh
) )
{ {
@ -41,7 +41,7 @@ void Foam::addToFieldList
{ {
fieldList.set fieldList.set
( (
fieldI, fieldi,
new GeoField(obj, mesh) new GeoField(obj, mesh)
); );
Info<< " " << GeoField::typeName << tab << obj.name() << endl; Info<< " " << GeoField::typeName << tab << obj.name() << endl;
@ -56,14 +56,14 @@ void Foam::outputFieldList
const label patchi const label patchi
) )
{ {
forAll(fieldList, fieldI) forAll(fieldList, fieldi)
{ {
if (fieldList.set(fieldI)) if (fieldList.set(fieldi))
{ {
Info<< " " << pTraits<typename GeoField::value_type>::typeName Info<< " " << pTraits<typename GeoField::value_type>::typeName
<< tab << tab << tab << tab
<< fieldList[fieldI].name() << tab << tab << fieldList[fieldi].name() << tab << tab
<< fieldList[fieldI].boundaryField()[patchi].type() << nl; << fieldList[fieldi].boundaryField()[patchi].type() << nl;
} }
} }
} }
@ -77,14 +77,14 @@ void Foam::collectFieldList
HashTable<word>& fieldToType HashTable<word>& fieldToType
) )
{ {
forAll(fieldList, fieldI) forAll(fieldList, fieldi)
{ {
if (fieldList.set(fieldI)) if (fieldList.set(fieldi))
{ {
fieldToType.insert fieldToType.insert
( (
fieldList[fieldI].name(), fieldList[fieldi].name(),
fieldList[fieldI].boundaryField()[patchi].type() fieldList[fieldi].boundaryField()[patchi].type()
); );
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,7 +38,7 @@ namespace Foam
( (
PtrList<GeoField>& fieldList, PtrList<GeoField>& fieldList,
const IOobject& obj, const IOobject& obj,
const label fieldI, const label fieldi,
const typename GeoField::Mesh& mesh const typename GeoField::Mesh& mesh
); );

View File

@ -65,9 +65,9 @@ void Foam::dimFieldDecomposer::decomposeFields
const PtrList<GeoField>& fields const PtrList<GeoField>& fields
) const ) const
{ {
forAll(fields, fieldI) forAll(fields, fieldi)
{ {
decomposeField(fields[fieldI])().write(); decomposeField(fields[fieldi])().write();
} }
} }

View File

@ -190,9 +190,9 @@ void Foam::lagrangianFieldDecomposer::decomposeFields
{ {
if (particleIndices_.size()) if (particleIndices_.size())
{ {
forAll(fields, fieldI) forAll(fields, fieldi)
{ {
decomposeField(cloudName, fields[fieldI])().write(); decomposeField(cloudName, fields[fieldi])().write();
} }
} }
} }
@ -207,9 +207,9 @@ void Foam::lagrangianFieldDecomposer::decomposeFieldFields
{ {
if (particleIndices_.size()) if (particleIndices_.size())
{ {
forAll(fields, fieldI) forAll(fields, fieldi)
{ {
decomposeFieldField(cloudName, fields[fieldI])().write(); decomposeFieldField(cloudName, fields[fieldi])().write();
} }
} }
} }

View File

@ -101,9 +101,9 @@ void Foam::pointFieldDecomposer::decomposeFields
const PtrList<GeoField>& fields const PtrList<GeoField>& fields
) const ) const
{ {
forAll(fields, fieldI) forAll(fields, fieldi)
{ {
decomposeField(fields[fieldI])().write(); decomposeField(fields[fieldi])().write();
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,12 +48,12 @@ void Foam::readFields
// Construct the fields // Construct the fields
fields.setSize(fieldObjects.size()); fields.setSize(fieldObjects.size());
label fieldI = 0; label fieldi = 0;
forAllIter(IOobjectList, fieldObjects, iter) forAllIter(IOobjectList, fieldObjects, iter)
{ {
fields.set fields.set
( (
fieldI++, fieldi++,
new GeoField(*iter(), mesh) new GeoField(*iter(), mesh)
); );
} }

View File

@ -34,9 +34,9 @@ void Foam::patchWriter::write
const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds
) )
{ {
forAll(flds, fieldI) forAll(flds, fieldi)
{ {
const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldI]; const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldi];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' ' os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
<< nFaces_ << " float" << std::endl; << nFaces_ << " float" << std::endl;
@ -69,10 +69,10 @@ void Foam::patchWriter::write
const PtrList<GeometricField<Type, pointPatchField, pointMesh>>& flds const PtrList<GeometricField<Type, pointPatchField, pointMesh>>& flds
) )
{ {
forAll(flds, fieldI) forAll(flds, fieldi)
{ {
const GeometricField<Type, pointPatchField, pointMesh>& fld = const GeometricField<Type, pointPatchField, pointMesh>& fld =
flds[fieldI]; flds[fieldi];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' ' os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
<< nPoints_ << " float" << std::endl; << nPoints_ << " float" << std::endl;
@ -99,9 +99,9 @@ void Foam::patchWriter::write
const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds
) )
{ {
forAll(flds, fieldI) forAll(flds, fieldi)
{ {
const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldI]; const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldi];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' ' os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
<< nPoints_ << " float" << std::endl; << nPoints_ << " float" << std::endl;

View File

@ -66,10 +66,10 @@ void Foam::surfaceMeshWriter::write
const PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>& sflds const PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>& sflds
) )
{ {
forAll(sflds, fieldI) forAll(sflds, fieldi)
{ {
const GeometricField<Type, fvsPatchField, surfaceMesh>& fld = const GeometricField<Type, fvsPatchField, surfaceMesh>& fld =
sflds[fieldI]; sflds[fieldi];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' ' os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
<< pp_.size() << " float" << std::endl; << pp_.size() << " float" << std::endl;

View File

@ -75,9 +75,9 @@ void writeSurfFields
<< "FIELD attributes " << surfVectorFields.size() << std::endl; << "FIELD attributes " << surfVectorFields.size() << std::endl;
// surfVectorFields // surfVectorFields
forAll(surfVectorFields, fieldI) forAll(surfVectorFields, fieldi)
{ {
const surfaceVectorField& svf = surfVectorFields[fieldI]; const surfaceVectorField& svf = surfVectorFields[fieldi];
str << svf.name() << " 3 " str << svf.name() << " 3 "
<< mesh.nFaces() << " float" << std::endl; << mesh.nFaces() << " float" << std::endl;

View File

@ -116,17 +116,17 @@ void writeVTKFields
{ {
label step = max(floor(8/pTraits<Type>::nComponents), 1); label step = max(floor(8/pTraits<Type>::nComponents), 1);
forAll(values, fieldI) forAll(values, fieldi)
{ {
Info<< " writing field " << fieldNames[fieldI] << endl; Info<< " writing field " << fieldNames[fieldi] << endl;
os << nl << fieldNames[fieldI] << ' ' << pTraits<Type>::nComponents os << nl << fieldNames[fieldi] << ' ' << pTraits<Type>::nComponents
<< ' ' << values[fieldI].size() << " float" << nl; << ' ' << values[fieldi].size() << " float" << nl;
label offset = 0; label offset = 0;
forAll(addr, trackI) forAll(addr, trackI)
{ {
const List<label> ids(addr[trackI]); const List<label> ids(addr[trackI]);
List<Type> data(UIndirectList<Type>(values[fieldI], ids)); List<Type> data(UIndirectList<Type>(values[fieldi], ids));
label nData = data.size() - 1; label nData = data.size() - 1;
forAll(data, i) forAll(data, i)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -147,7 +147,7 @@ void ${typeName}FvOption${SourceType}::correct
void ${typeName}FvOption${SourceType}::addSup void ${typeName}FvOption${SourceType}::addSup
( (
fvMatrix<${TemplateType}>& eqn, fvMatrix<${TemplateType}>& eqn,
const label fieldI const label fieldi
) )
{ {
if (${verbose:-false}) if (${verbose:-false})
@ -165,7 +165,7 @@ void ${typeName}FvOption${SourceType}::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<${TemplateType}>& eqn, fvMatrix<${TemplateType}>& eqn,
const label fieldI const label fieldi
) )
{ {
if (${verbose:-false}) if (${verbose:-false})
@ -182,7 +182,7 @@ void ${typeName}FvOption${SourceType}::addSup
void ${typeName}FvOption${SourceType}::setValue void ${typeName}FvOption${SourceType}::setValue
( (
fvMatrix<${TemplateType}>& eqn, fvMatrix<${TemplateType}>& eqn,
const label fieldI const label fieldi
) )
{ {
if (${verbose:-false}) if (${verbose:-false})

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,13 +33,13 @@ Description
codeAddSup codeAddSup
( (
fvMatrix<Type}>& eqn, fvMatrix<Type}>& eqn,
const label fieldI const label fieldi
) )
setValue setValue
( (
fvMatrix<Type}>& eqn, fvMatrix<Type}>& eqn,
const label fieldI const label fieldi
) )
where : where :
@ -159,7 +159,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<${TemplateType}>& eqn, fvMatrix<${TemplateType}>& eqn,
const label fieldI const label fieldi
); );
//- Explicit and implicit matrix contributions for compressible //- Explicit and implicit matrix contributions for compressible
@ -168,14 +168,14 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<${TemplateType}>& eqn, fvMatrix<${TemplateType}>& eqn,
const label fieldI const label fieldi
); );
//- Set value //- Set value
virtual void setValue virtual void setValue
( (
fvMatrix<${TemplateType}>& eqn, fvMatrix<${TemplateType}>& eqn,
const label fieldI const label fieldi
); );
}; };

View File

@ -103,7 +103,7 @@ Foam::tmp<GeoField> Foam::uniformInterpolate
( (
times[i] times[i]
); );
const GeoField& fieldI = timeIFields.lookupObject const GeoField& fieldi = timeIFields.lookupObject
< <
const GeoField const GeoField
> >
@ -111,7 +111,7 @@ Foam::tmp<GeoField> Foam::uniformInterpolate
fieldName fieldName
); );
fld += weights[i]*fieldI; fld += weights[i]*fieldi;
} }
return tfld; return tfld;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,12 +45,12 @@ void Foam::jplotGraph::write(const graph& g, Ostream& os) const
os << "# JPlot file" << nl os << "# JPlot file" << nl
<< "# column 1: " << g.xName() << endl; << "# column 1: " << g.xName() << endl;
label fieldI = 0; label fieldi = 0;
forAllConstIter(graph, g, iter) forAllConstIter(graph, g, iter)
{ {
os << "# column " << fieldI + 2 << ": " << (*iter()).name() << endl; os << "# column " << fieldi + 2 << ": " << (*iter()).name() << endl;
fieldI++; fieldi++;
} }
g.writeTable(os); g.writeTable(os);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -46,20 +46,20 @@ void Foam::xmgrGraph::write(const graph& g, Ostream& os) const
<< "@xaxis label " << g.xName() << nl << "@xaxis label " << g.xName() << nl
<< "@yaxis label " << g.yName() << endl; << "@yaxis label " << g.yName() << endl;
label fieldI = 0; label fieldi = 0;
forAllConstIter(graph, g, iter) forAllConstIter(graph, g, iter)
{ {
os << "@s" << fieldI << " legend " os << "@s" << fieldi << " legend "
<< iter()->name() << nl << iter()->name() << nl
<< "@target G0.S" << fieldI << nl << "@target G0.S" << fieldi << nl
<< "@type xy" << endl; << "@type xy" << endl;
writeXY(g.x(), *iter(), os); writeXY(g.x(), *iter(), os);
os << endl; os << endl;
fieldI++; fieldi++;
} }
} }

View File

@ -108,7 +108,7 @@ void Foam::fvMeshDistribute::mapBoundaryFields
<< abort(FatalError); << abort(FatalError);
} }
label fieldI = 0; label fieldi = 0;
forAllIter(typename HashTable<fldType*>, flds, iter) forAllIter(typename HashTable<fldType*>, flds, iter)
{ {
@ -116,7 +116,7 @@ void Foam::fvMeshDistribute::mapBoundaryFields
typename fldType::Boundary& bfld = typename fldType::Boundary& bfld =
fld.boundaryFieldRef(); fld.boundaryFieldRef();
const FieldField<fvsPatchField, T>& oldBfld = oldBflds[fieldI++]; const FieldField<fvsPatchField, T>& oldBfld = oldBflds[fieldi++];
// Pull from old boundary field into bfld. // Pull from old boundary field into bfld.

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -126,7 +126,7 @@ void Foam::fv::option::checkApplied() const
void Foam::fv::option::addSup void Foam::fv::option::addSup
( (
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -134,7 +134,7 @@ void Foam::fv::option::addSup
void Foam::fv::option::addSup void Foam::fv::option::addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -142,7 +142,7 @@ void Foam::fv::option::addSup
void Foam::fv::option::addSup void Foam::fv::option::addSup
( (
fvMatrix<sphericalTensor>& eqn, fvMatrix<sphericalTensor>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -150,7 +150,7 @@ void Foam::fv::option::addSup
void Foam::fv::option::addSup void Foam::fv::option::addSup
( (
fvMatrix<symmTensor>& eqn, fvMatrix<symmTensor>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -158,7 +158,7 @@ void Foam::fv::option::addSup
void Foam::fv::option::addSup void Foam::fv::option::addSup
( (
fvMatrix<tensor>& eqn, fvMatrix<tensor>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -167,7 +167,7 @@ void Foam::fv::option::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -176,7 +176,7 @@ void Foam::fv::option::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -185,7 +185,7 @@ void Foam::fv::option::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<sphericalTensor>& eqn, fvMatrix<sphericalTensor>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -194,7 +194,7 @@ void Foam::fv::option::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<symmTensor>& eqn, fvMatrix<symmTensor>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -203,7 +203,7 @@ void Foam::fv::option::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<tensor>& eqn, fvMatrix<tensor>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -213,10 +213,10 @@ void Foam::fv::option::addSup
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
) )
{ {
addSup(alpha*rho, eqn, fieldI); addSup(alpha*rho, eqn, fieldi);
} }
@ -225,10 +225,10 @@ void Foam::fv::option::addSup
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
addSup(alpha*rho, eqn, fieldI); addSup(alpha*rho, eqn, fieldi);
} }
@ -237,10 +237,10 @@ void Foam::fv::option::addSup
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<sphericalTensor>& eqn, fvMatrix<sphericalTensor>& eqn,
const label fieldI const label fieldi
) )
{ {
addSup(alpha*rho, eqn, fieldI); addSup(alpha*rho, eqn, fieldi);
} }
@ -249,10 +249,10 @@ void Foam::fv::option::addSup
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<symmTensor>& eqn, fvMatrix<symmTensor>& eqn,
const label fieldI const label fieldi
) )
{ {
addSup(alpha*rho, eqn, fieldI); addSup(alpha*rho, eqn, fieldi);
} }
@ -261,25 +261,25 @@ void Foam::fv::option::addSup
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<tensor>& eqn, fvMatrix<tensor>& eqn,
const label fieldI const label fieldi
) )
{ {
addSup(alpha*rho, eqn, fieldI); addSup(alpha*rho, eqn, fieldi);
} }
void Foam::fv::option::constrain(fvMatrix<scalar>& eqn, const label fieldI) void Foam::fv::option::constrain(fvMatrix<scalar>& eqn, const label fieldi)
{} {}
void Foam::fv::option::constrain(fvMatrix<vector>& eqn, const label fieldI) void Foam::fv::option::constrain(fvMatrix<vector>& eqn, const label fieldi)
{} {}
void Foam::fv::option::constrain void Foam::fv::option::constrain
( (
fvMatrix<sphericalTensor>& eqn, fvMatrix<sphericalTensor>& eqn,
const label fieldI const label fieldi
) )
{} {}
@ -287,12 +287,12 @@ void Foam::fv::option::constrain
void Foam::fv::option::constrain void Foam::fv::option::constrain
( (
fvMatrix<symmTensor>& eqn, fvMatrix<symmTensor>& eqn,
const label fieldI const label fieldi
) )
{} {}
void Foam::fv::option::constrain(fvMatrix<tensor>& eqn, const label fieldI) void Foam::fv::option::constrain(fvMatrix<tensor>& eqn, const label fieldi)
{} {}

View File

@ -201,8 +201,8 @@ public:
//- Return const access to the source active flag //- Return const access to the source active flag
inline bool active() const; inline bool active() const;
//- Set the applied flag to true for field index fieldI //- Set the applied flag to true for field index fieldi
inline void setApplied(const label fieldI); inline void setApplied(const label fieldi);
// Edit // Edit
@ -230,31 +230,31 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
( (
fvMatrix<symmTensor>& eqn, fvMatrix<symmTensor>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
( (
fvMatrix<sphericalTensor>& eqn, fvMatrix<sphericalTensor>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
( (
fvMatrix<tensor>& eqn, fvMatrix<tensor>& eqn,
const label fieldI const label fieldi
); );
@ -264,35 +264,35 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<symmTensor>& eqn, fvMatrix<symmTensor>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<sphericalTensor>& eqn, fvMatrix<sphericalTensor>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<tensor>& eqn, fvMatrix<tensor>& eqn,
const label fieldI const label fieldi
); );
@ -303,7 +303,7 @@ public:
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
@ -311,7 +311,7 @@ public:
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
@ -319,7 +319,7 @@ public:
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<symmTensor>& eqn, fvMatrix<symmTensor>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
@ -327,7 +327,7 @@ public:
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<sphericalTensor>& eqn, fvMatrix<sphericalTensor>& eqn,
const label fieldI const label fieldi
); );
virtual void addSup virtual void addSup
@ -335,7 +335,7 @@ public:
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<tensor>& eqn, fvMatrix<tensor>& eqn,
const label fieldI const label fieldi
); );
@ -344,31 +344,31 @@ public:
virtual void constrain virtual void constrain
( (
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
); );
virtual void constrain virtual void constrain
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
virtual void constrain virtual void constrain
( (
fvMatrix<sphericalTensor>& eqn, fvMatrix<sphericalTensor>& eqn,
const label fieldI const label fieldi
); );
virtual void constrain virtual void constrain
( (
fvMatrix<symmTensor>& eqn, fvMatrix<symmTensor>& eqn,
const label fieldI const label fieldi
); );
virtual void constrain virtual void constrain
( (
fvMatrix<tensor>& eqn, fvMatrix<tensor>& eqn,
const label fieldI const label fieldi
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -49,9 +49,9 @@ inline bool Foam::fv::option::active() const
} }
inline void Foam::fv::option::setApplied(const label fieldI) inline void Foam::fv::option::setApplied(const label fieldi)
{ {
applied_[fieldI] = true; applied_[fieldi] = true;
} }

View File

@ -53,11 +53,11 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
{ {
option& source = this->operator[](i); option& source = this->operator[](i);
label fieldI = source.applyToField(fieldName); label fieldi = source.applyToField(fieldName);
if (fieldI != -1) if (fieldi != -1)
{ {
source.setApplied(fieldI); source.setApplied(fieldi);
if (source.isActive()) if (source.isActive())
{ {
@ -67,7 +67,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
<< fieldName << endl; << fieldName << endl;
} }
source.addSup(mtx, fieldI); source.addSup(mtx, fieldi);
} }
} }
} }
@ -109,11 +109,11 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
{ {
option& source = this->operator[](i); option& source = this->operator[](i);
label fieldI = source.applyToField(fieldName); label fieldi = source.applyToField(fieldName);
if (fieldI != -1) if (fieldi != -1)
{ {
source.setApplied(fieldI); source.setApplied(fieldi);
if (source.isActive()) if (source.isActive())
{ {
@ -123,7 +123,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
<< fieldName << endl; << fieldName << endl;
} }
source.addSup(rho, mtx, fieldI); source.addSup(rho, mtx, fieldi);
} }
} }
} }
@ -168,11 +168,11 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
{ {
option& source = this->operator[](i); option& source = this->operator[](i);
label fieldI = source.applyToField(fieldName); label fieldi = source.applyToField(fieldName);
if (fieldI != -1) if (fieldi != -1)
{ {
source.setApplied(fieldI); source.setApplied(fieldi);
if (source.isActive()) if (source.isActive())
{ {
@ -182,7 +182,7 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fv::optionList::operator()
<< fieldName << endl; << fieldName << endl;
} }
source.addSup(alpha, rho, mtx, fieldI); source.addSup(alpha, rho, mtx, fieldi);
} }
} }
} }
@ -251,11 +251,11 @@ void Foam::fv::optionList::constrain(fvMatrix<Type>& eqn)
{ {
option& source = this->operator[](i); option& source = this->operator[](i);
label fieldI = source.applyToField(eqn.psi().name()); label fieldi = source.applyToField(eqn.psi().name());
if (fieldI != -1) if (fieldi != -1)
{ {
source.setApplied(fieldI); source.setApplied(fieldi);
if (source.isActive()) if (source.isActive())
{ {
@ -265,7 +265,7 @@ void Foam::fv::optionList::constrain(fvMatrix<Type>& eqn)
<< " to field " << eqn.psi().name() << endl; << " to field " << eqn.psi().name() << endl;
} }
source.constrain(eqn, fieldI); source.constrain(eqn, fieldi);
} }
} }
} }
@ -284,11 +284,11 @@ void Foam::fv::optionList::correct
{ {
option& source = this->operator[](i); option& source = this->operator[](i);
label fieldI = source.applyToField(fieldName); label fieldi = source.applyToField(fieldName);
if (fieldI != -1) if (fieldi != -1)
{ {
source.setApplied(fieldI); source.setApplied(fieldi);
if (source.isActive()) if (source.isActive())
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -67,8 +67,8 @@ bool Foam::pimpleControl::criteriaSatisfied()
forAllConstIter(dictionary, solverDict, iter) forAllConstIter(dictionary, solverDict, iter)
{ {
const word& variableName = iter().keyword(); const word& variableName = iter().keyword();
const label fieldI = applyToField(variableName); const label fieldi = applyToField(variableName);
if (fieldI != -1) if (fieldi != -1)
{ {
scalar residual = 0; scalar residual = 0;
const scalar firstResidual = const scalar firstResidual =
@ -78,21 +78,21 @@ bool Foam::pimpleControl::criteriaSatisfied()
if (storeIni) if (storeIni)
{ {
residualControl_[fieldI].initialResidual = firstResidual; residualControl_[fieldi].initialResidual = firstResidual;
} }
const bool absCheck = residual < residualControl_[fieldI].absTol; const bool absCheck = residual < residualControl_[fieldi].absTol;
bool relCheck = false; bool relCheck = false;
scalar relative = 0.0; scalar relative = 0.0;
if (!storeIni) if (!storeIni)
{ {
const scalar iniRes = const scalar iniRes =
residualControl_[fieldI].initialResidual residualControl_[fieldi].initialResidual
+ ROOTVSMALL; + ROOTVSMALL;
relative = residual/iniRes; relative = residual/iniRes;
relCheck = relative < residualControl_[fieldI].relTol; relCheck = relative < residualControl_[fieldi].relTol;
} }
achieved = achieved && (absCheck || relCheck); achieved = achieved && (absCheck || relCheck);
@ -104,11 +104,11 @@ bool Foam::pimpleControl::criteriaSatisfied()
Info<< " " << variableName Info<< " " << variableName
<< " PIMPLE iter " << corr_ << " PIMPLE iter " << corr_
<< ": ini res = " << ": ini res = "
<< residualControl_[fieldI].initialResidual << residualControl_[fieldi].initialResidual
<< ", abs tol = " << residual << ", abs tol = " << residual
<< " (" << residualControl_[fieldI].absTol << ")" << " (" << residualControl_[fieldi].absTol << ")"
<< ", rel tol = " << relative << ", rel tol = " << relative
<< " (" << residualControl_[fieldI].relTol << ")" << " (" << residualControl_[fieldi].relTol << ")"
<< endl; << endl;
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -56,8 +56,8 @@ bool Foam::simpleControl::criteriaSatisfied()
forAllConstIter(dictionary, solverDict, iter) forAllConstIter(dictionary, solverDict, iter)
{ {
const word& variableName = iter().keyword(); const word& variableName = iter().keyword();
const label fieldI = applyToField(variableName); const label fieldi = applyToField(variableName);
if (fieldI != -1) if (fieldi != -1)
{ {
scalar lastResidual = 0; scalar lastResidual = 0;
const scalar residual = const scalar residual =
@ -65,7 +65,7 @@ bool Foam::simpleControl::criteriaSatisfied()
checked = true; checked = true;
bool absCheck = residual < residualControl_[fieldI].absTol; bool absCheck = residual < residualControl_[fieldi].absTol;
achieved = achieved && absCheck; achieved = achieved && absCheck;
if (debug) if (debug)
@ -73,7 +73,7 @@ bool Foam::simpleControl::criteriaSatisfied()
Info<< algorithmName_ << " solution statistics:" << endl; Info<< algorithmName_ << " solution statistics:" << endl;
Info<< " " << variableName << ": tolerance = " << residual Info<< " " << variableName << ": tolerance = " << residual
<< " (" << residualControl_[fieldI].absTol << ")" << " (" << residualControl_[fieldi].absTol << ")"
<< endl; << endl;
} }
} }

View File

@ -58,8 +58,8 @@ void Foam::solutionControl::read(const bool absTolOnly)
forAllConstIter(dictionary, residualDict, iter) forAllConstIter(dictionary, residualDict, iter)
{ {
const word& fName = iter().keyword(); const word& fName = iter().keyword();
const label fieldI = applyToField(fName, false); const label fieldi = applyToField(fName, false);
if (fieldI == -1) if (fieldi == -1)
{ {
fieldData fd; fieldData fd;
fd.name = fName.c_str(); fd.name = fName.c_str();
@ -92,7 +92,7 @@ void Foam::solutionControl::read(const bool absTolOnly)
} }
else else
{ {
fieldData& fd = data[fieldI]; fieldData& fd = data[fieldi];
if (absTolOnly) if (absTolOnly)
{ {
fd.absTol = readScalar(residualDict.lookup(fName)); fd.absTol = readScalar(residualDict.lookup(fName));

View File

@ -137,7 +137,7 @@ public:
// Member Functions // Member Functions
//- Constrain energy equation to fix the temperature //- Constrain energy equation to fix the temperature
virtual void constrain(fvMatrix<scalar>& eqn, const label fieldI); virtual void constrain(fvMatrix<scalar>& eqn, const label fieldi);
// IO // IO

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -72,7 +72,7 @@ template<class Type>
void Foam::fv::ExplicitSetValue<Type>::constrain void Foam::fv::ExplicitSetValue<Type>::constrain
( (
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
) )
{ {
if (debug) if (debug)
@ -81,7 +81,7 @@ void Foam::fv::ExplicitSetValue<Type>::constrain
<< ">::constrain for source " << name_ << endl; << ">::constrain for source " << name_ << endl;
} }
List<Type> values(cells_.size(), injectionRate_[fieldI]); List<Type> values(cells_.size(), injectionRate_[fieldi]);
eqn.setValues(cells_, values); eqn.setValues(cells_, values);
} }

View File

@ -108,7 +108,7 @@ public:
// Evaluation // Evaluation
//- Set value on field //- Set value on field
virtual void constrain(fvMatrix<Type>& eqn, const label fieldI); virtual void constrain(fvMatrix<Type>& eqn, const label fieldi);
// IO // IO

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -112,7 +112,7 @@ Foam::fv::actuationDiskSource::actuationDiskSource
void Foam::fv::actuationDiskSource::addSup void Foam::fv::actuationDiskSource::addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
const scalarField& cellsV = mesh_.V(); const scalarField& cellsV = mesh_.V();
@ -137,7 +137,7 @@ void Foam::fv::actuationDiskSource::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
const scalarField& cellsV = mesh_.V(); const scalarField& cellsV = mesh_.V();

View File

@ -193,7 +193,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
//- Source term to compressible momentum equation //- Source term to compressible momentum equation
@ -201,7 +201,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -76,7 +76,7 @@ void Foam::fv::buoyancyEnergy::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
) )
{ {
const uniformDimensionedVectorField& g = const uniformDimensionedVectorField& g =

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -105,7 +105,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -86,7 +86,7 @@ void Foam::fv::buoyancyForce::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
eqn += rho*g_; eqn += rho*g_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -104,7 +104,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );

View File

@ -251,7 +251,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
) )
{ {
NotImplemented; NotImplemented;
@ -265,7 +265,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -86,7 +86,7 @@ Foam::fv::explicitPorositySource::explicitPorositySource
void Foam::fv::explicitPorositySource::addSup void Foam::fv::explicitPorositySource::addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
fvMatrix<vector> porosityEqn(eqn.psi(), eqn.dimensions()); fvMatrix<vector> porosityEqn(eqn.psi(), eqn.dimensions());
@ -99,7 +99,7 @@ void Foam::fv::explicitPorositySource::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
fvMatrix<vector> porosityEqn(eqn.psi(), eqn.dimensions()); fvMatrix<vector> porosityEqn(eqn.psi(), eqn.dimensions());
@ -113,7 +113,7 @@ void Foam::fv::explicitPorositySource::addSup
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
fvMatrix<vector> porosityEqn(eqn.psi(), eqn.dimensions()); fvMatrix<vector> porosityEqn(eqn.psi(), eqn.dimensions());

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -138,7 +138,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
//- Add implicit contribution to compressible momentum equation //- Add implicit contribution to compressible momentum equation
@ -146,7 +146,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
//- Add implicit contribution to phase momentum equation //- Add implicit contribution to phase momentum equation
@ -155,7 +155,7 @@ public:
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );

View File

@ -190,14 +190,14 @@ void Foam::fv::meanVelocityForce::correct(volVectorField& U)
void Foam::fv::meanVelocityForce::addSup void Foam::fv::meanVelocityForce::addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
DimensionedField<vector, volMesh> Su DimensionedField<vector, volMesh> Su
( (
IOobject IOobject
( (
name_ + fieldNames_[fieldI] + "Sup", name_ + fieldNames_[fieldi] + "Sup",
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
@ -219,10 +219,10 @@ void Foam::fv::meanVelocityForce::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
this->addSup(eqn, fieldI); this->addSup(eqn, fieldi);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -148,7 +148,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
//- Add explicit contribution to compressible momentum equation //- Add explicit contribution to compressible momentum equation
@ -156,14 +156,14 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
//- Set 1/A coefficient //- Set 1/A coefficient
virtual void constrain virtual void constrain
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,7 +65,7 @@ Foam::fv::radialActuationDiskSource::radialActuationDiskSource
void Foam::fv::radialActuationDiskSource::addSup void Foam::fv::radialActuationDiskSource::addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
const scalarField& cellsV = mesh_.V(); const scalarField& cellsV = mesh_.V();
@ -90,7 +90,7 @@ void Foam::fv::radialActuationDiskSource::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
const scalarField& cellsV = mesh_.V(); const scalarField& cellsV = mesh_.V();

View File

@ -149,7 +149,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
//- Source term to compressible momentum equation //- Source term to compressible momentum equation
@ -157,7 +157,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );

View File

@ -507,7 +507,7 @@ Foam::fv::rotorDiskSource::~rotorDiskSource()
void Foam::fv::rotorDiskSource::addSup void Foam::fv::rotorDiskSource::addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
volVectorField force volVectorField force
@ -548,7 +548,7 @@ void Foam::fv::rotorDiskSource::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
volVectorField force volVectorField force

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -306,7 +306,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
//- Source term to compressible momentum equation //- Source term to compressible momentum equation
@ -314,7 +314,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );

View File

@ -252,7 +252,7 @@ Foam::fv::solidificationMeltingSource::solidificationMeltingSource
void Foam::fv::solidificationMeltingSource::addSup void Foam::fv::solidificationMeltingSource::addSup
( (
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
) )
{ {
apply(geometricOneField(), eqn); apply(geometricOneField(), eqn);
@ -263,7 +263,7 @@ void Foam::fv::solidificationMeltingSource::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
) )
{ {
apply(rho, eqn); apply(rho, eqn);
@ -273,7 +273,7 @@ void Foam::fv::solidificationMeltingSource::addSup
void Foam::fv::solidificationMeltingSource::addSup void Foam::fv::solidificationMeltingSource::addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
if (debug) if (debug)
@ -311,11 +311,11 @@ void Foam::fv::solidificationMeltingSource::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
// Momentum source uses a Boussinesq approximation - redirect // Momentum source uses a Boussinesq approximation - redirect
addSup(eqn, fieldI); addSup(eqn, fieldi);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -221,10 +221,10 @@ public:
// Add explicit and implicit contributions // Add explicit and implicit contributions
//- Add explicit contribution to enthalpy equation //- Add explicit contribution to enthalpy equation
virtual void addSup(fvMatrix<scalar>& eqn, const label fieldI); virtual void addSup(fvMatrix<scalar>& eqn, const label fieldi);
//- Add implicit contribution to momentum equation //- Add implicit contribution to momentum equation
virtual void addSup(fvMatrix<vector>& eqn, const label fieldI); virtual void addSup(fvMatrix<vector>& eqn, const label fieldi);
// Add explicit and implicit contributions to compressible equation // Add explicit and implicit contributions to compressible equation
@ -234,7 +234,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
); );
//- Add implicit contribution to compressible momentum equation //- Add implicit contribution to compressible momentum equation
@ -242,7 +242,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -166,7 +166,7 @@ template<class Type>
void Foam::fv::CodedSource<Type>::addSup void Foam::fv::CodedSource<Type>::addSup
( (
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
) )
{ {
if (debug) if (debug)
@ -176,7 +176,7 @@ void Foam::fv::CodedSource<Type>::addSup
} }
updateLibrary(redirectType_); updateLibrary(redirectType_);
redirectFvOption().addSup(eqn, fieldI); redirectFvOption().addSup(eqn, fieldi);
} }
@ -185,7 +185,7 @@ void Foam::fv::CodedSource<Type>::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
) )
{ {
if (debug) if (debug)
@ -195,7 +195,7 @@ void Foam::fv::CodedSource<Type>::addSup
} }
updateLibrary(redirectType_); updateLibrary(redirectType_);
redirectFvOption().addSup(rho, eqn, fieldI); redirectFvOption().addSup(rho, eqn, fieldi);
} }
@ -203,7 +203,7 @@ template<class Type>
void Foam::fv::CodedSource<Type>::constrain void Foam::fv::CodedSource<Type>::constrain
( (
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
) )
{ {
if (debug) if (debug)
@ -213,7 +213,7 @@ void Foam::fv::CodedSource<Type>::constrain
} }
updateLibrary(redirectType_); updateLibrary(redirectType_);
redirectFvOption().constrain(eqn, fieldI); redirectFvOption().constrain(eqn, fieldi);
} }

View File

@ -37,13 +37,13 @@ Description
codeAddSup codeAddSup
( (
fvMatrix<Type}>& eqn, fvMatrix<Type}>& eqn,
const label fieldI const label fieldi
) )
constrain constrain
( (
fvMatrix<Type}>& eqn, fvMatrix<Type}>& eqn,
const label fieldI const label fieldi
) )
where : where :
@ -204,7 +204,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
); );
//- Explicit and implicit matrix contributions //- Explicit and implicit matrix contributions
@ -213,14 +213,14 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
); );
//- Set value //- Set value
virtual void constrain virtual void constrain
( (
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
); );

View File

@ -131,7 +131,7 @@ template<class Type>
void Foam::fv::SemiImplicitSource<Type>::addSup void Foam::fv::SemiImplicitSource<Type>::addSup
( (
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
) )
{ {
if (debug) if (debug)
@ -146,7 +146,7 @@ void Foam::fv::SemiImplicitSource<Type>::addSup
( (
IOobject IOobject
( (
name_ + fieldNames_[fieldI] + "Su", name_ + fieldNames_[fieldi] + "Su",
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
@ -162,13 +162,13 @@ void Foam::fv::SemiImplicitSource<Type>::addSup
false false
); );
UIndirectList<Type>(Su, cells_) = injectionRate_[fieldI].first()/VDash_; UIndirectList<Type>(Su, cells_) = injectionRate_[fieldi].first()/VDash_;
DimensionedField<scalar, volMesh> Sp DimensionedField<scalar, volMesh> Sp
( (
IOobject IOobject
( (
name_ + fieldNames_[fieldI] + "Sp", name_ + fieldNames_[fieldi] + "Sp",
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
@ -184,7 +184,7 @@ void Foam::fv::SemiImplicitSource<Type>::addSup
false false
); );
UIndirectList<scalar>(Sp, cells_) = injectionRate_[fieldI].second()/VDash_; UIndirectList<scalar>(Sp, cells_) = injectionRate_[fieldi].second()/VDash_;
eqn += Su + fvm::SuSp(Sp, psi); eqn += Su + fvm::SuSp(Sp, psi);
} }
@ -195,7 +195,7 @@ void Foam::fv::SemiImplicitSource<Type>::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
) )
{ {
if (debug) if (debug)
@ -204,7 +204,7 @@ void Foam::fv::SemiImplicitSource<Type>::addSup
<< ">::addSup for source " << name_ << endl; << ">::addSup for source " << name_ << endl;
} }
return this->addSup(eqn, fieldI); return this->addSup(eqn, fieldi);
} }

View File

@ -188,7 +188,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
); );
//- Add explicit contribution to compressible equation //- Add explicit contribution to compressible equation
@ -196,7 +196,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<Type>& eqn, fvMatrix<Type>& eqn,
const label fieldI const label fieldi
); );

View File

@ -134,7 +134,7 @@ Foam::fv::interRegionExplicitPorositySource::interRegionExplicitPorositySource
void Foam::fv::interRegionExplicitPorositySource::addSup void Foam::fv::interRegionExplicitPorositySource::addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
initialise(); initialise();
@ -188,7 +188,7 @@ void Foam::fv::interRegionExplicitPorositySource::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
) )
{ {
initialise(); initialise();

View File

@ -149,7 +149,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );
@ -160,7 +160,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label fieldI const label fieldi
); );

View File

@ -167,7 +167,7 @@ Foam::fv::interRegionHeatTransferModel::~interRegionHeatTransferModel()
void Foam::fv::interRegionHeatTransferModel::addSup void Foam::fv::interRegionHeatTransferModel::addSup
( (
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
) )
{ {
setNbrModel(); setNbrModel();
@ -265,10 +265,10 @@ void Foam::fv::interRegionHeatTransferModel::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
) )
{ {
addSup(eqn, fieldI); addSup(eqn, fieldi);
} }

View File

@ -174,7 +174,7 @@ public:
virtual void addSup virtual void addSup
( (
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
); );
//- Source term to compressible energy equation //- Source term to compressible energy equation
@ -182,7 +182,7 @@ public:
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
const label fieldI const label fieldi
); );
//- Calculate heat transfer coefficient //- Calculate heat transfer coefficient

View File

@ -292,10 +292,10 @@ void Foam::ReactingCloud<CloudType>::relaxSources
typedef DimensionedField<scalar, volMesh> dsfType; typedef DimensionedField<scalar, volMesh> dsfType;
forAll(rhoTrans_, fieldI) forAll(rhoTrans_, fieldi)
{ {
dsfType& rhoT = rhoTrans_[fieldI]; dsfType& rhoT = rhoTrans_[fieldi];
const dsfType& rhoT0 = cloudOldTime.rhoTrans()[fieldI]; const dsfType& rhoT0 = cloudOldTime.rhoTrans()[fieldi];
this->relax(rhoT, rhoT0, "rho"); this->relax(rhoT, rhoT0, "rho");
} }
} }
@ -308,9 +308,9 @@ void Foam::ReactingCloud<CloudType>::scaleSources()
typedef DimensionedField<scalar, volMesh> dsfType; typedef DimensionedField<scalar, volMesh> dsfType;
forAll(rhoTrans_, fieldI) forAll(rhoTrans_, fieldi)
{ {
dsfType& rhoT = rhoTrans_[fieldI]; dsfType& rhoT = rhoTrans_[fieldi];
this->scale(rhoT, "rho"); this->scale(rhoT, "rho");
} }
} }

View File

@ -323,9 +323,9 @@ void Foam::fvFieldDecomposer::decomposeFields
const PtrList<GeoField>& fields const PtrList<GeoField>& fields
) const ) const
{ {
forAll(fields, fieldI) forAll(fields, fieldi)
{ {
decomposeField(fields[fieldI])().write(); decomposeField(fields[fieldi])().write();
} }
} }

View File

@ -71,20 +71,20 @@ void Foam::functionObjects::fieldAverage::initialize()
Info<< type() << " " << name_ << ":" << nl; Info<< type() << " " << name_ << ":" << nl;
// Add mean fields to the field lists // Add mean fields to the field lists
forAll(faItems_, fieldI) forAll(faItems_, fieldi)
{ {
addMeanField<scalar>(fieldI); addMeanField<scalar>(fieldi);
addMeanField<vector>(fieldI); addMeanField<vector>(fieldi);
addMeanField<sphericalTensor>(fieldI); addMeanField<sphericalTensor>(fieldi);
addMeanField<symmTensor>(fieldI); addMeanField<symmTensor>(fieldi);
addMeanField<tensor>(fieldI); addMeanField<tensor>(fieldi);
} }
// Add prime-squared mean fields to the field lists // Add prime-squared mean fields to the field lists
forAll(faItems_, fieldI) forAll(faItems_, fieldi)
{ {
addPrime2MeanField<scalar, scalar>(fieldI); addPrime2MeanField<scalar, scalar>(fieldi);
addPrime2MeanField<vector, symmTensor>(fieldI); addPrime2MeanField<vector, symmTensor>(fieldi);
} }
// ensure first averaging works unconditionally // ensure first averaging works unconditionally
@ -152,10 +152,10 @@ void Foam::functionObjects::fieldAverage::calcAverages()
calculatePrime2MeanFields<scalar, scalar>(); calculatePrime2MeanFields<scalar, scalar>();
calculatePrime2MeanFields<vector, symmTensor>(); calculatePrime2MeanFields<vector, symmTensor>();
forAll(faItems_, fieldI) forAll(faItems_, fieldi)
{ {
totalIter_[fieldI]++; totalIter_[fieldi]++;
totalTime_[fieldI] += obr_.time().deltaTValue(); totalTime_[fieldi] += obr_.time().deltaTValue();
} }
} }
@ -188,12 +188,12 @@ void Foam::functionObjects::fieldAverage::writeAveragingProperties() const
) )
); );
forAll(faItems_, fieldI) forAll(faItems_, fieldi)
{ {
const word& fieldName = faItems_[fieldI].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
propsDict.add(fieldName, dictionary()); propsDict.add(fieldName, dictionary());
propsDict.subDict(fieldName).add("totalIter", totalIter_[fieldI]); propsDict.subDict(fieldName).add("totalIter", totalIter_[fieldi]);
propsDict.subDict(fieldName).add("totalTime", totalTime_[fieldI]); propsDict.subDict(fieldName).add("totalTime", totalTime_[fieldi]);
} }
propsDict.regIOobject::write(); propsDict.regIOobject::write();
@ -236,18 +236,18 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
IOdictionary propsDict(propsDictHeader); IOdictionary propsDict(propsDictHeader);
Info<< " Restarting averaging for fields:" << nl; Info<< " Restarting averaging for fields:" << nl;
forAll(faItems_, fieldI) forAll(faItems_, fieldi)
{ {
const word& fieldName = faItems_[fieldI].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
if (propsDict.found(fieldName)) if (propsDict.found(fieldName))
{ {
dictionary fieldDict(propsDict.subDict(fieldName)); dictionary fieldDict(propsDict.subDict(fieldName));
totalIter_[fieldI] = readLabel(fieldDict.lookup("totalIter")); totalIter_[fieldi] = readLabel(fieldDict.lookup("totalIter"));
totalTime_[fieldI] = readScalar(fieldDict.lookup("totalTime")); totalTime_[fieldi] = readScalar(fieldDict.lookup("totalTime"));
Info<< " " << fieldName Info<< " " << fieldName
<< " iters = " << totalIter_[fieldI] << " iters = " << totalIter_[fieldi]
<< " time = " << totalTime_[fieldI] << nl; << " time = " << totalTime_[fieldi] << nl;
} }
} }
} }

View File

@ -211,19 +211,19 @@ protected:
//- Add mean average field to database //- Add mean average field to database
template<class Type> template<class Type>
void addMeanFieldType(const label fieldI); void addMeanFieldType(const label fieldi);
//- Add mean average field to database //- Add mean average field to database
template<class Type> template<class Type>
void addMeanField(const label fieldI); void addMeanField(const label fieldi);
//- Add prime-squared average field to database //- Add prime-squared average field to database
template<class Type1, class Type2> template<class Type1, class Type2>
void addPrime2MeanFieldType(const label fieldI); void addPrime2MeanFieldType(const label fieldi);
//- Add prime-squared average field to database //- Add prime-squared average field to database
template<class Type1, class Type2> template<class Type1, class Type2>
void addPrime2MeanField(const label fieldI); void addPrime2MeanField(const label fieldi);
// Calculation functions // Calculation functions
@ -233,7 +233,7 @@ protected:
//- Calculate mean average fields //- Calculate mean average fields
template<class Type> template<class Type>
void calculateMeanFieldType(const label fieldI) const; void calculateMeanFieldType(const label fieldi) const;
//- Calculate mean average fields //- Calculate mean average fields
template<class Type> template<class Type>
@ -241,7 +241,7 @@ protected:
//- Calculate prime-squared average fields //- Calculate prime-squared average fields
template<class Type1, class Type2> template<class Type1, class Type2>
void calculatePrime2MeanFieldType(const label fieldI) const; void calculatePrime2MeanFieldType(const label fieldi) const;
//- Calculate prime-squared average fields //- Calculate prime-squared average fields
template<class Type1, class Type2> template<class Type1, class Type2>
@ -249,7 +249,7 @@ protected:
//- Add mean-squared field value to prime-squared mean field //- Add mean-squared field value to prime-squared mean field
template<class Type1, class Type2> template<class Type1, class Type2>
void addMeanSqrToPrime2MeanType(const label fieldI) const; void addMeanSqrToPrime2MeanType(const label fieldi) const;
//- Add mean-squared field value to prime-squared mean field //- Add mean-squared field value to prime-squared mean field
template<class Type1, class Type2> template<class Type1, class Type2>

View File

@ -31,10 +31,10 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type> template<class Type>
void Foam::functionObjects::fieldAverage::addMeanFieldType(const label fieldI) void Foam::functionObjects::fieldAverage::addMeanFieldType(const label fieldi)
{ {
const word& fieldName = faItems_[fieldI].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
const word& meanFieldName = faItems_[fieldI].meanFieldName(); const word& meanFieldName = faItems_[fieldi].meanFieldName();
Info<< " Reading/initialising field " << meanFieldName << endl; Info<< " Reading/initialising field " << meanFieldName << endl;
@ -48,7 +48,7 @@ void Foam::functionObjects::fieldAverage::addMeanFieldType(const label fieldI)
<< " since an object with that name already exists." << " since an object with that name already exists."
<< " Disabling averaging for field." << endl; << " Disabling averaging for field." << endl;
faItems_[fieldI].mean() = false; faItems_[fieldi].mean() = false;
} }
else else
{ {
@ -77,22 +77,22 @@ void Foam::functionObjects::fieldAverage::addMeanFieldType(const label fieldI)
template<class Type> template<class Type>
void Foam::functionObjects::fieldAverage::addMeanField(const label fieldI) void Foam::functionObjects::fieldAverage::addMeanField(const label fieldi)
{ {
if (faItems_[fieldI].mean()) if (faItems_[fieldi].mean())
{ {
typedef GeometricField<Type, fvPatchField, volMesh> volFieldType; typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
typedef GeometricField<Type, fvsPatchField, surfaceMesh> surfFieldType; typedef GeometricField<Type, fvsPatchField, surfaceMesh> surfFieldType;
const word& fieldName = faItems_[fieldI].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
if (obr_.foundObject<volFieldType>(fieldName)) if (obr_.foundObject<volFieldType>(fieldName))
{ {
addMeanFieldType<volFieldType>(fieldI); addMeanFieldType<volFieldType>(fieldi);
} }
else if (obr_.foundObject<surfFieldType>(fieldName)) else if (obr_.foundObject<surfFieldType>(fieldName))
{ {
addMeanFieldType<surfFieldType>(fieldI); addMeanFieldType<surfFieldType>(fieldi);
} }
} }
} }
@ -101,12 +101,12 @@ void Foam::functionObjects::fieldAverage::addMeanField(const label fieldI)
template<class Type1, class Type2> template<class Type1, class Type2>
void Foam::functionObjects::fieldAverage::addPrime2MeanFieldType void Foam::functionObjects::fieldAverage::addPrime2MeanFieldType
( (
const label fieldI const label fieldi
) )
{ {
const word& fieldName = faItems_[fieldI].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
const word& meanFieldName = faItems_[fieldI].meanFieldName(); const word& meanFieldName = faItems_[fieldi].meanFieldName();
const word& prime2MeanFieldName = faItems_[fieldI].prime2MeanFieldName(); const word& prime2MeanFieldName = faItems_[fieldi].prime2MeanFieldName();
Info<< " Reading/initialising field " << prime2MeanFieldName << nl; Info<< " Reading/initialising field " << prime2MeanFieldName << nl;
@ -120,7 +120,7 @@ void Foam::functionObjects::fieldAverage::addPrime2MeanFieldType
<< " since an object with that name already exists." << " since an object with that name already exists."
<< " Disabling averaging for field." << nl; << " Disabling averaging for field." << nl;
faItems_[fieldI].prime2Mean() = false; faItems_[fieldi].prime2Mean() = false;
} }
else else
{ {
@ -150,7 +150,7 @@ void Foam::functionObjects::fieldAverage::addPrime2MeanFieldType
template<class Type1, class Type2> template<class Type1, class Type2>
void Foam::functionObjects::fieldAverage::addPrime2MeanField(const label fieldI) void Foam::functionObjects::fieldAverage::addPrime2MeanField(const label fieldi)
{ {
typedef GeometricField<Type1, fvPatchField, volMesh> volFieldType1; typedef GeometricField<Type1, fvPatchField, volMesh> volFieldType1;
typedef GeometricField<Type1, fvsPatchField, surfaceMesh> surfFieldType1; typedef GeometricField<Type1, fvsPatchField, surfaceMesh> surfFieldType1;
@ -158,11 +158,11 @@ void Foam::functionObjects::fieldAverage::addPrime2MeanField(const label fieldI)
typedef GeometricField<Type2, fvPatchField, volMesh> volFieldType2; typedef GeometricField<Type2, fvPatchField, volMesh> volFieldType2;
typedef GeometricField<Type2, fvsPatchField, surfaceMesh> surfFieldType2; typedef GeometricField<Type2, fvsPatchField, surfaceMesh> surfFieldType2;
if (faItems_[fieldI].prime2Mean()) if (faItems_[fieldi].prime2Mean())
{ {
const word& fieldName = faItems_[fieldI].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
if (!faItems_[fieldI].mean()) if (!faItems_[fieldi].mean())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "To calculate the prime-squared average, the " << "To calculate the prime-squared average, the "
@ -172,11 +172,11 @@ void Foam::functionObjects::fieldAverage::addPrime2MeanField(const label fieldI)
if (obr_.foundObject<volFieldType1>(fieldName)) if (obr_.foundObject<volFieldType1>(fieldName))
{ {
addPrime2MeanFieldType<volFieldType1, volFieldType2>(fieldI); addPrime2MeanFieldType<volFieldType1, volFieldType2>(fieldi);
} }
else if (obr_.foundObject<surfFieldType1>(fieldName)) else if (obr_.foundObject<surfFieldType1>(fieldName))
{ {
addPrime2MeanFieldType<surfFieldType1, surfFieldType2>(fieldI); addPrime2MeanFieldType<surfFieldType1, surfFieldType2>(fieldi);
} }
} }
} }
@ -185,10 +185,10 @@ void Foam::functionObjects::fieldAverage::addPrime2MeanField(const label fieldI)
template<class Type> template<class Type>
void Foam::functionObjects::fieldAverage::calculateMeanFieldType void Foam::functionObjects::fieldAverage::calculateMeanFieldType
( (
const label fieldI const label fieldi
) const ) const
{ {
const word& fieldName = faItems_[fieldI].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
if (obr_.foundObject<Type>(fieldName)) if (obr_.foundObject<Type>(fieldName))
{ {
@ -196,24 +196,24 @@ void Foam::functionObjects::fieldAverage::calculateMeanFieldType
Type& meanField = const_cast<Type&> Type& meanField = const_cast<Type&>
( (
obr_.lookupObject<Type>(faItems_[fieldI].meanFieldName()) obr_.lookupObject<Type>(faItems_[fieldi].meanFieldName())
); );
scalar dt = obr_.time().deltaTValue(); scalar dt = obr_.time().deltaTValue();
scalar Dt = totalTime_[fieldI]; scalar Dt = totalTime_[fieldi];
if (faItems_[fieldI].iterBase()) if (faItems_[fieldi].iterBase())
{ {
dt = 1.0; dt = 1.0;
Dt = scalar(totalIter_[fieldI]); Dt = scalar(totalIter_[fieldi]);
} }
scalar alpha = (Dt - dt)/Dt; scalar alpha = (Dt - dt)/Dt;
scalar beta = dt/Dt; scalar beta = dt/Dt;
if (faItems_[fieldI].window() > 0) if (faItems_[fieldi].window() > 0)
{ {
const scalar w = faItems_[fieldI].window(); const scalar w = faItems_[fieldi].window();
if (Dt - dt >= w) if (Dt - dt >= w)
{ {
@ -247,37 +247,37 @@ void Foam::functionObjects::fieldAverage::calculateMeanFields() const
template<class Type1, class Type2> template<class Type1, class Type2>
void Foam::functionObjects::fieldAverage::calculatePrime2MeanFieldType void Foam::functionObjects::fieldAverage::calculatePrime2MeanFieldType
( (
const label fieldI const label fieldi
) const ) const
{ {
const word& fieldName = faItems_[fieldI].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
if (obr_.foundObject<Type1>(fieldName)) if (obr_.foundObject<Type1>(fieldName))
{ {
const Type1& baseField = obr_.lookupObject<Type1>(fieldName); const Type1& baseField = obr_.lookupObject<Type1>(fieldName);
const Type1& meanField = const Type1& meanField =
obr_.lookupObject<Type1>(faItems_[fieldI].meanFieldName()); obr_.lookupObject<Type1>(faItems_[fieldi].meanFieldName());
Type2& prime2MeanField = const_cast<Type2&> Type2& prime2MeanField = const_cast<Type2&>
( (
obr_.lookupObject<Type2>(faItems_[fieldI].prime2MeanFieldName()) obr_.lookupObject<Type2>(faItems_[fieldi].prime2MeanFieldName())
); );
scalar dt = obr_.time().deltaTValue(); scalar dt = obr_.time().deltaTValue();
scalar Dt = totalTime_[fieldI]; scalar Dt = totalTime_[fieldi];
if (faItems_[fieldI].iterBase()) if (faItems_[fieldi].iterBase())
{ {
dt = 1.0; dt = 1.0;
Dt = scalar(totalIter_[fieldI]); Dt = scalar(totalIter_[fieldi]);
} }
scalar alpha = (Dt - dt)/Dt; scalar alpha = (Dt - dt)/Dt;
scalar beta = dt/Dt; scalar beta = dt/Dt;
if (faItems_[fieldI].window() > 0) if (faItems_[fieldi].window() > 0)
{ {
const scalar w = faItems_[fieldI].window(); const scalar w = faItems_[fieldi].window();
if (Dt - dt >= w) if (Dt - dt >= w)
{ {
@ -317,19 +317,19 @@ void Foam::functionObjects::fieldAverage::calculatePrime2MeanFields() const
template<class Type1, class Type2> template<class Type1, class Type2>
void Foam::functionObjects::fieldAverage::addMeanSqrToPrime2MeanType void Foam::functionObjects::fieldAverage::addMeanSqrToPrime2MeanType
( (
const label fieldI const label fieldi
) const ) const
{ {
const word& fieldName = faItems_[fieldI].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
if (obr_.foundObject<Type1>(fieldName)) if (obr_.foundObject<Type1>(fieldName))
{ {
const Type1& meanField = const Type1& meanField =
obr_.lookupObject<Type1>(faItems_[fieldI].meanFieldName()); obr_.lookupObject<Type1>(faItems_[fieldi].meanFieldName());
Type2& prime2MeanField = const_cast<Type2&> Type2& prime2MeanField = const_cast<Type2&>
( (
obr_.lookupObject<Type2>(faItems_[fieldI].prime2MeanFieldName()) obr_.lookupObject<Type2>(faItems_[fieldi].prime2MeanFieldName())
); );
prime2MeanField += sqr(meanField); prime2MeanField += sqr(meanField);

View File

@ -96,14 +96,14 @@ void Foam::functionObjects::fieldCoordinateSystemTransform::execute()
{ {
Info<< type() << " " << name_ << " output:" << nl; Info<< type() << " " << name_ << " output:" << nl;
forAll(fieldSet_, fieldI) forAll(fieldSet_, fieldi)
{ {
// If necessary load field // If necessary load field
transform<scalar>(fieldSet_[fieldI]); transform<scalar>(fieldSet_[fieldi]);
transform<vector>(fieldSet_[fieldI]); transform<vector>(fieldSet_[fieldi]);
transform<sphericalTensor>(fieldSet_[fieldI]); transform<sphericalTensor>(fieldSet_[fieldi]);
transform<symmTensor>(fieldSet_[fieldI]); transform<symmTensor>(fieldSet_[fieldi]);
transform<tensor>(fieldSet_[fieldI]); transform<tensor>(fieldSet_[fieldi]);
} }
} }
@ -122,9 +122,9 @@ void Foam::functionObjects::fieldCoordinateSystemTransform::write()
{ {
Info<< type() << " " << name_ << " output:" << nl; Info<< type() << " " << name_ << " output:" << nl;
forAll(fieldSet_, fieldI) forAll(fieldSet_, fieldi)
{ {
const word fieldName = fieldSet_[fieldI] + ":Transformed"; const word fieldName = fieldSet_[fieldi] + ":Transformed";
const regIOobject& field = const regIOobject& field =
obr_.lookupObject<regIOobject>(fieldName); obr_.lookupObject<regIOobject>(fieldName);

View File

@ -132,10 +132,10 @@ void Foam::functionObjects::fieldMinMax::writeFileHeader(const label i)
} }
else else
{ {
forAll(fieldSet_, fieldI) forAll(fieldSet_, fieldi)
{ {
writeTabbed(file, "min(" + fieldSet_[fieldI] + ')'); writeTabbed(file, "min(" + fieldSet_[fieldi] + ')');
writeTabbed(file, "max(" + fieldSet_[fieldI] + ')'); writeTabbed(file, "max(" + fieldSet_[fieldi] + ')');
} }
} }
@ -162,13 +162,13 @@ void Foam::functionObjects::fieldMinMax::write()
if (!location_) writeTime(file()); if (!location_) writeTime(file());
if (log_) Info<< type() << " " << name_ << " output:" << nl; if (log_) Info<< type() << " " << name_ << " output:" << nl;
forAll(fieldSet_, fieldI) forAll(fieldSet_, fieldi)
{ {
calcMinMaxFields<scalar>(fieldSet_[fieldI], mdCmpt); calcMinMaxFields<scalar>(fieldSet_[fieldi], mdCmpt);
calcMinMaxFields<vector>(fieldSet_[fieldI], mode_); calcMinMaxFields<vector>(fieldSet_[fieldi], mode_);
calcMinMaxFields<sphericalTensor>(fieldSet_[fieldI], mode_); calcMinMaxFields<sphericalTensor>(fieldSet_[fieldi], mode_);
calcMinMaxFields<symmTensor>(fieldSet_[fieldI], mode_); calcMinMaxFields<symmTensor>(fieldSet_[fieldi], mode_);
calcMinMaxFields<tensor>(fieldSet_[fieldI], mode_); calcMinMaxFields<tensor>(fieldSet_[fieldi], mode_);
} }
if (!location_) file()<< endl; if (!location_) file()<< endl;

View File

@ -97,9 +97,9 @@ void Foam::functionObjects::readFields::execute()
sSymmtf_.clear(); sSymmtf_.clear();
stf_.clear(); stf_.clear();
forAll(fieldSet_, fieldI) forAll(fieldSet_, fieldi)
{ {
const word& fieldName = fieldSet_[fieldI]; const word& fieldName = fieldSet_[fieldi];
// If necessary load field // If necessary load field
loadField<scalar>(fieldName, vsf_, ssf_); loadField<scalar>(fieldName, vsf_, ssf_);

View File

@ -92,9 +92,9 @@ void Foam::functionObjects::residuals::writeFileHeader(const label i)
writeHeader(file(), "Residuals"); writeHeader(file(), "Residuals");
writeCommented(file(), "Time"); writeCommented(file(), "Time");
forAll(fieldSet_, fieldI) forAll(fieldSet_, fieldi)
{ {
const word& fieldName = fieldSet_[fieldI]; const word& fieldName = fieldSet_[fieldi];
writeFileHeader<scalar>(fieldName); writeFileHeader<scalar>(fieldName);
writeFileHeader<vector>(fieldName); writeFileHeader<vector>(fieldName);
@ -128,9 +128,9 @@ void Foam::functionObjects::residuals::write()
{ {
writeTime(file()); writeTime(file());
forAll(fieldSet_, fieldI) forAll(fieldSet_, fieldi)
{ {
const word& fieldName = fieldSet_[fieldI]; const word& fieldName = fieldSet_[fieldi];
writeResidual<scalar>(fieldName); writeResidual<scalar>(fieldName);
writeResidual<vector>(fieldName); writeResidual<vector>(fieldName);

View File

@ -88,7 +88,7 @@ void Foam::patchProbes::sampleAndWrite
const fieldGroup<Type>& fields const fieldGroup<Type>& fields
) )
{ {
forAll(fields, fieldI) forAll(fields, fieldi)
{ {
if (loadFromFiles_) if (loadFromFiles_)
{ {
@ -98,7 +98,7 @@ void Foam::patchProbes::sampleAndWrite
( (
IOobject IOobject
( (
fields[fieldI], fields[fieldi],
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -111,7 +111,7 @@ void Foam::patchProbes::sampleAndWrite
} }
else else
{ {
objectRegistry::const_iterator iter = mesh_.find(fields[fieldI]); objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
if if
( (
@ -125,7 +125,7 @@ void Foam::patchProbes::sampleAndWrite
mesh_.lookupObject mesh_.lookupObject
<GeometricField<Type, fvPatchField, volMesh>> <GeometricField<Type, fvPatchField, volMesh>>
( (
fields[fieldI] fields[fieldi]
) )
); );
} }
@ -140,7 +140,7 @@ void Foam::patchProbes::sampleAndWriteSurfaceFields
const fieldGroup<Type>& fields const fieldGroup<Type>& fields
) )
{ {
forAll(fields, fieldI) forAll(fields, fieldi)
{ {
if (loadFromFiles_) if (loadFromFiles_)
{ {
@ -150,7 +150,7 @@ void Foam::patchProbes::sampleAndWriteSurfaceFields
( (
IOobject IOobject
( (
fields[fieldI], fields[fieldi],
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -163,7 +163,7 @@ void Foam::patchProbes::sampleAndWriteSurfaceFields
} }
else else
{ {
objectRegistry::const_iterator iter = mesh_.find(fields[fieldI]); objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
if if
( (
@ -177,7 +177,7 @@ void Foam::patchProbes::sampleAndWriteSurfaceFields
mesh_.lookupObject mesh_.lookupObject
<GeometricField<Type, fvsPatchField, surfaceMesh>> <GeometricField<Type, fvsPatchField, surfaceMesh>>
( (
fields[fieldI] fields[fieldi]
) )
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -121,9 +121,9 @@ Foam::label Foam::probes::classifyFields()
labelList indices = findStrings(fieldSelection_, allFields); labelList indices = findStrings(fieldSelection_, allFields);
forAll(indices, fieldI) forAll(indices, fieldi)
{ {
const word& fieldName = allFields[indices[fieldI]]; const word& fieldName = allFields[indices[fieldi]];
nFields += appendFieldGroup nFields += appendFieldGroup
( (
@ -138,9 +138,9 @@ Foam::label Foam::probes::classifyFields()
wordList allFields = mesh_.sortedNames(); wordList allFields = mesh_.sortedNames();
labelList indices = findStrings(fieldSelection_, allFields); labelList indices = findStrings(fieldSelection_, allFields);
forAll(indices, fieldI) forAll(indices, fieldi)
{ {
const word& fieldName = allFields[indices[fieldI]]; const word& fieldName = allFields[indices[fieldi]];
nFields += appendFieldGroup nFields += appendFieldGroup
( (

View File

@ -114,7 +114,7 @@ void Foam::probes::sampleAndWrite
template<class Type> template<class Type>
void Foam::probes::sampleAndWrite(const fieldGroup<Type>& fields) void Foam::probes::sampleAndWrite(const fieldGroup<Type>& fields)
{ {
forAll(fields, fieldI) forAll(fields, fieldi)
{ {
if (loadFromFiles_) if (loadFromFiles_)
{ {
@ -124,7 +124,7 @@ void Foam::probes::sampleAndWrite(const fieldGroup<Type>& fields)
( (
IOobject IOobject
( (
fields[fieldI], fields[fieldi],
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -137,7 +137,7 @@ void Foam::probes::sampleAndWrite(const fieldGroup<Type>& fields)
} }
else else
{ {
objectRegistry::const_iterator iter = mesh_.find(fields[fieldI]); objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
if if
( (
@ -151,7 +151,7 @@ void Foam::probes::sampleAndWrite(const fieldGroup<Type>& fields)
mesh_.lookupObject mesh_.lookupObject
<GeometricField<Type, fvPatchField, volMesh>> <GeometricField<Type, fvPatchField, volMesh>>
( (
fields[fieldI] fields[fieldi]
) )
); );
} }
@ -163,7 +163,7 @@ void Foam::probes::sampleAndWrite(const fieldGroup<Type>& fields)
template<class Type> template<class Type>
void Foam::probes::sampleAndWriteSurfaceFields(const fieldGroup<Type>& fields) void Foam::probes::sampleAndWriteSurfaceFields(const fieldGroup<Type>& fields)
{ {
forAll(fields, fieldI) forAll(fields, fieldi)
{ {
if (loadFromFiles_) if (loadFromFiles_)
{ {
@ -173,7 +173,7 @@ void Foam::probes::sampleAndWriteSurfaceFields(const fieldGroup<Type>& fields)
( (
IOobject IOobject
( (
fields[fieldI], fields[fieldi],
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -186,7 +186,7 @@ void Foam::probes::sampleAndWriteSurfaceFields(const fieldGroup<Type>& fields)
} }
else else
{ {
objectRegistry::const_iterator iter = mesh_.find(fields[fieldI]); objectRegistry::const_iterator iter = mesh_.find(fields[fieldi]);
if if
( (
@ -200,7 +200,7 @@ void Foam::probes::sampleAndWriteSurfaceFields(const fieldGroup<Type>& fields)
mesh_.lookupObject mesh_.lookupObject
<GeometricField<Type, fvsPatchField, surfaceMesh>> <GeometricField<Type, fvsPatchField, surfaceMesh>>
( (
fields[fieldI] fields[fieldi]
) )
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -93,9 +93,9 @@ Foam::label Foam::sampledSets::classifyFields()
if (indices.size()) if (indices.size())
{ {
forAll(indices, fieldI) forAll(indices, fieldi)
{ {
const word& fieldName = allFields[indices[fieldI]]; const word& fieldName = allFields[indices[fieldi]];
nFields += appendFieldGroup nFields += appendFieldGroup
( (
@ -124,9 +124,9 @@ Foam::label Foam::sampledSets::classifyFields()
if (indices.size()) if (indices.size())
{ {
forAll(indices, fieldI) forAll(indices, fieldi)
{ {
const word& fieldName = allFields[indices[fieldI]]; const word& fieldName = allFields[indices[fieldi]];
nFields += appendFieldGroup nFields += appendFieldGroup
( (

View File

@ -56,16 +56,16 @@ Foam::chemistryModel<CompType, ThermoType>::chemistryModel
RR_(nSpecie_) RR_(nSpecie_)
{ {
// create the fields for the chemistry sources // create the fields for the chemistry sources
forAll(RR_, fieldI) forAll(RR_, fieldi)
{ {
RR_.set RR_.set
( (
fieldI, fieldi,
new DimensionedField<scalar, volMesh> new DimensionedField<scalar, volMesh>
( (
IOobject IOobject
( (
"RR." + Y_[fieldI].name(), "RR." + Y_[fieldi].name(),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,

View File

@ -47,11 +47,11 @@ pyrolysisChemistryModel
cellCounter_(0) cellCounter_(0)
{ {
// create the fields for the chemistry sources // create the fields for the chemistry sources
forAll(this->RRs_, fieldI) forAll(this->RRs_, fieldi)
{ {
IOobject header IOobject header
( (
this->Ys_[fieldI].name() + "0", this->Ys_[fieldi].name() + "0",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ IOobject::NO_READ
@ -62,12 +62,12 @@ pyrolysisChemistryModel
{ {
Ys0_.set Ys0_.set
( (
fieldI, fieldi,
new volScalarField new volScalarField
( (
IOobject IOobject
( (
this->Ys_[fieldI].name() + "0", this->Ys_[fieldi].name() + "0",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -94,12 +94,12 @@ pyrolysisChemistryModel
Ys0_.set Ys0_.set
( (
fieldI, fieldi,
new volScalarField new volScalarField
( (
IOobject IOobject
( (
this->Ys_[fieldI].name() + "0", this->Ys_[fieldi].name() + "0",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -110,22 +110,22 @@ pyrolysisChemistryModel
); );
// Calculate inital values of Ysi0 = rho*delta*Yi // Calculate inital values of Ysi0 = rho*delta*Yi
Ys0_[fieldI].primitiveFieldRef() = Ys0_[fieldi].primitiveFieldRef() =
this->solidThermo().rho() this->solidThermo().rho()
*max(this->Ys_[fieldI], scalar(0.001))*mesh.V(); *max(this->Ys_[fieldi], scalar(0.001))*mesh.V();
} }
} }
forAll(RRg_, fieldI) forAll(RRg_, fieldi)
{ {
RRg_.set RRg_.set
( (
fieldI, fieldi,
new DimensionedField<scalar, volMesh> new DimensionedField<scalar, volMesh>
( (
IOobject IOobject
( (
"RRg." + pyrolisisGases_[fieldI], "RRg." + pyrolisisGases_[fieldi],
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,

View File

@ -59,16 +59,16 @@ solidChemistryModel
reactingCells_(mesh.nCells(), true) reactingCells_(mesh.nCells(), true)
{ {
// create the fields for the chemistry sources // create the fields for the chemistry sources
forAll(RRs_, fieldI) forAll(RRs_, fieldi)
{ {
RRs_.set RRs_.set
( (
fieldI, fieldi,
new DimensionedField<scalar, volMesh> new DimensionedField<scalar, volMesh>
( (
IOobject IOobject
( (
"RRs." + Ys_[fieldI].name(), "RRs." + Ys_[fieldi].name(),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,