diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C index 0338e35154588ce72288dc1b0ba09c61cb356087..635b864c45b09bfdcf9b142ae34b0fa0d94b9e60 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,7 +97,12 @@ Foam::porosityModel::porosityModel name_(name), mesh_(mesh), dict_(dict), - coeffs_(dict.subDict(modelType + "Coeffs")), + coeffs_ + ( + dict.found(modelType + "Coeffs") + ? dict.subDict(modelType + "Coeffs") + : dict + ), active_(true), zoneName_(cellZoneName), cellZoneIDs_(), @@ -105,7 +110,7 @@ Foam::porosityModel::porosityModel { if (zoneName_ == word::null) { - dict.lookup("active") >> active_; + dict.readIfPresent("active", active_); dict_.lookup("cellZone") >> zoneName_; } @@ -227,8 +232,17 @@ bool Foam::porosityModel::writeData(Ostream& os) const bool Foam::porosityModel::read(const dictionary& dict) { - active_ = readBool(dict.lookup("active")); - coeffs_ = dict.subDict(type() + "Coeffs"); + dict.readIfPresent("active", active_); + + if (dict.found(type() + "Coeffs")) + { + coeffs_ = dict.subDict(type() + "Coeffs"); + } + else + { + coeffs_ = dict; + } + dict.lookup("cellZone") >> zoneName_; cellZoneIDs_ = mesh_.cellZones().findIndices(zoneName_); diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/porosityProperties b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/porosityProperties index b08090fea79c88f4efb0e0a8a4a418c45ffe30e1..4f99566f9d4507a1e37e7a89a91fc6242aeb707e 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/porosityProperties +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/porosityProperties @@ -18,24 +18,21 @@ FoamFile porosity1 { type DarcyForchheimer; - active yes; + cellZone porosity; - DarcyForchheimerCoeffs - { - d (5e7 -1000 -1000); - f (0 0 0); + d (5e7 -1000 -1000); + f (0 0 0); - coordinateSystem + coordinateSystem + { + type cartesian; + origin (0 0 0); + coordinateRotation { - type cartesian; - origin (0 0 0); - coordinateRotation - { - type axesRotation; - e1 (0.70710678 0.70710678 0); - e2 (0 0 1); - } + type axesRotation; + e1 (0.70710678 0.70710678 0); + e2 (0 0 1); } } } diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/porosityProperties b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/porosityProperties index a96f099ae0862f5c32b24111ef6db8eea6e54dae..ff7263af9a7ec2b4a35c39257ee6992df96a0b69 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/porosityProperties +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/porosityProperties @@ -18,24 +18,21 @@ FoamFile porosity1 { type DarcyForchheimer; - active yes; + cellZone porosity; - DarcyForchheimerCoeffs - { - d (5e7 -1000 -1000); - f (0 0 0); + d (5e7 -1000 -1000); + f (0 0 0); - coordinateSystem + coordinateSystem + { + type cartesian; + origin (0 0 0); + coordinateRotation { - type cartesian; - origin (0 0 0); - coordinateRotation - { - type axesRotation; - e1 (0.70710678 0.70710678 0); - e2 (0 0 1); - } + type axesRotation; + e1 (0.70710678 0.70710678 0); + e2 (0 0 1); } } } diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/constant/porosityProperties b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/constant/porosityProperties index 0e911d237808c86ddbdcf75ba6a9feadc0506d61..039ffe676349e0bb937031687573f712ccb902c2 100644 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/constant/porosityProperties +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/constant/porosityProperties @@ -18,24 +18,21 @@ FoamFile porosity1 { type DarcyForchheimer; - active yes; + cellZone porosity; - DarcyForchheimerCoeffs - { - d (5e7 -1000 -1000); - f (0 0 0); + d (5e7 -1000 -1000); + f (0 0 0); - coordinateSystem + coordinateSystem + { + type cartesian; + origin (0 0 0); + coordinateRotation { - type cartesian; - origin (0 0 0); - coordinateRotation - { - type axesRotation; - e1 (1 0 0); //(0.70710678 0.70710678 0); - e2 (0 0 1); - } + type axesRotation; + e1 (1 0 0); //(0.70710678 0.70710678 0); + e2 (0 0 1); } } }