From fd5cbde3a4c086ecd0cf5e6561f1ed31082b9987 Mon Sep 17 00:00:00 2001 From: Sergio Ferraris <sergio@alex.opencfd.co.uk> Date: Thu, 20 Jun 2013 12:36:28 +0100 Subject: [PATCH] BUG: Fixing solidProperties New construtctor when defaultCoeffs is false --- .../solidProperties/solidPropertiesNew.C | 36 +++++-------------- .../constant/thermophysicalProperties | 11 +++++- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C index 52a7c55ddc0..ead56293d76 100644 --- a/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C +++ b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,19 +57,7 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New(Istream& is) } else if (coeffs == "coeffs") { - IstreamConstructorTable::iterator cstrIter = - IstreamConstructorTablePtr_->find(solidType); - - if (cstrIter == IstreamConstructorTablePtr_->end()) - { - FatalErrorIn("solidProperties::New(Istream&)") - << "Unknown solidProperties type " << solidType << nl << nl - << "Valid solidProperties types are :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalError); - } - - return autoPtr<solidProperties>(cstrIter()(is)); + return autoPtr<solidProperties>(new solidProperties(is)); } else { @@ -116,19 +104,13 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New } else { - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(solidType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn("solidProperties::New(const dictionary&)") - << "Unknown solidProperties type " << solidType << nl << nl - << "Valid solidProperties types are :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); - } - - return autoPtr<solidProperties>(cstrIter()(dict)); + return autoPtr<solidProperties> + ( + new solidProperties + ( + dict.subDict(solidType + "Coeffs") + ) + ); } } diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties index 9fc96ae2579..63932b5a8d5 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties @@ -46,7 +46,16 @@ solids { C { - defaultCoeffs yes; + defaultCoeffs no; + // if defaultCoeffs no properties should be : + CCoeffs + { + rho 2010; + Cp 710; + K 0.04; + Hf 0; + emissivity 1.0; + } } ash { -- GitLab