diff --git a/applications/legacy/combustion/PDRFoam/derivedFvPatchFields/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C b/applications/legacy/combustion/PDRFoam/derivedFvPatchFields/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C index da3e823c13..f41d3c6ebb 100644 --- a/applications/legacy/combustion/PDRFoam/derivedFvPatchFields/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C +++ b/applications/legacy/combustion/PDRFoam/derivedFvPatchFields/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,9 +53,12 @@ activeBaffleVelocityFvPatchVectorField p.boundaryMesh()[cyclicPatchLabel_] ).neighbFvPatch().Sf() ), - openFraction_(dict.lookup("openFraction")), - openingTime_(dict.lookup("openingTime")), - maxOpenFractionDelta_(dict.lookup("maxOpenFractionDelta")), + openFraction_(dict.lookup("openFraction", unitFraction)), + openingTime_(dict.lookup("openingTime", dimTime)), + maxOpenFractionDelta_ + ( + dict.lookup("maxOpenFractionDelta", unitFraction) + ), curTimeIndex_(-1) { fvPatchVectorField::operator=(Zero); diff --git a/applications/legacy/combustion/PDRFoam/derivedFvPatchFields/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C b/applications/legacy/combustion/PDRFoam/derivedFvPatchFields/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C index db2d1af3b0..605886b01b 100644 --- a/applications/legacy/combustion/PDRFoam/derivedFvPatchFields/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C +++ b/applications/legacy/combustion/PDRFoam/derivedFvPatchFields/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,12 +47,15 @@ activePressureForceBaffleVelocityFvPatchVectorField initWallSf_(0), initCyclicSf_(0), nbrCyclicSf_(0), - openFraction_(dict.lookup("openFraction")), - openingTime_(dict.lookup("openingTime")), - maxOpenFractionDelta_(dict.lookup("maxOpenFractionDelta")), + openFraction_(dict.lookup("openFraction", unitFraction)), + openingTime_(dict.lookup("openingTime", dimTime)), + maxOpenFractionDelta_ + ( + dict.lookup("maxOpenFractionDelta", unitFraction) + ), curTimeIndex_(-1), - minThresholdValue_(dict.lookup("minThresholdValue")), - fBased_(readBool(dict.lookup("forceBased"))), + minThresholdValue_(dict.lookup("minThresholdValue", dimPressure)), + fBased_(dict.lookup("forceBased")), baffleActivated_(0) { fvPatchVectorField::operator=(Zero); diff --git a/applications/legacy/electromagnetics/mhdFoam/createFields.H b/applications/legacy/electromagnetics/mhdFoam/createFields.H index 98cf31431f..bfff09cbda 100644 --- a/applications/legacy/electromagnetics/mhdFoam/createFields.H +++ b/applications/legacy/electromagnetics/mhdFoam/createFields.H @@ -22,7 +22,7 @@ dimensionedScalar rho dimensionedScalar nu ( "nu", - dimViscosity, + dimKinematicViscosity, physicalProperties ); diff --git a/applications/legacy/incompressible/icoFoam/createFields.H b/applications/legacy/incompressible/icoFoam/createFields.H index 9fd7a2983c..cd14e51bc9 100644 --- a/applications/legacy/incompressible/icoFoam/createFields.H +++ b/applications/legacy/incompressible/icoFoam/createFields.H @@ -15,7 +15,7 @@ IOdictionary physicalProperties dimensionedScalar nu ( "nu", - dimViscosity, + dimKinematicViscosity, physicalProperties.lookup("nu") ); diff --git a/applications/legacy/incompressible/shallowWaterFoam/readGravitationalAcceleration.H b/applications/legacy/incompressible/shallowWaterFoam/readGravitationalAcceleration.H index d8a8bf8d06..7e6638b58f 100644 --- a/applications/legacy/incompressible/shallowWaterFoam/readGravitationalAcceleration.H +++ b/applications/legacy/incompressible/shallowWaterFoam/readGravitationalAcceleration.H @@ -15,7 +15,8 @@ IOdictionary gravitationalProperties const dimensionedVector g(gravitationalProperties.lookup("g")); const Switch rotating(gravitationalProperties.lookup("rotating")); const dimensionedVector Omega = - rotating ? gravitationalProperties.lookup("Omega") - : dimensionedVector("Omega", -dimTime, vector(0,0,0)); + rotating + ? gravitationalProperties.lookup("Omega") + : dimensionedVector("Omega", dimless/dimTime, vector::zero); const dimensionedScalar magg = mag(g); const dimensionedVector gHat = g/magg; diff --git a/applications/modules/compressibleVoF/fvModels/VoFSolidificationMelting/VoFSolidificationMelting.C b/applications/modules/compressibleVoF/fvModels/VoFSolidificationMelting/VoFSolidificationMelting.C index c6c6fa8e18..559c1b8d24 100644 --- a/applications/modules/compressibleVoF/fvModels/VoFSolidificationMelting/VoFSolidificationMelting.C +++ b/applications/modules/compressibleVoF/fvModels/VoFSolidificationMelting/VoFSolidificationMelting.C @@ -59,11 +59,20 @@ namespace Foam void Foam::fv::VoFSolidificationMelting::readCoeffs() { - alphaSolidT_.reset(Function1::New("alphaSolidT", coeffs()).ptr()); + alphaSolidT_.reset + ( + Function1::New + ( + "alphaSolidT", + dimTemperature, + unitFraction, + coeffs() + ).ptr() + ); L_ = dimensionedScalar("L", dimEnergy/dimMass, coeffs()); - relax_ = coeffs().lookupOrDefault("relax", 0.9); - Cu_ = coeffs().lookupOrDefault("Cu", 100000); - q_ = coeffs().lookupOrDefault("q", 0.001); + relax_ = coeffs().lookupOrDefault("relax", dimless, 0.9); + Cu_ = coeffs().lookupOrDefault("Cu", dimless/dimTime, 100000); + q_ = coeffs().lookupOrDefault("q", dimless, 0.001); } diff --git a/applications/modules/fluidSolver/fluidSolver.C b/applications/modules/fluidSolver/fluidSolver.C index 5696574bb3..b68704433b 100644 --- a/applications/modules/fluidSolver/fluidSolver.C +++ b/applications/modules/fluidSolver/fluidSolver.C @@ -57,10 +57,7 @@ bool Foam::solvers::fluidSolver::read() maxDeltaT_ = runTime.controlDict().found("maxDeltaT") - ? runTime.userTimeToTime - ( - runTime.controlDict().lookup("maxDeltaT") - ) + ? runTime.controlDict().lookup("maxDeltaT", runTime.userUnits()) : vGreat; correctPhi = pimple.dict().lookupOrDefault diff --git a/applications/modules/fluidSolver/functionObjects/fluidMaxDeltaT/fluidMaxDeltaT.C b/applications/modules/fluidSolver/functionObjects/fluidMaxDeltaT/fluidMaxDeltaT.C index 4cdd923a55..ac1cc24eeb 100644 --- a/applications/modules/fluidSolver/functionObjects/fluidMaxDeltaT/fluidMaxDeltaT.C +++ b/applications/modules/fluidSolver/functionObjects/fluidMaxDeltaT/fluidMaxDeltaT.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,8 +72,22 @@ bool Foam::functionObjects::fluidMaxDeltaT::read(const dictionary& dict) { fvMeshFunctionObject::read(dict); - maxCoPtr_ = Function1::New("maxCo", dict); - maxDeltaTPtr_ = Function1::New("maxDeltaT", dict); + maxCoPtr_ = + Function1::New + ( + "maxCo", + time_.userUnits(), + dimless, + dict + ); + maxDeltaTPtr_ = + Function1::New + ( + "maxDeltaT", + time_.userUnits(), + time_.userUnits(), + dict + ); return true; } @@ -93,15 +107,14 @@ bool Foam::functionObjects::fluidMaxDeltaT::write() Foam::scalar Foam::functionObjects::fluidMaxDeltaT::maxDeltaT() const { - scalar deltaT = - time_.userTimeToTime(maxDeltaTPtr_().value(time_.userTimeValue())); + scalar deltaT = maxDeltaTPtr_().value(time_.value()); const scalar CoNum = mesh_.lookupObject(solver::typeName).CoNum; if (CoNum > small) { - const scalar maxCo = maxCoPtr_().value(time_.userTimeValue()); + const scalar maxCo = maxCoPtr_().value(time_.value()); deltaT = min(deltaT, maxCo/CoNum*time_.deltaTValue()); } diff --git a/applications/modules/incompressibleDriftFlux/incompressibleDriftFluxMixture/incompressibleDriftFluxMixture.C b/applications/modules/incompressibleDriftFlux/incompressibleDriftFluxMixture/incompressibleDriftFluxMixture.C index 5347d910e3..4c511b9929 100644 --- a/applications/modules/incompressibleDriftFlux/incompressibleDriftFluxMixture/incompressibleDriftFluxMixture.C +++ b/applications/modules/incompressibleDriftFlux/incompressibleDriftFluxMixture/incompressibleDriftFluxMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,7 +74,7 @@ Foam::incompressibleDriftFluxMixture::incompressibleDriftFluxMixture mesh ), mesh, - dimensionedScalar(dimViscosity, 0), + dimensionedScalar(dimKinematicViscosity, 0), calculatedFvPatchScalarField::typeName ), diff --git a/applications/modules/incompressibleMultiphaseVoF/incompressibleMultiphaseVoFMixture/incompressibleMultiphaseVoFMixture.C b/applications/modules/incompressibleMultiphaseVoF/incompressibleMultiphaseVoFMixture/incompressibleMultiphaseVoFMixture.C index 58b8e7a717..d3c7c0d3b3 100644 --- a/applications/modules/incompressibleMultiphaseVoF/incompressibleMultiphaseVoFMixture/incompressibleMultiphaseVoFMixture.C +++ b/applications/modules/incompressibleMultiphaseVoF/incompressibleMultiphaseVoFMixture/incompressibleMultiphaseVoFMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -88,7 +88,7 @@ Foam::incompressibleMultiphaseVoFMixture::incompressibleMultiphaseVoFMixture mesh ), mesh, - dimensionedScalar(dimViscosity, 0), + dimensionedScalar(dimKinematicViscosity, 0), calculatedFvPatchScalarField::typeName ) { diff --git a/applications/modules/incompressibleVoF/incompressibleTwoPhaseVoFMixture/incompressibleTwoPhaseVoFMixture.C b/applications/modules/incompressibleVoF/incompressibleTwoPhaseVoFMixture/incompressibleTwoPhaseVoFMixture.C index d1877812c6..4dd47ddbaa 100644 --- a/applications/modules/incompressibleVoF/incompressibleTwoPhaseVoFMixture/incompressibleTwoPhaseVoFMixture.C +++ b/applications/modules/incompressibleVoF/incompressibleTwoPhaseVoFMixture/incompressibleTwoPhaseVoFMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,7 +73,7 @@ Foam::incompressibleTwoPhaseVoFMixture::incompressibleTwoPhaseVoFMixture mesh ), mesh, - dimensionedScalar(dimViscosity, 0), + dimensionedScalar(dimKinematicViscosity, 0), calculatedFvPatchScalarField::typeName ) { diff --git a/applications/modules/isothermalFilm/derivedFvPatchFields/filmSurfaceVelocity/filmSurfaceVelocityFvPatchVectorField.C b/applications/modules/isothermalFilm/derivedFvPatchFields/filmSurfaceVelocity/filmSurfaceVelocityFvPatchVectorField.C index bf1ff5b823..b8b47ad4ce 100644 --- a/applications/modules/isothermalFilm/derivedFvPatchFields/filmSurfaceVelocity/filmSurfaceVelocityFvPatchVectorField.C +++ b/applications/modules/isothermalFilm/derivedFvPatchFields/filmSurfaceVelocity/filmSurfaceVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,7 @@ filmSurfaceVelocityFvPatchVectorField ) : mixedFvPatchField(p, iF, dict, false), - Cs_(dict.lookupOrDefault("Cs", 0)) + Cs_(dict.lookupOrDefault("Cs", dimless, 0)) { refValue() = Zero; refGrad() = Zero; @@ -49,7 +49,7 @@ filmSurfaceVelocityFvPatchVectorField { fvPatchVectorField::operator= ( - vectorField("value", dict, p.size()) + vectorField("value", iF.dimensions(), dict, p.size()) ); } else diff --git a/applications/modules/isothermalFilm/isothermalFilm.C b/applications/modules/isothermalFilm/isothermalFilm.C index fb65659957..44f97f84ae 100644 --- a/applications/modules/isothermalFilm/isothermalFilm.C +++ b/applications/modules/isothermalFilm/isothermalFilm.C @@ -235,10 +235,7 @@ bool Foam::solvers::isothermalFilm::read() maxDeltaT_ = runTime.controlDict().found("maxDeltaT") - ? runTime.userTimeToTime - ( - runTime.controlDict().lookup("maxDeltaT") - ) + ? runTime.controlDict().lookup("maxDeltaT", runTime.userUnits()) : vGreat; return true; diff --git a/applications/modules/movingMesh/movingMesh.C b/applications/modules/movingMesh/movingMesh.C index 90eab62302..fb0e976b9f 100644 --- a/applications/modules/movingMesh/movingMesh.C +++ b/applications/modules/movingMesh/movingMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,10 +46,7 @@ Foam::solvers::movingMesh::movingMesh(fvMesh& mesh) maxDeltaT_ ( runTime.controlDict().found("maxDeltaT") - ? runTime.userTimeToTime - ( - runTime.controlDict().lookup("maxDeltaT") - ) + ? runTime.controlDict().lookup("maxDeltaT", runTime.userUnits()) : vGreat ) {} diff --git a/applications/modules/multiphaseEuler/cellPressureCorrector.C b/applications/modules/multiphaseEuler/cellPressureCorrector.C index 09dda630b0..a36c75ab6c 100644 --- a/applications/modules/multiphaseEuler/cellPressureCorrector.C +++ b/applications/modules/multiphaseEuler/cellPressureCorrector.C @@ -284,7 +284,7 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector() mesh ), mesh, - dimensionedScalar(dimFlux, 0) + dimensionedScalar(dimVolumetricFlux, 0) ); forAll(movingPhases, movingPhasei) diff --git a/applications/modules/multiphaseEuler/facePressureCorrector.C b/applications/modules/multiphaseEuler/facePressureCorrector.C index 5290ab0e7a..b1427609bf 100644 --- a/applications/modules/multiphaseEuler/facePressureCorrector.C +++ b/applications/modules/multiphaseEuler/facePressureCorrector.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -226,7 +226,7 @@ void Foam::solvers::multiphaseEuler::facePressureCorrector() IOobject::AUTO_WRITE ), mesh, - dimensionedScalar(dimFlux, 0) + dimensionedScalar(dimVolumetricFlux, 0) ); forAll(movingPhases, movingPhasei) diff --git a/applications/modules/multiphaseEuler/fvModels/nucleation/homogeneousLiquidPhaseSeparation/homogeneousLiquidPhaseSeparation.C b/applications/modules/multiphaseEuler/fvModels/nucleation/homogeneousLiquidPhaseSeparation/homogeneousLiquidPhaseSeparation.C index d979256675..0c9621f819 100644 --- a/applications/modules/multiphaseEuler/fvModels/nucleation/homogeneousLiquidPhaseSeparation/homogeneousLiquidPhaseSeparation.C +++ b/applications/modules/multiphaseEuler/fvModels/nucleation/homogeneousLiquidPhaseSeparation/homogeneousLiquidPhaseSeparation.C @@ -52,7 +52,13 @@ void Foam::fv::homogeneousLiquidPhaseSeparation::readCoeffs() { solubilityCurve_.reset ( - Function1::New("solubility", coeffs()).ptr() + Function1::New + ( + "solubility", + dimTemperature, + unitFraction, + coeffs() + ).ptr() ); } diff --git a/applications/modules/multiphaseEuler/interfacialModels/liftModels/SaffmanMei/SaffmanMei.C b/applications/modules/multiphaseEuler/interfacialModels/liftModels/SaffmanMei/SaffmanMei.C index a18c4fefdd..8fad43c56f 100644 --- a/applications/modules/multiphaseEuler/interfacialModels/liftModels/SaffmanMei/SaffmanMei.C +++ b/applications/modules/multiphaseEuler/interfacialModels/liftModels/SaffmanMei/SaffmanMei.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,7 @@ Foam::tmp Foam::liftModels::SaffmanMei::Cl() const *sqr(interface_.dispersed().d()) /( interface_.continuous().fluidThermo().nu() - + dimensionedScalar(dimViscosity, small) + + dimensionedScalar(dimKinematicViscosity, small) ) ); diff --git a/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index 0d59cd97ea..49d71b0662 100644 --- a/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,16 +52,10 @@ JohnsonJacksonParticleSlipFvPatchVectorField partialSlipFvPatchVectorField(p, iF), specularityCoefficient_ ( - "specularityCoefficient", - dimless, - dict.lookup("specularityCoefficient") + dict.lookup("specularityCoefficient", unitFraction) ) { - if - ( - (specularityCoefficient_.value() < 0) - || (specularityCoefficient_.value() > 1) - ) + if (specularityCoefficient_ < 0 || specularityCoefficient_ > 1) { FatalErrorInFunction << "The specularity coefficient has to be between 0 and 1" @@ -70,7 +64,7 @@ JohnsonJacksonParticleSlipFvPatchVectorField fvPatchVectorField::operator= ( - vectorField("value", dict, p.size()) + vectorField("value", iF.dimensions(), dict, p.size()) ); } @@ -163,7 +157,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() constant::mathematical::pi *alpha *gs0 - *specularityCoefficient_.value() + *specularityCoefficient_ *sqrt(3*Theta) /max(6*nu*phase.alphaMax(), small) ); diff --git a/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H b/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H index 635a094f16..2d75281f0f 100644 --- a/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H +++ b/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,7 +69,7 @@ class JohnsonJacksonParticleSlipFvPatchVectorField // Private Data //- Specularity coefficient - dimensionedScalar specularityCoefficient_; + const scalar specularityCoefficient_; public: diff --git a/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index a11dae3123..90c1936546 100644 --- a/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,33 +51,21 @@ JohnsonJacksonParticleThetaFvPatchScalarField mixedFvPatchScalarField(p, iF, dict, false), restitutionCoefficient_ ( - "restitutionCoefficient", - dimless, - dict.lookup("restitutionCoefficient") + dict.lookup("restitutionCoefficient", unitFraction) ), specularityCoefficient_ ( - "specularityCoefficient", - dimless, - dict.lookup("specularityCoefficient") + dict.lookup("specularityCoefficient", unitFraction) ) { - if - ( - (restitutionCoefficient_.value() < 0) - || (restitutionCoefficient_.value() > 1) - ) + if (restitutionCoefficient_ < 0 || restitutionCoefficient_ > 1) { FatalErrorInFunction << "The restitution coefficient has to be between 0 and 1" << abort(FatalError); } - if - ( - (specularityCoefficient_.value() < 0) - || (specularityCoefficient_.value() > 1) - ) + if (specularityCoefficient_ < 0 || specularityCoefficient_ > 1) { FatalErrorInFunction << "The specularity coefficient has to be between 0 and 1" @@ -86,7 +74,7 @@ JohnsonJacksonParticleThetaFvPatchScalarField fvPatchScalarField::operator= ( - scalarField("value", dict, p.size()) + scalarField("value", iF.dimensions(), dict, p.size()) ); } @@ -182,13 +170,13 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() const scalarField Theta(patchInternalField()); // calculate the reference value and the value fraction - if (restitutionCoefficient_.value() != 1.0) + if (restitutionCoefficient_ != 1.0) { this->refValue() = (2.0/3.0) - *specularityCoefficient_.value() + *specularityCoefficient_ *magSqr(U) - /(scalar(1) - sqr(restitutionCoefficient_.value())); + /(scalar(1) - sqr(restitutionCoefficient_)); this->refGrad() = 0.0; @@ -197,7 +185,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() constant::mathematical::pi *alpha *gs0 - *(scalar(1) - sqr(restitutionCoefficient_.value())) + *(scalar(1) - sqr(restitutionCoefficient_)) *sqrt(3*Theta) /max(4*kappa*phase.alphaMax(), small) ); @@ -214,7 +202,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() this->refGrad() = pos0(alpha - small) *constant::mathematical::pi - *specularityCoefficient_.value() + *specularityCoefficient_ *alpha *gs0 *sqrt(3*Theta) diff --git a/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H b/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H index 2b45fc3912..38e795f300 100644 --- a/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H +++ b/applications/modules/multiphaseEuler/momentumTransportModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,10 +69,10 @@ class JohnsonJacksonParticleThetaFvPatchScalarField // Private Data //- Particle-wall restitution coefficient - dimensionedScalar restitutionCoefficient_; + const scalar restitutionCoefficient_; //- Specularity coefficient - dimensionedScalar specularityCoefficient_; + const scalar specularityCoefficient_; public: diff --git a/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C b/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C index 5392b99680..cc7f478857 100644 --- a/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C +++ b/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C @@ -222,7 +222,7 @@ Foam::phaseSystem::phaseSystem mesh ), mesh, - dimensionedScalar(dimFlux, 0) + dimensionedScalar(dimVolumetricFlux, 0) ), dpdt_ diff --git a/applications/modules/multiphaseEuler/populationBalance/binaryBreakupModels/Liao/LiaoBase.C b/applications/modules/multiphaseEuler/populationBalance/binaryBreakupModels/Liao/LiaoBase.C index c4e83ee33a..9ced92341f 100644 --- a/applications/modules/multiphaseEuler/populationBalance/binaryBreakupModels/Liao/LiaoBase.C +++ b/applications/modules/multiphaseEuler/populationBalance/binaryBreakupModels/Liao/LiaoBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -119,7 +119,7 @@ void Foam::diameterModels::LiaoBase::precompute() const dimensionedScalar nuc ( "nuc", - dimViscosity, + dimKinematicViscosity, gAverage(populationBalance_.continuousPhase().fluidThermo().nu()()) ); diff --git a/applications/modules/multiphaseEuler/reactions/phaseSurfaceArrheniusReactionRate/phaseSurfaceArrheniusReactionRate.H b/applications/modules/multiphaseEuler/reactions/phaseSurfaceArrheniusReactionRate/phaseSurfaceArrheniusReactionRate.H index b3f4b4c95d..e9e74592b6 100644 --- a/applications/modules/multiphaseEuler/reactions/phaseSurfaceArrheniusReactionRate/phaseSurfaceArrheniusReactionRate.H +++ b/applications/modules/multiphaseEuler/reactions/phaseSurfaceArrheniusReactionRate/phaseSurfaceArrheniusReactionRate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,6 +84,7 @@ public: ( const speciesTable& species, const objectRegistry& ob, + const dimensionSet& dims, const dictionary& dict ); diff --git a/applications/modules/multiphaseEuler/reactions/phaseSurfaceArrheniusReactionRate/phaseSurfaceArrheniusReactionRateI.H b/applications/modules/multiphaseEuler/reactions/phaseSurfaceArrheniusReactionRate/phaseSurfaceArrheniusReactionRateI.H index 73d44fa1e9..ceabe8a7f6 100644 --- a/applications/modules/multiphaseEuler/reactions/phaseSurfaceArrheniusReactionRate/phaseSurfaceArrheniusReactionRateI.H +++ b/applications/modules/multiphaseEuler/reactions/phaseSurfaceArrheniusReactionRate/phaseSurfaceArrheniusReactionRateI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,10 +34,11 @@ phaseSurfaceArrheniusReactionRate ( const speciesTable& species, const objectRegistry& ob, + const dimensionSet& dims, const dictionary& dict ) : - ArrheniusReactionRate(species, dict), + ArrheniusReactionRate(species, dims, dict), phaseName_(dict.lookup("phase")), ob_(ob), tAv_(nullptr) diff --git a/applications/modules/multiphaseEuler/thermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/modules/multiphaseEuler/thermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index c318a9eab2..1be7ae91de 100644 --- a/applications/modules/multiphaseEuler/thermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/modules/multiphaseEuler/thermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -576,8 +576,8 @@ alphatWallBoilingWallFunctionFvPatchScalarField ), tolerance_(dict.lookupOrDefault("tolerance", rootSmall)), - Prt_(dict.lookupOrDefault("Prt", 0.85)), - tau_(dict.lookupOrDefault("bubbleWaitingTimeRatio", 0.8)), + Prt_(dict.lookupOrDefault("Prt", dimless, 0.85)), + tau_(dict.lookupOrDefault("bubbleWaitingTimeRatio", dimless, 0.8)), partitioningModel_(nullptr), nucleationSiteModel_(nullptr), @@ -628,6 +628,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField auto readFieldBackwardsCompatible = [&p] ( const dictionary& dict, + const unitConversion& units, const wordList& keywords, scalarField& field ) @@ -636,7 +637,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField { if (dict.found(keywords[i])) { - field = scalarField(keywords[i], dict, p.size()); + field = scalarField(keywords[i], units, dict, p.size()); return; } } @@ -646,17 +647,25 @@ alphatWallBoilingWallFunctionFvPatchScalarField readFieldBackwardsCompatible ( dict, + unitFraction, {"wetFraction", "wallLiquidFraction"}, wetFraction_ ); if (phaseType_ == liquidPhase) { - readFieldBackwardsCompatible(dict, {"dDeparture"}, dDeparture_); + readFieldBackwardsCompatible + ( + dict, + dimLength, + {"dDeparture"}, + dDeparture_ + ); readFieldBackwardsCompatible ( dict, + dimless/dimTime, {"fDeparture", "depFrequency"}, fDeparture_ ); @@ -664,15 +673,34 @@ alphatWallBoilingWallFunctionFvPatchScalarField readFieldBackwardsCompatible ( dict, + dimless/dimArea, {"nucleationSiteDensity", "nucSiteDensity"}, nucleationSiteDensity_ ); - readFieldBackwardsCompatible(dict, {"qQuenching"}, qQuenching_); + readFieldBackwardsCompatible + ( + dict, + dimPower/dimArea, + {"qQuenching"}, + qQuenching_ + ); - readFieldBackwardsCompatible(dict, {"qEvaporative"}, qEvaporative_); + readFieldBackwardsCompatible + ( + dict, + dimPower/dimArea, + {"qEvaporative"}, + qEvaporative_ + ); - readFieldBackwardsCompatible(dict, {"dmdtf"}, dmdtf_); + readFieldBackwardsCompatible + ( + dict, + dimDensity/dimTime, + {"dmdtf"}, + dmdtf_ + ); } } diff --git a/applications/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.C index 7d45641e68..203cf335b3 100644 --- a/applications/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,21 +44,15 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField rhoName_(dict.lookupOrDefault("rho", "rho")), psiName_(dict.lookupOrDefault("psi", "psi")), muName_(dict.lookupOrDefault("mu", "mu")), - accommodationCoeff_(dict.lookup("accommodationCoeff")), - Twall_("Twall", dict, p.size()), - gamma_(dict.lookupOrDefault("gamma", 1.4)) + accommodationCoeff_(dict.lookup("accommodationCoeff", dimless)), + Twall_("Twall", dimTemperature, dict, p.size()), + gamma_(dict.lookupOrDefault("gamma", dimless, 1.4)) { - if - ( - mag(accommodationCoeff_) < small - || mag(accommodationCoeff_) > 2.0 - ) + if (mag(accommodationCoeff_) < small || mag(accommodationCoeff_) > 2.0) { - FatalIOErrorInFunction - ( - dict - ) << "unphysical accommodationCoeff specified" - << "(0 < accommodationCoeff <= 1)" << endl + FatalIOErrorInFunction(dict) + << "unphysical accommodationCoeff specified" + << "(0 < accommodationCoeff <= 2)" << endl << exit(FatalIOError); } @@ -66,7 +60,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField { fvPatchField::operator= ( - scalarField("value", dict, p.size()) + scalarField("value", iF.dimensions(), dict, p.size()) ); } else diff --git a/applications/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.C b/applications/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.C index c335a93b79..eb9cf1d3c4 100644 --- a/applications/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,21 +45,15 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField psiName_(dict.lookupOrDefault("psi", "psi")), muName_(dict.lookupOrDefault("mu", "mu")), accommodationCoeff_(dict.lookup("accommodationCoeff")), - Uwall_("Uwall", dict, p.size()), + Uwall_("Uwall", dimVelocity, dict, p.size()), thermalCreep_(dict.lookupOrDefault("thermalCreep", true)), curvature_(dict.lookupOrDefault("curvature", true)) { - if - ( - mag(accommodationCoeff_) < small - || mag(accommodationCoeff_) > 2.0 - ) + if (mag(accommodationCoeff_) < small || mag(accommodationCoeff_) > 2.0) { - FatalIOErrorInFunction - ( - dict - ) << "unphysical accommodationCoeff_ specified" - << "(0 < accommodationCoeff_ <= 1)" << endl + FatalIOErrorInFunction(dict) + << "unphysical accommodationCoeff_ specified" + << "(0 < accommodationCoeff_ <= 2)" << endl << exit(FatalIOError); } @@ -67,14 +61,15 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField { fvPatchField::operator= ( - vectorField("value", dict, p.size()) + vectorField("value", iF.dimensions(), dict, p.size()) ); if (dict.found("refValue") && dict.found("valueFraction")) { - this->refValue() = vectorField("refValue", dict, p.size()); + this->refValue() = + vectorField("refValue", iF.dimensions(), dict, p.size()); this->valueFraction() = - scalarField("valueFraction", dict, p.size()); + scalarField("valueFraction", unitFraction, dict, p.size()); } else { diff --git a/applications/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C b/applications/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C index d50ff130c1..5a1cc4e6e0 100644 --- a/applications/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C +++ b/applications/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,8 +50,8 @@ Foam::mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField ) : transformFvPatchField(p, iF), - refValue_("refValue", dict, p.size()), - valueFraction_("valueFraction", dict, p.size()) + refValue_("refValue", iF.dimensions(), dict, p.size()), + valueFraction_("valueFraction", unitFraction, dict, p.size()) {} diff --git a/applications/modules/solid/solid.C b/applications/modules/solid/solid.C index c2add7c2d2..056313c5fe 100644 --- a/applications/modules/solid/solid.C +++ b/applications/modules/solid/solid.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,10 +91,7 @@ bool Foam::solvers::solid::read() maxDeltaT_ = runTime.controlDict().found("maxDeltaT") - ? runTime.userTimeToTime - ( - runTime.controlDict().lookup("maxDeltaT") - ) + ? runTime.controlDict().lookup("maxDeltaT", runTime.userUnits()) : vGreat; return true; diff --git a/applications/modules/solidDisplacement/derivedFvPatchFields/hydrostaticDisplacement/hydrostaticDisplacementFvPatchVectorField.C b/applications/modules/solidDisplacement/derivedFvPatchFields/hydrostaticDisplacement/hydrostaticDisplacementFvPatchVectorField.C index 4b3d6e4138..9ae45d2d2c 100644 --- a/applications/modules/solidDisplacement/derivedFvPatchFields/hydrostaticDisplacement/hydrostaticDisplacementFvPatchVectorField.C +++ b/applications/modules/solidDisplacement/derivedFvPatchFields/hydrostaticDisplacement/hydrostaticDisplacementFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,9 +38,12 @@ hydrostaticDisplacementFvPatchVectorField ) : tractionDisplacementFvPatchVectorField(p, iF), - rhoLiquid_(dict.lookup("rhoLiquid")), - liquidSurfacePressure_(dict.lookup("liquidSurfacePressure")), - liquidSurfacePoint_(dict.lookup("liquidSurfacePoint")) + rhoLiquid_(dict.lookup("rhoLiquid", dimDensity)), + liquidSurfacePressure_ + ( + dict.lookup("liquidSurfacePressure", dimPressure) + ), + liquidSurfacePoint_(dict.lookup("liquidSurfacePoint", dimLength)) {} diff --git a/applications/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.C b/applications/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.C index c439bc9cc9..9243b16a12 100644 --- a/applications/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.C +++ b/applications/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,8 +53,17 @@ tractionDisplacementFvPatchVectorField ) : fixedGradientFvPatchVectorField(p, iF), - traction_("traction", dict, p.size()), - pressure_(Function1::New("pressure", dict)) + traction_("traction", dimPressure, dict, p.size()), + pressure_ + ( + Function1::New + ( + "pressure", + db().time().userUnits(), + dimPressure, + dict + ) + ) { fvPatchVectorField::operator=(patchInternalField()); gradient() = Zero; @@ -127,7 +136,7 @@ void Foam::tractionDisplacementFvPatchVectorField::updateCoeffs() return; } - this->updateCoeffs(pressure_->value(this->db().time().userTimeValue())); + this->updateCoeffs(pressure_->value(db().time().value())); } @@ -135,7 +144,7 @@ void Foam::tractionDisplacementFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); writeEntry(os, "traction", traction_); - writeEntry(os, pressure_()); + writeEntry(os, db().time().userUnits(), dimPressure, pressure_()); writeEntry(os, "value", *this); } diff --git a/applications/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.H b/applications/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.H index 324eb5c669..05b89a1dd1 100644 --- a/applications/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.H +++ b/applications/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,8 +55,10 @@ class tractionDisplacementFvPatchVectorField // Private Data vectorField traction_; + autoPtr> pressure_; + protected: //- Update the coefficients associated with the patch field diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index dcb0ade1eb..49991c44ba 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -53,7 +53,6 @@ Description #include "removePoints.H" #include "meshCheck.H" #include "polyTopoChangeMap.H" -#include "unitConversion.H" using namespace Foam; @@ -305,24 +304,25 @@ int main(int argc, char *argv[]) #include "createPolyMesh.H" const word oldInstance = mesh.pointsInstance(); - const scalar featureAngle = args.argRead(1); - const scalar minCos = Foam::cos(degToRad(featureAngle)); + const scalar featureAngle = degToRad(args.argRead(1)); + const scalar minCos = Foam::cos(featureAngle); // Sin of angle between two consecutive edges on a face. // If sin(angle) larger than this the face will be considered concave. - scalar concaveAngle = args.optionLookupOrDefault("concaveAngle", 30.0); - scalar concaveSin = Foam::sin(degToRad(concaveAngle)); + const scalar concaveAngle = + degToRad(args.optionLookupOrDefault("concaveAngle", 30.0)); + const scalar concaveSin = Foam::sin(concaveAngle); const bool overwrite = args.optionFound("overwrite"); const bool meshQuality = args.optionFound("meshQuality"); Info<< "Merging all faces of a cell" << nl << " - which are on the same patch" << nl - << " - which make an angle < " << featureAngle << " degrees" - << nl + << " - which make an angle < " << radToDeg(featureAngle) + << " degrees" << nl << " (cos:" << minCos << ')' << nl << " - even when resulting face becomes concave by more than " - << concaveAngle << " degrees" << nl + << radToDeg(concaveAngle) << " degrees" << nl << " (sin:" << concaveSin << ')' << nl << endl; diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C index 47d9a997eb..1a699f052c 100644 --- a/applications/utilities/mesh/advanced/splitCells/splitCells.C +++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C @@ -50,7 +50,6 @@ Description #include "cellSet.H" #include "cellModeller.H" #include "meshCutter.H" -#include "unitConversion.H" #include "geomCellLooper.H" #include "plane.H" #include "edgeVertex.H" @@ -548,9 +547,9 @@ int main(int argc, char *argv[]) #include "createPolyMesh.H" const word oldInstance = mesh.pointsInstance(); - const scalar featureAngle = args.argRead(1); - const scalar minCos = Foam::cos(degToRad(featureAngle)); - const scalar minSin = Foam::sin(degToRad(featureAngle)); + const scalar featureAngle = degToRad(args.argRead(1)); + const scalar minCos = Foam::cos(featureAngle); + const scalar minSin = Foam::sin(featureAngle); const bool readSet = args.optionFound("set"); const bool geometry = args.optionFound("geometry"); @@ -559,7 +558,7 @@ int main(int argc, char *argv[]) const scalar edgeTol = args.optionLookupOrDefault("tol", 0.2); Info<< "Trying to split cells with internal angles > feature angle\n" << nl - << "featureAngle : " << featureAngle << nl + << "featureAngle : " << radToDeg(featureAngle) << nl << "edge snapping tol : " << edgeTol << nl; if (readSet) { diff --git a/applications/utilities/mesh/conversion/datToFoam/datToFoam.C b/applications/utilities/mesh/conversion/datToFoam/datToFoam.C index eff8da938f..567cc7b86a 100644 --- a/applications/utilities/mesh/conversion/datToFoam/datToFoam.C +++ b/applications/utilities/mesh/conversion/datToFoam/datToFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,7 +35,6 @@ Description #include "IFstream.H" #include "OFstream.H" #include "pointField.H" -#include "unitConversion.H" using namespace Foam; diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index de1d4af487..a25658f986 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -1429,7 +1429,11 @@ int main(int argc, char *argv[]) // Un-merge any merged cyclics if (args.optionFound("includedAngle")) { - polyMeshUnMergeCyclics(mesh, args.optionRead("includedAngle")); + polyMeshUnMergeCyclics + ( + mesh, + degToRad(args.optionRead("includedAngle")) + ); } else { diff --git a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C index 1e13657cd6..722dd121ae 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C +++ b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C @@ -43,7 +43,6 @@ Description #include "wedgePolyPatch.H" #include "mergedCyclicPolyPatch.H" #include "polyMeshUnMergeCyclics.H" -#include "unitConversion.H" using namespace Foam; diff --git a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C index 46d549c297..c3d0d64410 100644 --- a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C +++ b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,7 +35,6 @@ Description #include "Time.H" #include "repatchMesh.H" #include "repatcher.H" -#include "unitConversion.H" #include "OFstream.H" #include "ListOps.H" @@ -84,12 +83,12 @@ int main(int argc, char *argv[]) << " s\n" << endl << endl; - const scalar featureAngle = args.argRead(1); + const scalar featureAngle = degToRad(args.argRead(1)); const bool overwrite = args.optionFound("overwrite"); - const scalar minCos = Foam::cos(degToRad(featureAngle)); + const scalar minCos = Foam::cos(featureAngle); - Info<< "Feature:" << featureAngle << endl + Info<< "Feature:" << radToDeg(featureAngle) << endl << "minCos :" << minCos << endl << endl; diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C index 9e9f24f5b6..22cc129ed6 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -168,6 +168,7 @@ int main(int argc, char *argv[]) scalar nonOrthThreshold = 70; args.optionReadIfPresent("nonOrthThreshold", nonOrthThreshold); + nonOrthThreshold = degToRad(nonOrthThreshold); scalar skewThreshold = 4; args.optionReadIfPresent("skewThreshold", skewThreshold); diff --git a/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMesh.C b/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMesh.C index 860739d621..05ab3ee31d 100644 --- a/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMesh.C +++ b/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMesh.C @@ -61,7 +61,6 @@ Usage #include "argList.H" #include "Time.H" #include "fvMesh.H" -#include "unitConversion.H" #include "polyTopoChange.H" #include "polyTopoChangeMap.H" #include "PackedBoolList.H" @@ -90,7 +89,7 @@ void simpleMarkFeatures labelList& multiCellFeaturePoints ) { - scalar minCos = Foam::cos(degToRad(featureAngle)); + const scalar minCos = Foam::cos(featureAngle); const polyBoundaryMesh& patches = mesh.boundaryMesh(); @@ -393,10 +392,10 @@ int main(int argc, char *argv[]) } } - const scalar featureAngle = args.argRead(1); - const scalar minCos = Foam::cos(degToRad(featureAngle)); + const scalar featureAngle = degToRad(args.argRead(1)); + const scalar minCos = Foam::cos(featureAngle); - Info<< "Feature:" << featureAngle << endl + Info<< "Feature:" << radToDeg(featureAngle) << endl << "minCos :" << minCos << endl << endl; diff --git a/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C b/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C index 6b7132cd3a..b6b235c612 100644 --- a/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C +++ b/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C @@ -75,7 +75,6 @@ See also #include "pointSet.H" #include "transformField.H" #include "transformGeometricField.H" -#include "unitConversion.H" using namespace Foam; diff --git a/applications/utilities/postProcessing/dataConversion/foamDataToFluent/foamDataToFluent.C b/applications/utilities/postProcessing/dataConversion/foamDataToFluent/foamDataToFluent.C index 55f34fc5c5..695ad9e3ba 100644 --- a/applications/utilities/postProcessing/dataConversion/foamDataToFluent/foamDataToFluent.C +++ b/applications/utilities/postProcessing/dataConversion/foamDataToFluent/foamDataToFluent.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -120,13 +120,10 @@ int main(int argc, char *argv[]) // Read field volScalarField field(*iter(), mesh); - // lookup field from dictionary and convert field - label unitNumber; - if - ( - foamDataToFluentDict.readIfPresent(field.name(), unitNumber) - && unitNumber > 0 - ) + // Lookup field from dictionary and convert field + const label unitNumber = + foamDataToFluentDict.lookupOrDefault