diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C index b05277dbb1..b71bb4f8d1 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -127,10 +127,12 @@ bool Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::read() { coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); - Fr_.readIfPresent(coeffDict_); - eta_.readIfPresent(coeffDict_); - p_.readIfPresent(coeffDict_); - phi_.readIfPresent(coeffDict_); + Fr_.read(coeffDict_); + eta_.read(coeffDict_); + p_.read(coeffDict_); + + phi_.read(coeffDict_); + phi_ *= constant::mathematical::pi/180.0; return true; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index 537a76fecd..705b66d6bf 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,9 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::Schaeffer frictionalStressModel(dict), coeffDict_(dict.subDict(typeName + "Coeffs")), phi_("phi", dimless, coeffDict_.lookup("phi")) -{} +{ + phi_ *= constant::mathematical::pi/180.0; +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -158,7 +160,8 @@ bool Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::read() { coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); - phi_.readIfPresent(coeffDict_); + phi_.read(coeffDict_); + phi_ *= constant::mathematical::pi/180.0; return true; } diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C index d062c8ec3a..82f28aef31 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C +++ b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -245,6 +245,13 @@ void Foam::dimensioned::replace } +template +void Foam::dimensioned::read(const dictionary& dict) +{ + dict.lookup(name_) >> value_; +} + + template bool Foam::dimensioned::readIfPresent(const dictionary& dict) { diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H index 1c4a5c0d3c..47800b1960 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H +++ b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -159,21 +159,25 @@ public: //- Return transpose. dimensioned T() const; + //- Update the value of dimensioned + void read(const dictionary&); + //- Update the value of dimensioned if found in the dictionary. bool readIfPresent(const dictionary&); // I/O - //- Read using provided units. Only used during startup. + //- Read value from stream and units from dictionary Istream& read(Istream& is, const dictionary&); - //- Read using provided units + //- Read value from stream and units from table Istream& read(Istream& is, const HashTable&); - //- Read using system units + //- Read value from stream and units from system table Istream& read(Istream& is); + // Member operators //- Return a component as a dimensioned