From c55dceca80b468d8cc0d516f01772243299704d4 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 10 May 2021 13:49:55 +0100 Subject: [PATCH] lagrangian: Changed the field argument for source function SU, Sh and SYi to const for consistency with the rest of OpenFOAM --- .../clouds/Templates/MomentumCloud/MomentumCloud.H | 7 +++++-- .../Templates/MomentumCloud/MomentumCloudI.H | 4 ++-- .../clouds/Templates/ReactingCloud/ReactingCloud.H | 4 ++-- .../Templates/ReactingCloud/ReactingCloudI.H | 4 ++-- .../clouds/Templates/ThermoCloud/ThermoCloud.H | 7 +++++-- .../clouds/Templates/ThermoCloud/ThermoCloudI.H | 4 ++-- .../parcel/parcelCloud/ParcelCloudBase.H | 8 ++++---- .../parcel/parcelCloud/parcelCloudBase.H | 14 ++++++++++---- .../parcel/parcelCloudList/parcelCloudList.C | 8 ++++---- .../parcel/parcelCloudList/parcelCloudList.H | 8 ++++---- 10 files changed, 40 insertions(+), 28 deletions(-) diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H index 24c00fd90b..50e0978e42 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -487,7 +487,10 @@ public: inline volScalarField::Internal& UCoeffRef(); //- Return tmp momentum source term - inline tmp SU(volVectorField& U) const; + inline tmp SU + ( + const volVectorField& U + ) const; // Check diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H index 5636169e07..16e1c5a28d 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -409,7 +409,7 @@ Foam::MomentumCloud::UCoeffRef() template inline Foam::tmp -Foam::MomentumCloud::SU(volVectorField& U) const +Foam::MomentumCloud::SU(const volVectorField& U) const { if (debug) { diff --git a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.H index de3b97a216..d1fdf420a1 100644 --- a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -253,7 +253,7 @@ public: inline tmp SYi ( const label i, - volScalarField& Yi + const volScalarField& Yi ) const; //- Return tmp mass source for field i - fully explicit diff --git a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloudI.H b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloudI.H index 54dce6833e..01bb8e1a52 100644 --- a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloudI.H +++ b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloudI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,7 +104,7 @@ template inline Foam::tmp Foam::ReactingCloud::SYi ( const label i, - volScalarField& Yi + const volScalarField& Yi ) const { if (this->solution().coupled()) diff --git a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.H index 86c4c9f34f..8693c1992f 100644 --- a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -301,7 +301,10 @@ public: inline volScalarField::Internal& hsCoeffRef(); //- Return sensible enthalpy source term [J/kg/m^3/s] - inline tmp Sh(volScalarField& hs) const; + inline tmp Sh + ( + const volScalarField& hs + ) const; // Radiation - overrides thermoCloud virtual abstract members diff --git a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H index e46125d2ec..eafae99de3 100644 --- a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -222,7 +222,7 @@ Foam::ThermoCloud::hsCoeffRef() template inline Foam::tmp -Foam::ThermoCloud::Sh(volScalarField& hs) const +Foam::ThermoCloud::Sh(const volScalarField& hs) const { if (debug) { diff --git a/src/lagrangian/parcel/parcelCloud/ParcelCloudBase.H b/src/lagrangian/parcel/parcelCloud/ParcelCloudBase.H index 14b6b88315..255179b3f4 100644 --- a/src/lagrangian/parcel/parcelCloud/ParcelCloudBase.H +++ b/src/lagrangian/parcel/parcelCloud/ParcelCloudBase.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -135,7 +135,7 @@ public: // Momentum //- Return momentum source term [kg m/s^2] - tmp SU(volVectorField& U) const + tmp SU(const volVectorField& U) const { return tmp ( @@ -169,7 +169,7 @@ public: // Energy //- Return sensible enthalpy source term [J/s] - tmp Sh(volScalarField& hs) const + tmp Sh(const volScalarField& hs) const { return tmp ( @@ -239,7 +239,7 @@ public: tmp SYi ( const label i, - volScalarField& Yi + const volScalarField& Yi ) const { return tmp diff --git a/src/lagrangian/parcel/parcelCloud/parcelCloudBase.H b/src/lagrangian/parcel/parcelCloud/parcelCloudBase.H index edd0e82cc1..3a068b6188 100644 --- a/src/lagrangian/parcel/parcelCloud/parcelCloudBase.H +++ b/src/lagrangian/parcel/parcelCloud/parcelCloudBase.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,7 +104,10 @@ public: // Momentum //- Return momentum source term [kg m/s^2] - virtual tmp SU(volVectorField& U) const = 0; + virtual tmp SU + ( + const volVectorField& U + ) const = 0; //- Momentum transfer [kg m/s] virtual tmp UTrans() const = 0; @@ -116,7 +119,10 @@ public: // Energy //- Return sensible enthalpy source term [J/s] - virtual tmp Sh(volScalarField& hs) const = 0; + virtual tmp Sh + ( + const volScalarField& hs + ) const = 0; //- Sensible enthalpy transfer [J] virtual tmp hsTrans() const = 0; @@ -140,7 +146,7 @@ public: virtual tmp SYi ( const label i, - volScalarField& Yi + const volScalarField& Yi ) const = 0; //- Return mass source for specie [kg/m^3/s] diff --git a/src/lagrangian/parcel/parcelCloudList/parcelCloudList.C b/src/lagrangian/parcel/parcelCloudList/parcelCloudList.C index 4a2e436950..c4f67b03df 100644 --- a/src/lagrangian/parcel/parcelCloudList/parcelCloudList.C +++ b/src/lagrangian/parcel/parcelCloudList/parcelCloudList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -149,7 +149,7 @@ const Foam::tmp Foam::parcelCloudList::theta() const Foam::tmp Foam::parcelCloudList::SU ( - volVectorField& U + const volVectorField& U ) const { tmp tSU(new fvVectorMatrix(U, dimMass*dimAcceleration)); @@ -201,7 +201,7 @@ Foam::tmp Foam::parcelCloudList::UCoeff() const Foam::tmp Foam::parcelCloudList::Sh ( - volScalarField& hs + const volScalarField& hs ) const { tmp tSh(new fvScalarMatrix(hs, dimEnergy/dimTime)); @@ -312,7 +312,7 @@ Foam::tmp Foam::parcelCloudList::sigmap() const Foam::tmp Foam::parcelCloudList::SYi ( const label speciei, - volScalarField& Yi + const volScalarField& Yi ) const { tmp tSYi(new fvScalarMatrix(Yi, dimMass/dimTime)); diff --git a/src/lagrangian/parcel/parcelCloudList/parcelCloudList.H b/src/lagrangian/parcel/parcelCloudList/parcelCloudList.H index 64adf85ba1..5668f0ad37 100644 --- a/src/lagrangian/parcel/parcelCloudList/parcelCloudList.H +++ b/src/lagrangian/parcel/parcelCloudList/parcelCloudList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -114,7 +114,7 @@ public: // Momentum //- Return momentum source term [kg m/s^2] - tmp SU(volVectorField& U) const; + tmp SU(const volVectorField& U) const; //- Momentum transfer [kg m/s] tmp UTrans() const; @@ -126,7 +126,7 @@ public: // Energy //- Return sensible enthalpy source term [J/s] - tmp Sh(volScalarField& hs) const; + tmp Sh(const volScalarField& hs) const; //- Sensible enthalpy transfer [J] tmp hsTrans() const; @@ -150,7 +150,7 @@ public: tmp SYi ( const label speciei, - volScalarField& Yi + const volScalarField& Yi ) const; //- Return mass source for specie [kg/m^3/s]