diff --git a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C index 36a9ba7ada..4860c4849b 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C @@ -47,10 +47,11 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer const word& name, const word& modelType, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName ) : - porosityModel(name, modelType, mesh, dict), + porosityModel(name, modelType, mesh, dict, cellZoneName), coordSys_(coeffs_, mesh), D_("D", dimless/sqr(dimLength), tensor::zero), F_("F", dimless/dimLength, tensor::zero), diff --git a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H index a85fae7fc6..ab3007d204 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H @@ -136,7 +136,8 @@ public: const word& name, const word& modelType, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName ); //- Destructor diff --git a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C index 55c4202d5a..59cef74368 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C @@ -102,10 +102,11 @@ Foam::porosityModels::fixedCoeff::fixedCoeff const word& name, const word& modelType, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName ) : - porosityModel(name, modelType, mesh, dict), + porosityModel(name, modelType, mesh, dict, cellZoneName), coordSys_(coeffs_, mesh), alpha_("alpha", dimless/dimTime, tensor::zero), beta_("beta", dimless/dimLength, tensor::zero) diff --git a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H index c0e28ac87e..61f4c36224 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H @@ -113,7 +113,8 @@ public: const word& name, const word& modelType, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName ); //- Destructor diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C index f0997c8222..aa4e4ad641 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C @@ -73,17 +73,30 @@ Foam::porosityModel::porosityModel const word& name, const word& modelType, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName ) : name_(name), mesh_(mesh), dict_(dict), coeffs_(dict.subDict(modelType + "Coeffs")), - active_(readBool(dict_.lookup("active"))), - zoneName_(dict_.lookup("cellZone")), - cellZoneIds_(mesh_.cellZones().findIndices(zoneName_)) + active_(true), + zoneName_(), + cellZoneIds_() { + if (cellZoneName == "unknown") + { + dict.lookup("actuve") >> active_; + dict_.lookup("cellZone") >> zoneName_; + } + else + { + zoneName_ = cellZoneName; + } + + cellZoneIds_ = mesh_.cellZones().findIndices(zoneName_); + Info<< " creating porous zone: " << zoneName_ << endl; bool foundZone = !cellZoneIds_.empty(); @@ -99,6 +112,7 @@ Foam::porosityModel::porosityModel "const word&, " "const fvMesh&, " "const dictionary&" + "const word&, " ")" ) << "cannot find porous cellZone " << zoneName_ << exit(FatalError); diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H index 56131ba3dd..01098aff44 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H @@ -127,9 +127,10 @@ public: const word& modelName, const word& name, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName ), - (modelName, name, mesh, dict) + (modelName, name, mesh, dict, cellZoneName) ); //- Constructor @@ -138,7 +139,8 @@ public: const word& name, const word& modelType, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName ); //- Return pointer to new porosityModel object created on the freestore @@ -182,7 +184,8 @@ public: ( const word& name, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName = "unknown" ); //- Destructor diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C index 1da8c91c4d..d0fe203537 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelNew.C @@ -31,7 +31,8 @@ Foam::autoPtr Foam::porosityModel::New ( const word& name, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName ) { const word modelType(dict.lookup("type")); @@ -48,9 +49,10 @@ Foam::autoPtr Foam::porosityModel::New ( "porosityModel::New" "(" - "const word& name," + "const word&, " "const fvMesh&, " - "const dictionary&" + "const dictionary&, " + "const word&" ")" ) << "Unknown " << typeName << " type " << modelType << nl << nl @@ -59,7 +61,17 @@ Foam::autoPtr Foam::porosityModel::New << exit(FatalError); } - return autoPtr(cstrIter()(name, modelType, mesh, dict)); + return autoPtr + ( + cstrIter() + ( + name, + modelType, + mesh, + dict, + cellZoneName + ) + ); } diff --git a/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.C b/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.C index 15fbae39df..2516c8c6b2 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.C @@ -47,10 +47,11 @@ Foam::porosityModels::powerLaw::powerLaw const word& name, const word& modelType, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName ) : - porosityModel(name, modelType, mesh, dict), + porosityModel(name, modelType, mesh, dict, cellZoneName), C0_(readScalar(coeffs_.lookup("C0"))), C1_(readScalar(coeffs_.lookup("C1"))), rhoName_(coeffs_.lookupOrDefault("rho", "rho")) diff --git a/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.H b/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.H index 2c26946265..fb0797aaa7 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.H @@ -117,7 +117,8 @@ public: const word& name, const word& modelType, const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& cellZoneName ); //- Destructor