Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry Weller
2021-10-27 16:04:11 +01:00
9 changed files with 52 additions and 21 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -272,6 +272,12 @@ Foam::dimensionSet Foam::cmptDivide
} }
Foam::dimensionSet Foam::cmptMag(const dimensionSet& ds)
{
return ds;
}
Foam::dimensionSet Foam::pow(const dimensionSet& ds, const scalar p) Foam::dimensionSet Foam::pow(const dimensionSet& ds, const scalar p)
{ {
dimensionSet dimPow dimensionSet dimPow

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -63,6 +63,7 @@ dimensionSet max(const dimensionSet&, const dimensionSet&);
dimensionSet min(const dimensionSet&, const dimensionSet&); dimensionSet min(const dimensionSet&, const dimensionSet&);
dimensionSet cmptMultiply(const dimensionSet&, const dimensionSet&); dimensionSet cmptMultiply(const dimensionSet&, const dimensionSet&);
dimensionSet cmptDivide(const dimensionSet&, const dimensionSet&); dimensionSet cmptDivide(const dimensionSet&, const dimensionSet&);
dimensionSet cmptMag(const dimensionSet&);
dimensionSet pow(const dimensionSet&, const scalar); dimensionSet pow(const dimensionSet&, const scalar);
dimensionSet pow(const dimensionSet&, const dimensionedScalar&); dimensionSet pow(const dimensionSet&, const dimensionedScalar&);
@ -346,6 +347,7 @@ public:
const dimensionSet&, const dimensionSet&,
const dimensionSet& const dimensionSet&
); );
friend dimensionSet cmptMag(const dimensionSet&);
friend dimensionSet pow(const dimensionSet&, const scalar); friend dimensionSet pow(const dimensionSet&, const scalar);
friend dimensionSet pow(const dimensionSet&, const dimensionedScalar&); friend dimensionSet pow(const dimensionSet&, const dimensionedScalar&);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -276,6 +276,9 @@ cmptAv(const tmp<DimensionedField<Type, GeoMesh>>& tdf)
return CmptAv; return CmptAv;
} }
UNARY_FUNCTION(Type, Type, cmptMag, cmptMag);
#define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \ #define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \
\ \
template<class Type, class GeoMesh> \ template<class Type, class GeoMesh> \

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -99,6 +99,8 @@ tmp
> >
cmptAv(const tmp<DimensionedField<Type, GeoMesh>>& tdf); cmptAv(const tmp<DimensionedField<Type, GeoMesh>>& tdf);
UNARY_FUNCTION(Type, Type, cmptMag, cmptMag);
#define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \ #define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \
\ \

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -422,6 +422,8 @@ cmptAv(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf)
return CmptAv; return CmptAv;
} }
UNARY_FUNCTION(Type, Type, cmptMag, cmptMag);
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \ #define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \
\ \

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -211,6 +211,8 @@ tmp
> >
cmptAv(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf); cmptAv(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf);
UNARY_FUNCTION(Type, Type, cmptMag, cmptMag);
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \ #define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \
\ \

View File

@ -1691,8 +1691,8 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
domainMesh.addFvPatches(patches, false); domainMesh.addFvPatches(patches, false);
//*** Set the old-time volumes if present //*** Set the old-time volumes if present
// domainMesh.setV0().field() = V0; // domainMesh.V0Ref().field() = V0;
// domainMesh.setV00().field() = V00; // domainMesh.V00Ref().field() = V00;
// Construct zones // Construct zones
List<pointZone*> pZonePtrs(pointZoneNames.size()); List<pointZone*> pZonePtrs(pointZoneNames.size());

View File

@ -308,13 +308,19 @@ public:
//- Return old-time cell volumes //- Return old-time cell volumes
const DimensionedField<scalar, volMesh>& V0() const; const DimensionedField<scalar, volMesh>& V0() const;
//- Access old-time cell volumes
DimensionedField<scalar, volMesh>& V0Ref();
//- Return old-old-time cell volumes //- Return old-old-time cell volumes
const DimensionedField<scalar, volMesh>& V00() const; const DimensionedField<scalar, volMesh>& V00() const;
//- Access old-old-time cell volumes
DimensionedField<scalar, volMesh>& V00Ref();
//- Return sub-cycle cell volumes //- Return sub-cycle cell volumes
tmp<DimensionedField<scalar, volMesh>> Vsc() const; tmp<DimensionedField<scalar, volMesh>> Vsc() const;
//- Return sub-cycl old-time cell volumes //- Return sub-cycle old-time cell volumes
tmp<DimensionedField<scalar, volMesh>> Vsc0() const; tmp<DimensionedField<scalar, volMesh>> Vsc0() const;
//- Return cell face area vectors //- Return cell face area vectors
@ -323,9 +329,6 @@ public:
//- Return cell face area magnitudes //- Return cell face area magnitudes
const surfaceScalarField& magSf() const; const surfaceScalarField& magSf() const;
//- Return cell face motion fluxes
const surfaceScalarField& phi() const;
//- Return cell centres as volVectorField //- Return cell centres as volVectorField
const volVectorField& C() const; const volVectorField& C() const;
@ -335,6 +338,12 @@ public:
//- Return face deltas as surfaceVectorField //- Return face deltas as surfaceVectorField
tmp<surfaceVectorField> delta() const; tmp<surfaceVectorField> delta() const;
//- Return cell face motion fluxes
const surfaceScalarField& phi() const;
//- Access cell face motion fluxes
surfaceScalarField& phiRef();
//- Return a labelType of valid component indicators //- Return a labelType of valid component indicators
// 1 : valid (solved) // 1 : valid (solved)
// -1 : invalid (not solved) // -1 : invalid (not solved)
@ -390,12 +399,6 @@ public:
// these fvPatches. // these fvPatches.
void removeFvBoundary(); void removeFvBoundary();
//- Return cell face motion fluxes
surfaceScalarField& setPhi();
//- Return old-time cell volumes
DimensionedField<scalar, volMesh>& setV0();
// Write // 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 | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -226,7 +226,7 @@ const Foam::volScalarField::Internal& Foam::fvMesh::V0() const
} }
Foam::volScalarField::Internal& Foam::fvMesh::setV0() Foam::volScalarField::Internal& Foam::fvMesh::V0Ref()
{ {
if (!V0Ptr_) if (!V0Ptr_)
{ {
@ -267,6 +267,17 @@ const Foam::volScalarField::Internal& Foam::fvMesh::V00() const
} }
Foam::volScalarField::Internal& Foam::fvMesh::V00Ref()
{
if (!V00Ptr_)
{
V00();
}
return *V00Ptr_;
}
Foam::tmp<Foam::volScalarField::Internal> Foam::tmp<Foam::volScalarField::Internal>
Foam::fvMesh::Vsc() const Foam::fvMesh::Vsc() const
{ {
@ -429,7 +440,7 @@ const Foam::surfaceScalarField& Foam::fvMesh::phi() const
} }
Foam::surfaceScalarField& Foam::fvMesh::setPhi() Foam::surfaceScalarField& Foam::fvMesh::phiRef()
{ {
if (!phiPtr_) if (!phiPtr_)
{ {