diff --git a/src/fvOptions/fvOptions/fvOption.C b/src/fvOptions/fvOptions/fvOption.C index 067e0403b5df3d492696b8a510a269fab1f9cca0..068a24b356ba86ab939f187a44d878ac054c1d24 100644 --- a/src/fvOptions/fvOptions/fvOption.C +++ b/src/fvOptions/fvOptions/fvOption.C @@ -86,8 +86,8 @@ void Foam::fv::option::setSelection(const dictionary& dict) } case smMapRegion: { - dict_.lookup("secondarySourceName") >> secondarySourceName_; - dict_.lookup("mapRegionName") >> mapRegionName_; + dict_.lookup("nbrModelName") >> nbrModelName_; + dict_.lookup("nbrRegionName") >> nbrRegionName_; master_ = readBool(dict_.lookup("master")); break; } @@ -128,7 +128,7 @@ void Foam::fv::option::setCellSet() label globalCellI = returnReduce(cellI, maxOp<label>()); if (globalCellI < 0) { - WarningIn("option::setCellIds()") + WarningIn("option::setCellSet()") << "Unable to find owner cell for point " << points_[i] << endl; @@ -171,13 +171,13 @@ void Foam::fv::option::setCellSet() if (active_) { Info<< indent << "- selecting inter region mapping" << endl; - const fvMesh& secondaryMesh = - mesh_.time().lookupObject<fvMesh>(mapRegionName_); + const fvMesh& nbrMesh = + mesh_.time().lookupObject<fvMesh>(nbrRegionName_); - boundBox primaryBB(mesh_.points(), false); - boundBox secondaryBB(secondaryMesh.points(), false); + boundBox BB(mesh_.points(), false); + boundBox nbrBB(nbrMesh.points(), false); - if (secondaryBB.overlaps(primaryBB)) + if (nbrBB.overlaps(BB)) { // Dummy patches wordList cuttingPatches; @@ -187,7 +187,7 @@ void Foam::fv::option::setCellSet() ( new meshToMesh ( - secondaryMesh, + nbrMesh, mesh_, patchMap, cuttingPatches @@ -197,10 +197,9 @@ void Foam::fv::option::setCellSet() else { FatalErrorIn("option::setCellSet()") - << "regions dont overlap " - << secondaryMesh.name() - << " in region " << mesh_.name() - << nl + << "regions do not overlap " + << nbrMesh.name() + << " in region " << mesh_.name() << nl << exit(FatalError); } } @@ -215,7 +214,7 @@ void Foam::fv::option::setCellSet() } default: { - FatalErrorIn("option::setCellIds()") + FatalErrorIn("option::setCellSet()") << "Unknown selectionMode " << selectionModeTypeNames_[selectionMode_] << ". Valid selectionMode types are" << selectionModeTypeNames_ @@ -264,8 +263,8 @@ Foam::fv::option::option cellSetName_("none"), V_(0.0), secondaryToPrimaryInterpPtr_(), - secondarySourceName_("none"), - mapRegionName_("none"), + nbrModelName_("none"), + nbrRegionName_("none"), master_(false), fieldNames_(), diff --git a/src/fvOptions/fvOptions/fvOption.H b/src/fvOptions/fvOptions/fvOption.H index b6f2cd968979b0723d08e57da58300628eb49c6d..8e51e4e3ea37d7dcab182eec0700bbf4af3bf973 100644 --- a/src/fvOptions/fvOptions/fvOption.H +++ b/src/fvOptions/fvOptions/fvOption.H @@ -131,14 +131,14 @@ protected: // Data for smMapRegion only - //- Mesh to mesh mapping for map optiom + //- Mesh to mesh mapping for map option autoPtr<meshToMesh> secondaryToPrimaryInterpPtr_; - //- Name of the source in the secondary mesh - word secondarySourceName_; + //- Name of the model in the neighbour mesh + word nbrModelName_; - //- Name of the region to map - word mapRegionName_; + //- Name of the neighbour region to map + word nbrRegionName_; //- Master or slave region bool master_; @@ -288,16 +288,16 @@ public: //- Return const access to the total cell volume inline scalar V() const; - //- Return const access to the secondarySourceName - inline const word secondarySourceName() const; + //- Return const access to the neighbour model name + inline const word& nbrModelName() const; + + //- Return const access to the neighbour region name + inline const word& nbrRegionName() const; //- Return const access to the mapToMap Ptr inline const autoPtr<meshToMesh> secondaryToPrimaryInterpPtr() const; - //- Return const referenc to the mapRegion - inline const word mapRegionName() const; - //- Return const access to the cell set inline const labelList& cells() const; diff --git a/src/fvOptions/fvOptions/fvOptionI.H b/src/fvOptions/fvOptions/fvOptionI.H index 1ec819173da103918f93c61ec2eaca67a015c4e2..8c3bf592331fbdb1429e6695192fb5e766fc56a4 100644 --- a/src/fvOptions/fvOptions/fvOptionI.H +++ b/src/fvOptions/fvOptions/fvOptionI.H @@ -126,22 +126,22 @@ inline Foam::scalar& Foam::fv::option::duration() } -inline const Foam::word Foam::fv::option::secondarySourceName() const +inline const Foam::word& Foam::fv::option::nbrModelName() const { - return secondarySourceName_; + return nbrModelName_; } -inline const Foam::autoPtr<Foam::meshToMesh> -Foam::fv::option::secondaryToPrimaryInterpPtr() const +inline const Foam::word& Foam::fv::option::nbrRegionName() const { - return secondaryToPrimaryInterpPtr_; + return nbrRegionName_; } -inline const Foam::word Foam::fv::option::mapRegionName() const +inline const Foam::autoPtr<Foam::meshToMesh> +Foam::fv::option::secondaryToPrimaryInterpPtr() const { - return mapRegionName_; + return secondaryToPrimaryInterpPtr_; } diff --git a/src/fvOptions/sources/derived/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C b/src/fvOptions/sources/derived/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C index 4db71baeee710cbb2870ab9ea8027389feeb19fd..3a1067bdd74507cff8ae1c3fb0a4fc000fc77b47 100644 --- a/src/fvOptions/sources/derived/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C +++ b/src/fvOptions/sources/derived/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C @@ -45,35 +45,30 @@ namespace fv void Foam::fv::interRegionHeatTransferModel::check() { - const fvMesh& secondaryMesh = - mesh_.time().lookupObject<fvMesh>(mapRegionName_); + const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName_); - const optionList& IObsl = - secondaryMesh.lookupObject<optionList>("sourcesProperties"); + const optionList& fvOptions = nbrMesh.lookupObject<optionList>("fvOptions"); - const PtrList<option>& bsl = IObsl; + bool nbrModelFound = false; - bool secSourceFound(false); - - forAll(bsl, i) + forAll(fvOptions, i) { - if (bsl[i].name() == secondarySourceName_) + if (fvOptions[i].name() == nbrModelName_) { - secIrht_ = &const_cast<interRegionHeatTransferModel&> + nbrModel_ = &const_cast<interRegionHeatTransferModel&> ( - refCast<const interRegionHeatTransferModel>(bsl[i]) + refCast<const interRegionHeatTransferModel>(fvOptions[i]) ); - secSourceFound = true; + nbrModelFound = true; break; } } - if (!secSourceFound) + if (!nbrModelFound) { FatalErrorIn("interRegionHeatTransferModel::check()") - << "Secondary source name not found" << secondarySourceName_ - << " in region " << secondaryMesh.name() - << nl + << "Secondary source name not found" << nbrModelName_ + << " in region " << nbrMesh.name() << nl << exit(FatalError); } } @@ -90,13 +85,13 @@ Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel ) : option(name, modelType, dict, mesh), - secIrht_(), + nbrModel_(), firstIter_(true), htc_ ( IOobject ( - "htc", + type() + ".htc", mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -140,7 +135,6 @@ void Foam::fv::interRegionHeatTransferModel::addSup if (!secondaryToPrimaryInterpPtr_.valid()) { return; - } if (firstIter_) @@ -157,7 +151,7 @@ void Foam::fv::interRegionHeatTransferModel::addSup ( IOobject ( - mesh_.name() + "::Tmapped", + type() + ".Tmapped", mesh_.time().timeName(), mesh_, IOobject::NO_READ, @@ -170,7 +164,7 @@ void Foam::fv::interRegionHeatTransferModel::addSup volScalarField& Tmapped = tTmapped(); - const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(mapRegionName_); + const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName_); const volScalarField& Tnbr = nbrMesh.lookupObject<volScalarField>("T"); @@ -187,7 +181,7 @@ void Foam::fv::interRegionHeatTransferModel::addSup secondaryToPrimaryInterpPtr_->interpolateInternalField ( htc_, - secIrht_->calculateHtc(), + nbrModel_->calculateHtc(), meshToMesh::CELL_VOLUME_WEIGHT, eqOp<scalar>() ); @@ -195,7 +189,7 @@ void Foam::fv::interRegionHeatTransferModel::addSup if (debug) { - Info<< " Volumetric integral of htc : " + Info<< "Volumetric integral of htc: " << fvc::domainIntegrate(htc_).value() << endl; @@ -241,9 +235,9 @@ void Foam::fv::interRegionHeatTransferModel::addSup void Foam::fv::interRegionHeatTransferModel::writeData(Ostream& os) const { os.writeKeyword("name") << this->name() << token::END_STATEMENT << nl; - os.writeKeyword("mapRegionName") << mapRegionName_ + os.writeKeyword("nbrRegionName") << nbrRegionName_ << token::END_STATEMENT << nl; - os.writeKeyword("secondarySourceName") << secondarySourceName_ + os.writeKeyword("nbrModeleName") << nbrModelName_ << token::END_STATEMENT << nl; os.writeKeyword("master") << master_ << token::END_STATEMENT << nl; os.writeKeyword("semiImplicit") << semiImplicit_ << token::END_STATEMENT diff --git a/src/fvOptions/sources/derived/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.H b/src/fvOptions/sources/derived/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.H index 428b0f2ee5ba47c5261b0f45fa681d2fcf151e34..2ced33cacc43a75bbde985411ff9905df3b6afea 100644 --- a/src/fvOptions/sources/derived/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.H +++ b/src/fvOptions/sources/derived/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.H @@ -57,8 +57,8 @@ private: // Private data - //- Pointer to secondary interRegionHeatTransferModel - interRegionHeatTransferModel* secIrht_; + //- Pointer to neighbour interRegionHeatTransferModel + interRegionHeatTransferModel* nbrModel_; //- First iteration bool firstIter_; diff --git a/src/fvOptions/sources/derived/interRegionHeatTransferModel/tabulatedHeatTransfer/tabulatedHeatTransfer.C b/src/fvOptions/sources/derived/interRegionHeatTransferModel/tabulatedHeatTransfer/tabulatedHeatTransfer.C index 6ccd16cad5cc586aa06b9962ba782ddf9b2eebb8..9d2707f666c21034e50290ddf2383d39a7edd43b 100644 --- a/src/fvOptions/sources/derived/interRegionHeatTransferModel/tabulatedHeatTransfer/tabulatedHeatTransfer.C +++ b/src/fvOptions/sources/derived/interRegionHeatTransferModel/tabulatedHeatTransfer/tabulatedHeatTransfer.C @@ -110,7 +110,7 @@ Foam::fv::tabulatedHeatTransfer::~tabulatedHeatTransfer() const Foam::tmp<Foam::volScalarField> Foam::fv::tabulatedHeatTransfer::calculateHtc() { - const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(mapRegionName()); + const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName()); const volVectorField& UNbr = nbrMesh.lookupObject<volVectorField>("U"); diff --git a/src/fvOptions/sources/derived/interRegionHeatTransferModel/variableHeatTransfer/variableHeatTransfer.C b/src/fvOptions/sources/derived/interRegionHeatTransferModel/variableHeatTransfer/variableHeatTransfer.C index 8af49a5726df1333cf90b1bf636db017aa7831b8..ad2cf21797b9cf3f708dc813f42b686739100c6e 100644 --- a/src/fvOptions/sources/derived/interRegionHeatTransferModel/variableHeatTransfer/variableHeatTransfer.C +++ b/src/fvOptions/sources/derived/interRegionHeatTransferModel/variableHeatTransfer/variableHeatTransfer.C @@ -96,12 +96,11 @@ Foam::fv::variableHeatTransfer::~variableHeatTransfer() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - const Foam::tmp<Foam::volScalarField> Foam::fv::variableHeatTransfer::calculateHtc() { const fvMesh& nbrMesh = - mesh_.time().lookupObject<fvMesh>(mapRegionName()); + mesh_.time().lookupObject<fvMesh>(nbrRegionName()); const compressible::turbulenceModel& nbrTurb = nbrMesh.lookupObject<compressible::turbulenceModel>("turbulenceModel");