Commit b9313ef2 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Consistency updates after Foundation merge and code tidying

parent d3157ac9
......@@ -2,9 +2,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
if (pimple.transonic())
{
......@@ -54,6 +52,9 @@ else
fvc::makeRelative(phiHbyA, rho, U);
MRF.makeRelative(phiHbyA);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
......
......@@ -27,7 +27,7 @@
IOobject::MUST_READ
);
if (turbulenceHeader.typeHeaderOk<IOdictionary>(true))
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(true))
{
autoPtr<compressible::turbulenceModel> turbulence
(
......
......@@ -1368,7 +1368,7 @@ int main(int argc, char *argv[])
// Add all information for all the remaining faceZones
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HashTable<Pair<word> > faceZoneToPatches;
HashTable<Pair<word>> faceZoneToPatches;
forAll(mesh.faceZones(), zoneI)
{
const word& fzName = mesh.faceZones()[zoneI].name();
......@@ -1400,7 +1400,7 @@ int main(int argc, char *argv[])
if (faceZoneToPatches.size())
{
autoRefineDriver::addFaceZones
snappyRefineDriver::addFaceZones
(
meshRefiner,
refineParams,
......
......@@ -230,7 +230,7 @@ void subsetDimensionedFields
(
const fvMeshSubset& subsetter,
const wordList& fieldNames,
PtrList<DimensionedField<Type, volMesh> >& subFields
PtrList<DimensionedField<Type, volMesh>>& subFields
)
{
const fvMesh& baseMesh = subsetter.baseMesh();
......
......@@ -33,7 +33,7 @@ void Foam::readFields
(
const typename GeoMesh::Mesh& mesh,
const IOobjectList& objects,
PtrList<GeometricField<Type, PatchField, GeoMesh> >& fields,
PtrList<GeometricField<Type, PatchField, GeoMesh>>& fields,
const bool readOldTime
)
{
......
......@@ -47,7 +47,7 @@ namespace Foam
(
const typename GeoMesh::Mesh& mesh,
const IOobjectList& objects,
PtrList<GeometricField<Type, PatchField, GeoMesh> >& fields,
PtrList<GeometricField<Type, PatchField, GeoMesh>>& fields,
const bool readOldTime
);
......
......@@ -105,7 +105,7 @@ public:
//- Reconstruct volume internal field
template<class Type>
tmp<DimensionedField<Type, volMesh> >
tmp<DimensionedField<Type, volMesh>>
reconstructFvVolumeInternalField
(
const DimensionedField<Type, volMesh>&
......@@ -113,14 +113,14 @@ public:
//- Read and reconstruct volume internal field
template<class Type>
tmp<DimensionedField<Type, volMesh> >
tmp<DimensionedField<Type, volMesh>>
reconstructFvVolumeInternalField(const IOobject& fieldIoObject) const;
//- Reconstruct volume field
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> >
tmp<GeometricField<Type, fvPatchField, volMesh>>
reconstructFvVolumeField
(
const GeometricField<Type, fvPatchField, volMesh>& fld
......@@ -128,14 +128,14 @@ public:
//- Read and reconstruct volume field
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> >
tmp<GeometricField<Type, fvPatchField, volMesh>>
reconstructFvVolumeField(const IOobject& fieldIoObject) const;
//- Reconstruct surface field
template<class Type>
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
reconstructFvSurfaceField
(
const GeometricField<Type, fvsPatchField, surfaceMesh>&
......@@ -143,7 +143,7 @@ public:
//- Read and reconstruct surface field
template<class Type>
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
reconstructFvSurfaceField(const IOobject& fieldIoObject) const;
......
......@@ -41,7 +41,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh> >
Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh>>
Foam::parFvFieldReconstructor::reconstructFvVolumeInternalField
(
const DimensionedField<Type, volMesh>& fld
......@@ -66,7 +66,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeInternalField
IOobject::NO_WRITE
);
return tmp<DimensionedField<Type, volMesh> >
return tmp<DimensionedField<Type, volMesh>>
(
new DimensionedField<Type, volMesh>
(
......@@ -80,7 +80,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeInternalField
template<class Type>
Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh> >
Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh>>
Foam::parFvFieldReconstructor::reconstructFvVolumeInternalField
(
const IOobject& fieldIoObject
......@@ -100,7 +100,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeInternalField
// Reconstruct a field onto the baseMesh
template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
Foam::parFvFieldReconstructor::reconstructFvVolumeField
(
const GeometricField<Type, fvPatchField, volMesh>& fld
......@@ -123,7 +123,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeField
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Note: patchFields still on mesh, not baseMesh
PtrList<fvPatchField<Type> > patchFields(fld.mesh().boundary().size());
PtrList<fvPatchField<Type>> patchFields(fld.mesh().boundary().size());
const typename GeometricField
<
......@@ -151,7 +151,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeField
}
PtrList<fvPatchField<Type> > basePatchFields
PtrList<fvPatchField<Type>> basePatchFields
(
baseMesh_.boundary().size()
);
......@@ -213,7 +213,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeField
IOobject::NO_WRITE
);
return tmp<GeometricField<Type, fvPatchField, volMesh> >
return tmp<GeometricField<Type, fvPatchField, volMesh>>
(
new GeometricField<Type, fvPatchField, volMesh>
(
......@@ -228,7 +228,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeField
template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
Foam::parFvFieldReconstructor::reconstructFvVolumeField
(
const IOobject& fieldIoObject
......@@ -247,7 +247,7 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeField
template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>>
Foam::parFvFieldReconstructor::reconstructFvSurfaceField
(
const GeometricField<Type, fvsPatchField, surfaceMesh>& fld
......@@ -263,16 +263,13 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField
);
// Create flat field of internalField + all patch fields
Field<Type> flatFld(fld.mesh().nFaces(), pTraits<Type>::zero);
SubList<Type>(flatFld, fld.internalField().size()).assign
(
fld.internalField()
);
Field<Type> flatFld(fld.mesh().nFaces(), Type(Zero));
SubList<Type>(flatFld, fld.internalField().size()) = fld.internalField();
forAll(fld.boundaryField(), patchI)
{
const fvsPatchField<Type>& fvp = fld.boundaryField()[patchI];
SubList<Type>(flatFld, fvp.size(), fvp.patch().start()).assign(fvp);
SubList<Type>(flatFld, fvp.size(), fvp.patch().start()) = fvp;
}
// Map all faces
......@@ -293,7 +290,7 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Note: patchFields still on mesh, not baseMesh
PtrList<fvsPatchField<Type> > patchFields(fld.mesh().boundary().size());
PtrList<fvsPatchField<Type>> patchFields(fld.mesh().boundary().size());
const typename GeometricField
<
......@@ -321,7 +318,7 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField
}
PtrList<fvsPatchField<Type> > basePatchFields
PtrList<fvsPatchField<Type>> basePatchFields
(
baseMesh_.boundary().size()
);
......@@ -383,7 +380,7 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField
IOobject::NO_WRITE
);
return tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
(
new GeometricField<Type, fvsPatchField, surfaceMesh>
(
......@@ -398,7 +395,7 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField
template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>>
Foam::parFvFieldReconstructor::reconstructFvSurfaceField
(
const IOobject& fieldIoObject
......@@ -440,7 +437,7 @@ void Foam::parFvFieldReconstructor::reconstructFvVolumeInternalFields
{
Info<< " " << fieldIter()->name() << endl;
tmp<DimensionedField<Type, volMesh> > tfld
tmp<DimensionedField<Type, volMesh>> tfld
(
reconstructFvVolumeInternalField<Type>(*fieldIter())
);
......@@ -484,7 +481,7 @@ void Foam::parFvFieldReconstructor::reconstructFvVolumeFields
{
Info<< " " << name << endl;
tmp<GeometricField<Type, fvPatchField, volMesh> > tfld
tmp<GeometricField<Type, fvPatchField, volMesh>> tfld
(
reconstructFvVolumeField<Type>(*fieldIter())
);
......@@ -525,7 +522,7 @@ void Foam::parFvFieldReconstructor::reconstructFvSurfaceFields
{
Info<< " " << fieldIter()->name() << endl;
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tfld
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> tfld
(
reconstructFvSurfaceField<Type>(*fieldIter())
);
......
......@@ -142,7 +142,7 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
{
// List of lists of particles to be transfered for all of the
// neighbour processors
List<IDLList<passiveParticle> > particleTransferLists
List<IDLList<passiveParticle>> particleTransferLists
(
Pstream::nProcs()
);
......@@ -185,7 +185,7 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
// Start sending. Sets number of bytes transferred
labelListList allNTrans(Pstream::nProcs());
labelList allNTrans(Pstream::nProcs());
pBufs.finishedSends(allNTrans);
......@@ -208,7 +208,7 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
// Retrieve from receive buffers
forAll(allNTrans, procI)
{
label nRec = allNTrans[procI][Pstream::myProcNo()];
label nRec = allNTrans[procI];
//Pout<< "From processor " << procI << " receiving bytes " << nRec
// << endl;
......
......@@ -74,7 +74,7 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFields
{
const wordList objectNames
(
filterObjects<IOField<Type> >
filterObjects<IOField<Type>>
(
objects,
selectedFields
......@@ -125,7 +125,7 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFields
IOobject::NO_WRITE,
false
),
xferMove<Field<Type> >(field)
xferMove<Field<Type>>(field)
).write();
}
}
......@@ -146,7 +146,7 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFieldFields
{
wordList objectNames
(
filterObjects<CompactIOField<Field<Type>, Type> >
filterObjects<CompactIOField<Field<Type>, Type>>
(
objects,
selectedFields
......@@ -157,7 +157,7 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFieldFields
{
const wordList ioFieldNames
(
filterObjects<IOField<Field<Type> > >
filterObjects<IOField<Field<Type>>>
(
objects,
selectedFields
......@@ -212,7 +212,7 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFieldFields
IOobject::NO_WRITE,
false
),
xferMove<Field<Field<Type> > >(field)
xferMove<Field<Field<Type>>>(field)
).write();
}
}
......@@ -309,7 +309,7 @@ void Foam::parLagrangianRedistributor::redistributeStoredLagrangianFields
IOobject::NO_WRITE,
false
),
xferMove<Field<typename Container::value_type> >(field)
xferMove<Field<typename Container::value_type>>(field)
).write();
}
}
......
......@@ -577,7 +577,7 @@ void readField
const IOobject& io,
const fvMesh& mesh,
const label i,
PtrList<GeometricField<Type, PatchField, GeoMesh> >& fields
PtrList<GeometricField<Type, PatchField, GeoMesh>>& fields
)
{
fields.set
......@@ -829,11 +829,11 @@ autoPtr<mapDistributePolyMesh> redistributeAndWrite
PtrList<surfaceSymmTensorField> surfSymmTensorFields;
PtrList<surfaceTensorField> surfTensorFields;
PtrList<DimensionedField<scalar, volMesh> > dimScalarFields;
PtrList<DimensionedField<vector, volMesh> > dimVectorFields;
PtrList<DimensionedField<sphericalTensor, volMesh> > dimSphereTensorFields;
PtrList<DimensionedField<symmTensor, volMesh> > dimSymmTensorFields;
PtrList<DimensionedField<tensor, volMesh> > dimTensorFields;
PtrList<DimensionedField<scalar, volMesh>> dimScalarFields;
PtrList<DimensionedField<vector, volMesh>> dimVectorFields;
PtrList<DimensionedField<sphericalTensor, volMesh>> dimSphereTensorFields;
PtrList<DimensionedField<symmTensor, volMesh>> dimSymmTensorFields;
PtrList<DimensionedField<tensor, volMesh>> dimTensorFields;
if (doReadFields)
......@@ -1815,21 +1815,21 @@ void readLagrangian
//Pout<< "Found clould objects:" << sprayObjs.names() << endl;
parLagrangianRedistributor::readLagrangianFields
<IOField<label> >
<IOField<label>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<IOField<Field<label> > >
<IOField<Field<label>>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<CompactIOField<Field<label>, label> >
<CompactIOField<Field<label>, label>>
(
clouds[i],
sprayObjs,
......@@ -1838,21 +1838,21 @@ void readLagrangian
parLagrangianRedistributor::readLagrangianFields
<IOField<scalar> >
<IOField<scalar>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<IOField<Field<scalar> > >
<IOField<Field<scalar>>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<CompactIOField<Field<scalar>, scalar> >
<CompactIOField<Field<scalar>, scalar>>
(
clouds[i],
sprayObjs,
......@@ -1861,21 +1861,21 @@ void readLagrangian
parLagrangianRedistributor::readLagrangianFields
<IOField<vector> >
<IOField<vector>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<IOField<Field<vector> > >
<IOField<Field<vector>>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<CompactIOField<Field<vector>, vector> >
<CompactIOField<Field<vector>, vector>>
(
clouds[i],
sprayObjs,
......@@ -1884,21 +1884,21 @@ void readLagrangian
parLagrangianRedistributor::readLagrangianFields
<IOField<sphericalTensor> >
<IOField<sphericalTensor>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<IOField<Field<sphericalTensor> > >
<IOField<Field<sphericalTensor>>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<CompactIOField<Field<sphericalTensor>, sphericalTensor> >
<CompactIOField<Field<sphericalTensor>, sphericalTensor>>
(
clouds[i],
sprayObjs,
......@@ -1907,21 +1907,21 @@ void readLagrangian
parLagrangianRedistributor::readLagrangianFields
<IOField<symmTensor> >
<IOField<symmTensor>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<IOField<Field<symmTensor> > >
<IOField<Field<symmTensor>>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<CompactIOField<Field<symmTensor>, symmTensor> >
<CompactIOField<Field<symmTensor>, symmTensor>>
(
clouds[i],
sprayObjs,
......@@ -1930,21 +1930,21 @@ void readLagrangian
parLagrangianRedistributor::readLagrangianFields
<IOField<tensor> >
<IOField<tensor>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<IOField<Field<tensor> > >
<IOField<Field<tensor>>>
(
clouds[i],
sprayObjs,
selectedLagrangianFields
);
parLagrangianRedistributor::readLagrangianFields
<CompactIOField<Field<tensor>, tensor> >
<CompactIOField<Field<tensor>, tensor>>
(
clouds[i],
sprayObjs,
......@@ -1987,19 +1987,19 @@ void redistributeLagrangian
distributor.redistributeLagrangianPositions(clouds[i]);
distributor.redistributeStoredLagrangianFields
<IOField<label> >
<IOField<label>>
(
lagrangianMap,
clouds[i]
);
distributor.redistributeStoredLagrangianFields
<IOField<Field<label> > >
<IOField<Field<label>>>
(
lagrangianMap,
clouds[i]
);
distributor.redistributeStoredLagrangianFields
<CompactIOField<Field<label>, label> >
<CompactIOField<Field<label>, label>>
(
lagrangianMap,
clouds[i]
......@@ -2007,19 +2007,19 @@ void redistributeLagrangian
distributor.redistributeStoredLagrangianFields
<IOField<scalar> >
<IOField<scalar>>
(
lagrangianMap,
clouds[i]
);