diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C index 90d44b7a38..b4259a00be 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -113,7 +113,7 @@ int main(int argc, char *argv[]) if ((correctPhi && mesh.changing()) || mesh.topoChanging()) { // Calculate absolute flux from the mapped surface velocity - // SAF: temporary fix until mapped Uf is assessed + // Note: temporary fix until mapped Uf is assessed Uf = fvc::interpolate(U); // Calculate absolute flux from the mapped surface velocity diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index e53c0395ff..bf7f7ec1b4 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C @@ -132,9 +132,12 @@ int main(int argc, char *argv[]) ghf = (g & mesh.Cf()) - ghRef; } - if (mesh.changing() && correctPhi) + if ((mesh.changing() && correctPhi) || mesh.topoChanging()) { // Calculate absolute flux from the mapped surface velocity + // SAF: temporary fix until mapped Uf is assessed + Uf = fvc::interpolate(U); + phi = mesh.Sf() & Uf; #include "correctPhi.H" @@ -143,6 +146,8 @@ int main(int argc, char *argv[]) fvc::makeRelative(phi, U); mixture.correct(); + + mesh.topoChanging(false); } if (mesh.changing() && checkMeshCourantNo) diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C index 77d28f589c..eb5550222e 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C @@ -128,30 +128,30 @@ Foam::porosityModel::porosityModel const pointField& points = mesh_.points(); const cellList& cells = mesh_.cells(); const faceList& faces = mesh_.faces(); - DynamicList localPoints; forAll(cellZoneIDs_, zoneI) { const cellZone& cZone = mesh_.cellZones()[cellZoneIDs_[zoneI]]; - localPoints.setCapacity(10*cells.size()); + point bbMin = point::max; + point bbMax = point::min; forAll(cZone, i) { const label cellI = cZone[i]; - const cell& c = mesh_.cells()[cellI]; + const cell& c = cells[cellI]; const pointField cellPoints(c.points(faces, points)); forAll(cellPoints, pointI) { - const point& pt = cellPoints[pointI]; - localPoints.append(coordSys_.localPosition(pt)); + const point pt = coordSys_.localPosition(cellPoints[pointI]); + bbMin = min(bbMin, pt); + bbMax = max(bbMax, pt); } } - boundBox bb(localPoints, true); + reduce(bbMin, minOp()); + reduce(bbMax, maxOp()); - Info<< " local bounds: " << bb << endl; - - localPoints.clear(); + Info<< " local bounds: " << (bbMax - bbMin) << nl << endl; } } diff --git a/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.H b/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.H index a2d5b15509..e1a8c7544e 100644 --- a/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.H @@ -44,6 +44,7 @@ SourceFiles #include "CollisionRecordList.H" #include "labelFieldIOField.H" #include "vectorFieldIOField.H" +#include "demandDrivenEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H index ba0ef93db4..872d7f87f6 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H @@ -43,6 +43,7 @@ SourceFiles #include "dictionary.H" #include "forceSuSp.H" #include "fvMesh.H" +#include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -64,7 +65,7 @@ class ParticleForce //- Reference to the mesh database const fvMesh& mesh_; - //- Force coefficients dictaionary + //- Force coefficients dictionary const dictionary coeffs_; @@ -138,7 +139,7 @@ public: //- Return const access to the cloud owner inline const CloudType& owner() const; - //- Return refernce to the cloud owner + //- Return reference to the cloud owner inline CloudType& owner(); //- Return the mesh database diff --git a/src/thermophysicalModels/properties/liquidPropertiesFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C b/src/thermophysicalModels/properties/liquidPropertiesFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C index f0c36d21ea..f0f9d05470 100644 --- a/src/thermophysicalModels/properties/liquidPropertiesFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/properties/liquidPropertiesFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C @@ -192,7 +192,7 @@ humidityTemperatureCoupledMixedFvPatchScalarField QrNbrName_(psf.QrNbrName_), QrName_(psf.QrName_), specieName_(psf.specieName_), - liquid_(psf.liquid_), + liquid_(psf.liquid_, false), liquidDict_(psf.liquidDict_), mass_(psf.mass_, mapper), Tvap_(psf.Tvap_), @@ -351,7 +351,7 @@ humidityTemperatureCoupledMixedFvPatchScalarField QrNbrName_(psf.QrNbrName_), QrName_(psf.QrName_), specieName_(psf.specieName_), - liquid_(psf.liquid_), + liquid_(psf.liquid_, false), liquidDict_(psf.liquidDict_), mass_(psf.mass_), Tvap_(psf.Tvap_), @@ -449,7 +449,14 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs() scalarField nbrIntFld(nbrField.patchInternalField()); mpp.distribute(nbrIntFld); + scalarField& Tp = *this; + + const volScalarField& T = + static_cast(internalField()); + + const scalarField TpOld(T.oldTime().boundaryField()[patch().index()]); + scalarField Tin(patchInternalField()); const scalarField K(this->kappa(*this)); @@ -463,6 +470,7 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs() mpp.distribute(nrbDeltaCoeffs); scalarField KDeltaNbr(nbrK*nrbDeltaCoeffs); + mpp.distribute(KDeltaNbr); myKDelta_ = K*patch().deltaCoeffs(); @@ -655,15 +663,11 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs() } } - scalarField myKDeltaNbr(patch().size(), 0.0); scalarField mpCpTpNbr(patch().size(), 0.0); scalarField dmHfgNbr(patch().size(), 0.0); if (!fluid_) { - myKDeltaNbr = nbrField.myKDelta(); - mpp.distribute(myKDeltaNbr); - mpCpTpNbr = nbrField.mpCpTp(); mpp.distribute(mpCpTpNbr); @@ -690,42 +694,39 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs() const scalarField mpCpdt(mpCpTpNbr + mpCpTp_); // Qr > 0 (heat up the wall) - scalarField alpha(KDeltaNbr + mpCpdt - (Qr + QrNbr + dmHfg)/Tp); + scalarField alpha(KDeltaNbr + mpCpdt - (Qr + QrNbr)/Tp); valueFraction() = alpha/(alpha + myKDelta_); - refValue() = (KDeltaNbr*nbrIntFld + mpCpdt*Tp)/alpha; + refValue() = (KDeltaNbr*nbrIntFld + mpCpdt*TpOld + dmHfg)/alpha; mixedFvPatchScalarField::updateCoeffs(); - if (debug) + if (debug && fluid_) { - if (fluid_) - { - scalar Qdm = gSum(dm); - scalar QMass = gSum(mass_); - scalar Qt = gSum(myKDelta_*(Tp - Tin)*magSf); - scalar QtSolid = gSum(KDeltaNbr*(Tp - nbrIntFld)*magSf); + scalar Qdm = gSum(dm); + scalar QMass = gSum(mass_); + scalar Qt = gSum(myKDelta_*(Tp - Tin)*magSf); + scalar QtSolid = gSum(KDeltaNbr*(Tp - nbrIntFld)*magSf); - Info<< mesh.name() << ':' - << patch().name() << ':' - << internalField().name() << " <- " - << nbrMesh.name() << ':' - << nbrPatch.name() << ':' - << internalField().name() << " :" << nl - << " Total mass flux [Kg/s] : " << Qdm << nl - << " Total mass on the wall [Kg] : " << QMass << nl - << " Total heat (>0 leaving the wall to the fluid) [W] : " - << Qt << nl - << " Total heat (>0 leaving the wall to the solid) [W] : " - << QtSolid << nl - << " wall temperature " - << " min:" << gMin(*this) - << " max:" << gMax(*this) - << " avg:" << gAverage(*this) - << endl; - } + Info<< mesh.name() << ':' + << patch().name() << ':' + << internalField().name() << " <- " + << nbrMesh.name() << ':' + << nbrPatch.name() << ':' + << internalField().name() << " :" << nl + << " Total mass flux [Kg/s] : " << Qdm << nl + << " Total mass on the wall [Kg] : " << QMass << nl + << " Total heat (>0 leaving the wall to the fluid) [W] : " + << Qt << nl + << " Total heat (>0 leaving the wall to the solid) [W] : " + << QtSolid << nl + << " wall temperature " + << " min:" << gMin(*this) + << " max:" << gMax(*this) + << " avg:" << gAverage(*this) + << endl; } }