From 240cc6c2444d55c3f3b09b9346db6e3659f1bd52 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Sun, 15 Nov 2015 15:00:58 +0000 Subject: [PATCH] Bugfix: clean-up of total boundary conditions --- .../totalPressureFvPatchScalarField.C | 23 ---------------- .../totalPressureFvPatchScalarField.H | 22 ++++----------- .../totalTemperatureFvPatchScalarField.C | 30 ++++++++++++++++++++ .../totalTemperatureFvPatchScalarField.H | 15 +++++++++- .../isentropicTotalPressureFvPatchScalarField.C | 23 ---------------- .../isentropicTotalPressureFvPatchScalarField.H | 27 +++++++++--------- .../isentropicTotalTemperatureFvPatchScalarField.C | 32 ++++++++++++++++++++++ .../isentropicTotalTemperatureFvPatchScalarField.H | 15 +++++++++- 8 files changed, 110 insertions(+), 77 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C index 9af4d4f1a..c2500cb9c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C @@ -265,29 +265,6 @@ Foam::totalPressureFvPatchScalarField::snGrad() const Foam::tmp -Foam::totalPressureFvPatchScalarField::valueInternalCoeffs -( - const tmp& -) const -{ - return tmp - ( - new scalarField(this->size(), 0.0) - ); -} - - -Foam::tmp -Foam::totalPressureFvPatchScalarField::valueBoundaryCoeffs -( - const tmp& -) const -{ - return *this; -} - - -Foam::tmp Foam::totalPressureFvPatchScalarField::gradientInternalCoeffs() const { return tmp diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H index f7c44429d..bf9401169 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H @@ -25,7 +25,8 @@ Class Foam::totalPressureFvPatchScalarField Description - Foam::totalPressureFvPatchScalarField + Total pressure boundary condition. The snGrad is set to zero to stop + back-diffusion SourceFiles totalPressureFvPatchScalarField.C @@ -207,31 +208,20 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); - //- Return patch-normal gradient + //- Return patch-normal gradient: set to zero virtual tmp snGrad() const; //- Return the matrix diagonal coefficients corresponding to the - // evaluation of the value of this patchField with given weights - virtual tmp valueInternalCoeffs - ( - const tmp& - ) const; - - //- Return the matrix source coefficients corresponding to the - // evaluation of the value of this patchField with given weights - virtual tmp valueBoundaryCoeffs - ( - const tmp& - ) const; - - //- Return the matrix diagonal coefficients corresponding to the // evaluation of the gradient of this patchField + // Removed gradient contribution virtual tmp gradientInternalCoeffs() const; //- Return the matrix source coefficients corresponding to the // evaluation of the gradient of this patchField + // Removed gradient contribution virtual tmp gradientBoundaryCoeffs() const; + //- Write virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C index 40cb0d121..66e51e8a1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C @@ -174,6 +174,36 @@ void Foam::totalTemperatureFvPatchScalarField::updateCoeffs() } +Foam::tmp +Foam::totalTemperatureFvPatchScalarField::snGrad() const +{ + return tmp + ( + new scalarField(this->size(), 0.0) + ); +} + + +Foam::tmp +Foam::totalTemperatureFvPatchScalarField::gradientInternalCoeffs() const +{ + return tmp + ( + new scalarField(this->size(), 0.0) + ); +} + + +Foam::tmp +Foam::totalTemperatureFvPatchScalarField::gradientBoundaryCoeffs() const +{ + return tmp + ( + new scalarField(this->size(), 0.0) + ); +} + + void Foam::totalTemperatureFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H index 90697f26a..609fb707c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H @@ -25,7 +25,8 @@ Class Foam::totalTemperatureFvPatchScalarField Description - Foam::totalTemperatureFvPatchScalarField + Total temperature boundary condition. The snGrad is set to zero to stop + back-diffusion SourceFiles totalTemperatureFvPatchScalarField.C @@ -180,6 +181,18 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); + //- Return patch-normal gradient: set to zero + virtual tmp snGrad() const; + + //- Return the matrix diagonal coefficients corresponding to the + // evaluation of the gradient of this patchField + // Removed gradient contribution + virtual tmp gradientInternalCoeffs() const; + + //- Return the matrix source coefficients corresponding to the + // evaluation of the gradient of this patchField + virtual tmp gradientBoundaryCoeffs() const; + //- Write virtual void write(Ostream&) const; diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalPressure/isentropicTotalPressureFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalPressure/isentropicTotalPressureFvPatchScalarField.C index 4322f50e0..a4732b63c 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalPressure/isentropicTotalPressureFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalPressure/isentropicTotalPressureFvPatchScalarField.C @@ -195,29 +195,6 @@ Foam::isentropicTotalPressureFvPatchScalarField::snGrad() const Foam::tmp -Foam::isentropicTotalPressureFvPatchScalarField::valueInternalCoeffs -( - const tmp& -) const -{ - return tmp - ( - new scalarField(this->size(), 0.0) - ); -} - - -Foam::tmp -Foam::isentropicTotalPressureFvPatchScalarField::valueBoundaryCoeffs -( - const tmp& -) const -{ - return *this; -} - - -Foam::tmp Foam::isentropicTotalPressureFvPatchScalarField::gradientInternalCoeffs() const { return tmp diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalPressure/isentropicTotalPressureFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalPressure/isentropicTotalPressureFvPatchScalarField.H index 342ebba7f..c810f9d05 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalPressure/isentropicTotalPressureFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalPressure/isentropicTotalPressureFvPatchScalarField.H @@ -25,7 +25,8 @@ Class Foam::isentropicTotalPressureFvPatchScalarField Description - Foam::isentropicTotalPressureFvPatchScalarField + Isentropic total pressure boundary condition. The snGrad is set to + zero to stop back-diffusion SourceFiles isentropicTotalPressureFvPatchScalarField.C @@ -147,18 +148,6 @@ public: return UName_; } - //- Return the heat capacity ratio - scalar gamma() const - { - return gamma_; - } - - //- Return reference to the heat capacity ratio to allow adjustment - scalar& gamma() - { - return gamma_; - } - //- Return the total pressure const scalarField& p0() const { @@ -197,6 +186,18 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); + //- Return patch-normal gradient: set to zero + virtual tmp snGrad() const; + + //- Return the matrix diagonal coefficients corresponding to the + // evaluation of the gradient of this patchField + // Removed gradient contribution + virtual tmp gradientInternalCoeffs() const; + + //- Return the matrix source coefficients corresponding to the + // evaluation of the gradient of this patchField + virtual tmp gradientBoundaryCoeffs() const; + //- Write virtual void write(Ostream&) const; diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalTemperature/isentropicTotalTemperatureFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalTemperature/isentropicTotalTemperatureFvPatchScalarField.C index e24456ef9..225e1c50d 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalTemperature/isentropicTotalTemperatureFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalTemperature/isentropicTotalTemperatureFvPatchScalarField.C @@ -174,6 +174,38 @@ void Foam::isentropicTotalTemperatureFvPatchScalarField::updateCoeffs } +Foam::tmp +Foam::isentropicTotalTemperatureFvPatchScalarField::snGrad() const +{ + return tmp + ( + new scalarField(this->size(), 0.0) + ); +} + + +Foam::tmp +Foam::isentropicTotalTemperatureFvPatchScalarField:: +gradientInternalCoeffs() const +{ + return tmp + ( + new scalarField(this->size(), 0.0) + ); +} + + +Foam::tmp +Foam::isentropicTotalTemperatureFvPatchScalarField:: +gradientBoundaryCoeffs() const +{ + return tmp + ( + new scalarField(this->size(), 0.0) + ); +} + + void Foam::isentropicTotalTemperatureFvPatchScalarField::write ( Ostream& os diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalTemperature/isentropicTotalTemperatureFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalTemperature/isentropicTotalTemperatureFvPatchScalarField.H index b9522703a..a9605a216 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalTemperature/isentropicTotalTemperatureFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/isentropicTotalTemperature/isentropicTotalTemperatureFvPatchScalarField.H @@ -25,7 +25,8 @@ Class Foam::isentropicTotalTemperatureFvPatchScalarField Description - Foam::isentropicTotalTemperatureFvPatchScalarField + Isentropic total temperature boundary condition. The snGrad is set to + zero to stop back-diffusion SourceFiles isentropicTotalTemperatureFvPatchScalarField.C @@ -169,6 +170,18 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); + //- Return patch-normal gradient: set to zero + virtual tmp snGrad() const; + + //- Return the matrix diagonal coefficients corresponding to the + // evaluation of the gradient of this patchField + // Removed gradient contribution + virtual tmp gradientInternalCoeffs() const; + + //- Return the matrix source coefficients corresponding to the + // evaluation of the gradient of this patchField + virtual tmp gradientBoundaryCoeffs() const; + //- Write virtual void write(Ostream&) const; -- 2.11.4.GIT