From 93ed93377008e67d15d7f88e67f3a859a54f64e2 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 5 Aug 2020 11:10:10 +0200 Subject: [PATCH] STYLE: use unitConversion degToRad() from instead of separate value --- .../multiphaseMixtureThermo.C | 4 +--- .../multiphaseMixtureThermo.H | 4 ---- .../multiphaseSystem/multiphaseSystem.C | 13 +++++-------- .../multiphaseSystem/multiphaseSystem.H | 3 --- .../multiphaseSystem/multiphaseSystem.C | 11 +++++------ .../multiphaseSystem/multiphaseSystem.H | 3 --- 6 files changed, 11 insertions(+), 27 deletions(-) diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C index 2161aa75a3..eb41aa2bbf 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,9 +46,6 @@ namespace Foam defineTypeNameAndDebug(multiphaseMixtureThermo, 0); } -const Foam::scalar Foam::multiphaseMixtureThermo::convertToRad = - Foam::constant::mathematical::pi/180.0; - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H index 18ddba8962..368df01043 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H @@ -139,10 +139,6 @@ private: //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - - // Private member functions diff --git a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C index dce78c2b96..4af3fb9467 100644 --- a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C +++ b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,11 +39,7 @@ License #include "fvcFlux.H" #include "fvcAverage.H" -// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // - -const Foam::scalar Foam::multiphaseSystem::convertToRad = - Foam::constant::mathematical::pi/180.0; - +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -281,7 +278,7 @@ void Foam::multiphaseSystem::correctContactAngle bool matched = (tp.key().first() == phase1.name()); - scalar theta0 = convertToRad*tp().theta0(matched); + const scalar theta0 = degToRad(tp().theta0(matched)); scalarField theta(boundary[patchi].size(), theta0); scalar uTheta = tp().uTheta(); @@ -289,8 +286,8 @@ void Foam::multiphaseSystem::correctContactAngle // Calculate the dynamic contact angle if required if (uTheta > SMALL) { - scalar thetaA = convertToRad*tp().thetaA(matched); - scalar thetaR = convertToRad*tp().thetaR(matched); + const scalar thetaA = degToRad(tp().thetaA(matched)); + const scalar thetaR = degToRad(tp().thetaR(matched)); // Calculated the component of the velocity parallel to the wall vectorField Uwall diff --git a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.H b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.H index 039e85a964..18c1cfc628 100644 --- a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.H +++ b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.H @@ -190,9 +190,6 @@ private: //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - // Private member functions diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C index d66041e205..2d67872d91 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C @@ -44,6 +44,8 @@ License #include "fvmLaplacian.H" #include "fvmSup.H" +#include "unitConversion.H" + // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // namespace Foam @@ -52,9 +54,6 @@ namespace Foam defineRunTimeSelectionTable(multiphaseSystem, dictionary); } -const Foam::scalar Foam::multiphaseSystem::convertToRad = - Foam::constant::mathematical::pi/180.0; - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -425,7 +424,7 @@ void Foam::multiphaseSystem::correctContactAngle bool matched = (tp.key().first() == phase1.name()); - scalar theta0 = convertToRad*tp().theta0(matched); + scalar theta0 = degToRad(tp().theta0(matched)); scalarField theta(boundary[patchi].size(), theta0); scalar uTheta = tp().uTheta(); @@ -433,8 +432,8 @@ void Foam::multiphaseSystem::correctContactAngle // Calculate the dynamic contact angle if required if (uTheta > SMALL) { - scalar thetaA = convertToRad*tp().thetaA(matched); - scalar thetaR = convertToRad*tp().thetaR(matched); + const scalar thetaA = degToRad(tp().thetaA(matched)); + const scalar thetaR = degToRad(tp().thetaR(matched)); // Calculated the component of the velocity parallel to the wall vectorField Uwall diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.H b/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.H index f76c201172..e2f32da038 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.H +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.H @@ -75,9 +75,6 @@ private: //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - //- Conversion factor for degrees into radians - static const scalar convertToRad; - // Private member functions -- GitLab