From 8de1edd7719e5ad5eced8b308cb904c9ace6fbf4 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Fri, 3 Jun 2011 01:44:56 +0100
Subject: [PATCH] COMP: single precision fixes

---
 .../pyrolysisModels/reactingOneDim/reactingOneDim.C           | 2 +-
 .../kinematic/force/contactAngleForce/contactAngleForce.C     | 2 +-
 .../infinitelyFastChemistry/infinitelyFastChemistry.C         | 2 +-
 .../singleStepReactingMixture/singleStepReactingMixture.C     | 4 ++--
 .../ODESolidChemistryModel/ODESolidChemistryModel.C           | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C
index 90e28643dba..606957c4593 100644
--- a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C
+++ b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C
@@ -85,7 +85,7 @@ void reactingOneDim::updateQr()
 
         // Qr is negative going out the solid
         // If the surface is emitting the radiative flux is set to zero
-        Qrp = max(Qrp, 0.0);
+        Qrp = max(Qrp, scalar(0.0));
     }
 
     // Propagate Qr through 1-D regions
diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForce/contactAngleForce.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForce/contactAngleForce.C
index 21d2e63d28b..0fc76cb5a86 100644
--- a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForce/contactAngleForce.C
+++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForce/contactAngleForce.C
@@ -162,7 +162,7 @@ tmp<fvVectorMatrix> contactAngleForce::correct(volVectorField& U)
         }
     }
 
-    force /= (max(nHits, 1.0)*magSf);
+    force /= (max(nHits, scalar(1.0))*magSf);
     tForce().correctBoundaryConditions();
 
     if (owner_.regionMesh().time().outputTime())
diff --git a/src/thermophysicalModels/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/src/thermophysicalModels/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C
index c66099a88c9..fb0dbe79b40 100644
--- a/src/thermophysicalModels/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C
+++ b/src/thermophysicalModels/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C
@@ -113,7 +113,7 @@ Foam::combustionModels::infinitelyFastChemistry::R(volScalarField& Y) const
 
     const volScalarField wSpecie =
         wFuelNorm_*singleMixture_.specieStoichCoeffs()[specieI]
-      / max(fNorm*(Y - fres), 0.001);
+      / max(fNorm*(Y - fres), scalar(0.001));
 
     return -fNorm*wSpecie*fres + fNorm*fvm::Sp(wSpecie, Y);
 }
diff --git a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C
index 57471ce57ba..65749dca897 100644
--- a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C
+++ b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C
@@ -137,11 +137,11 @@ void Foam::singleStepReactingMixture<ThermoType>::fresCorrect()
         const label specieI = reaction.lhs()[i].index;
         if (specieI == fuelIndex_)
         {
-            fres_[specieI] =  max(YFuel - YO2/s_, 0.0);
+            fres_[specieI] =  max(YFuel - YO2/s_, scalar(0.0));
         }
         else if (specieI == O2Index)
         {
-            fres_[specieI] =  max(YO2 - YFuel*s_, 0.0);
+            fres_[specieI] =  max(YO2 - YFuel*s_, scalar(0.0));
         }
     }
 
diff --git a/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.C b/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.C
index f06c2ef0015..7d716a8a884 100644
--- a/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.C
+++ b/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.C
@@ -140,7 +140,7 @@ ODESolidChemistryModel
         // Calculate inital values of Ysi0 = rho*delta*Yi
         Ys0_[fieldI].internalField() =
             //this->solidThermo().rho()*Ys_[fieldI]*mesh.V();
-            this->solidThermo().rho()*max(Ys_[fieldI],0.001)*mesh.V();
+            this->solidThermo().rho()*max(Ys_[fieldI],scalar(0.001))*mesh.V();
    }
 
     forAll(RRg_, fieldI)
-- 
GitLab