18#ifndef PECLET_FLOW_SDFLOW_IBM_HPP
19#define PECLET_FLOW_SDFLOW_IBM_HPP
27#include <Kokkos_Core.hpp>
33#include "peclet/core/geom/device_scene.hpp"
48#include "peclet/core/field/field_set.hpp"
49#include "peclet/core/solver/anderson.hpp"
81 using FV = Kokkos::View<MReal*, CCMem>;
82 static constexpr int G = 2;
140 double h[3] = {1.0, 1.0, 1.0};
141 double org[3] = {0.0, 0.0, 0.0};
142 double ext[3] = {0.0, 0.0, 0.0};
180 double hp[3] = {1.0, 1.0, 1.0};
181 double w[3] = {1.0, 1.0, 1.0};
244 double a[3] = {0.0, 0.0, 0.0};
245 double b[3] = {1.0, 1.0, 1.0};
259 const std::array<double, 3>& origin,
const std::array<long, 3>&
globalCells);
265 void setPhysicalDomain(
const std::array<double, 3>& extent,
const std::array<double, 3>& origin,
415 int minBlockExtent = -1);
656 const std::vector<double>& oz);
902 void uploadVelocity(
const std::vector<double>& uu,
const std::vector<double>& vv,
903 const std::vector<double>& ww);
905#ifdef PECLET_FLOW_MPI
912 void initMpi(
int gnx,
int gny,
int gnz, MPI_Comm comm);
919 void initMpi(
const peclet::core::decomp::BlockDecomposer<3>& dec, MPI_Comm comm);
928 void redistribute(
const peclet::core::decomp::BlockDecomposer<3>& newDec);
938 int rebalanceByWeights(
const std::vector<peclet::core::Real>& w);
944 std::vector<CutcellMG::PlanRow> pressureMgPlan()
const;
956 void setDomainBc(
int face,
int type,
double vx,
double vy,
double vz);
1008 void setScene(
const std::vector<int>& nodeInts,
const std::vector<double>& nodeReals,
1009 const std::vector<int>& instInts,
const std::vector<double>& instReals,
1010 bool periodic =
false);
1032 const std::array<double, 3>& ang,
const double* center =
nullptr);
1044 const std::array<double, 4>& quat);
1189 void setSolid(
const std::vector<double>& sdfInner,
bool cutcellPressure);
1386 chebWarmOk_ = chebWarmOk_ || chebBoundsSet_;
1387 chebBoundsSet_ =
false;
1425 std::vector<peclet::core::solver::AndersonRole>
roles;
1429#ifdef PECLET_FLOW_MPI
1430 MPI_Comm comm = MPI_COMM_NULL;
1431 bool distributed =
false;
1552 CCField u, b, inhom, rscale, mask;
1553 FV AC, AW, AE, AS, AN, AB, AT;
1555 Kokkos::View<int*, CCMem> idMap;
1556 Kokkos::View<int, CCMem> counter;
1562 void stepPrechecks();
1565 bool stepHeadFields();
1567 void stepStencils();
1569 bool stepTimeBase();
1571 void stepPressureGhosts();
1573 void stepBalancedForce(
bool hoisted);
1575 void stepPredictorInputs();
1577 bool stepPredictorRhs();
1579 void stepPredictorForces(
bool coloFF,
bool fullStress);
1581 void stepPredictorOperator();
1583 void stepPredictorCoarseAdvection();
1585 void stepMomentumSolve();
1587 void stepProjection();
1589 void stepPostProjection();
1591 void stepTransport();
1593 void stepBackflowWarning();
1597 void projectPhiWallGhosts();
1599 void projectCorrectFaceField();
1601 void projectCorrectFaceFieldOutflow();
1603 void projectCorrectCellField();
1605 void projectCorrectStaggered();
1607 void projectCorrectStaggeredOutflow();
1612 std::vector<double> gpPocketGuardSdf(
CCField din);
1614 void gpBuildOverlay(
CCField sdfGp);
1619 bool pcBuildInputs();
1621 void pcOperatorDomain(
bool opMode,
bool opEnergy);
1623 void pcExchangeInterfaceGhosts();
1627 void hydroReactionChecks();
2080 return SharpViscousState{svCls_, svFb_, {svTau_[0], svTau_[1], svTau_[2]}, svDnn_,
2081 {old_[0], old_[1], old_[2]}, sharpGeom_};
2099 peclet::core::geom::InstanceMotionView<double>
motionView()
const;
2655 template <
class Fill,
class Color,
class ColorDu>
2657 std::function<
double()> resid =
nullptr,
double bnorm = 0.0);
2741 bool faceEdges =
false);
2879 void setField(
const std::string& name,
const std::vector<double>& v);
2909 void addScalar(
const std::string& name,
double D,
int scheme,
int iters,
bool cutcell =
false);
2961 void setScalarSolid(
const std::string& name,
double D,
double capacity,
double partition,
2962 double contactResistance,
int instance);
3287 double sigma = 0.0);
3538 const std::vector<std::vector<double>>& colours);
4008 double stepAdaptive(
double cflTarget,
double capillaryCflTarget,
double dtMax);
4859 const std::string& in1,
const std::vector<double>& params);
4949 const std::vector<double>& xs,
const std::vector<double>& ys);
5010 void resizeForBlock();
5016 void reallocOwnedFields();
5021 void rebindFieldAliases();
5028 static void resizeIfAllocated(
CCField& f,
const char* label, std::size_t n);
5031 void resizeBlockScratch();
5036 CCField ensureTarget(
const std::string& name);
5039 void ensureCellForceAll();
5066 bool touchesGlobalFace(
int f)
const;
5097 std::size_t n_, n1_;
5098 double rho_ = 1.0, mu_ = 0.1, dt_ = 50.0;
5102 double rhoPhys_ = 1.0, muPhys_ = 0.1, dtPhys_ = 50.0;
5103 std::array<double, 3> fPhys_{{0, 0, 0}};
5104 double sigmaPhys_ = 0.0;
5105 double slipPhys_ = 0.0;
5106 double bcVelPhys_[6][3] = {};
5107 std::array<double, 3> f_{{0, 0, 0}};
5112 int superficialAxis_ = -1;
5113 double superficialVelPhys_ = 0.0;
5114 Kokkos::View<double, CCMem> superficialShift_;
5115 int velIters_ = 200, presIters_ = 20;
5116 double velTol_ = 0.0;
5117 int velMinIters_ = 2;
5118 long lastMomentumSweeps_ = 0;
5121 double velResTol_ = -1.0;
5122 double lastMomentumResid_ = -1.0;
5125 double lastAxNorm_ = 0.0;
5126 double lastBNorm_ = 0.0;
5127 int pcgMaxit_ = 500;
5128 double pcgRtol_ = 1
e-10;
5129 bool useChebyshev_ =
false,
5130 chebBoundsSet_ =
false;
5131 bool useFcg_ =
false;
5134 int chebMaxit_ = 120;
5135 double chebRtol_ = 1
e-9, chebA_ = 0.0, chebB_ = 0.0;
5138 bool chebWarmOk_ =
false;
5139 long chebColdRestarts_ = 0;
5140 long chebGrowthTrips_ = 0;
5141 bool chebGrowthWarned_ =
false;
5148 double chebLmaxFloor_ = 0.0, bfpLmaxFloor_ = 0.0;
5156 static constexpr double kCgGuardFactor = 10.0;
5157 static constexpr double kCgGuardFloor = 1
e-8;
5158 double lastPressureTrueResidual_ = 0.0;
5159 long numPressureUnconvergedSolves_ = 0;
5160 long cgGuardNextReport_ = 1;
5161 bool cgContrastPending_ =
false;
5164 bool pressGraphAmg_ =
false;
5169 int pressAgglomMode_ = -1;
5170 long lastPressureIters_ = 0;
5171 bool lastPressureFailed_ =
false;
5176 bool bfpSet_ =
false, bfpOn_ =
false;
5177 bool bfpOpenNotice_ =
false;
5184 bool pbValid_ =
true;
5185 bool pWritten_ =
false, pbWritten_ =
false;
5192 double bfpChebA_ = 0.0, bfpChebB_ = 0.0;
5193 bool bfpChebSet_ =
false;
5195 bool lastBalancedForceFailed_ =
false;
5196 long balancedForceFailures_ = 0;
5197 bool bfpFailWarned_ =
false;
5198 bool coeffBuiltThisStep_ =
false;
5199 bool prefactorHoist_ =
true;
5200 long lastBalancedForceIters_ = 0;
5207 bool faceFieldValid_ =
false;
5210 bool vofPrecheckDone_ =
false;
5216 std::shared_ptr<vof::VofBlockSet> vofBlocks_;
5217 std::shared_ptr<vof::VofBlockExchange> vofBlockExch_;
5224 SField vofBlkS_, vofBlkCeff_;
5226 bool vofOverlapDensity_ =
false;
5229 double vofBlockKappaMax_ = -1.0;
5231 int vofBlockDebris_ = -1;
5232 bool vofPhantomBound_ =
true;
5233 bool distributed_ =
false;
5235#ifdef PECLET_FLOW_MPI
5236 std::shared_ptr<GridHaloTopology<3>> velHalo_;
5237 std::shared_ptr<GridHalo<double>> velDev_;
5238 std::shared_ptr<GridHalo<MReal>> velDevF_;
5242 std::shared_ptr<GridHaloTopology<3>> svHalo_;
5243 std::shared_ptr<GridHalo<double>> svDev_;
5246 static constexpr int kSvHaloDepth = 1;
5247 bool caMomentum_ =
false;
5248 bool momStencilDirty_[3] = {
true,
true,
true};
5249 std::shared_ptr<peclet::core::decomp::BlockDecomposer<3>>
5251 MPI_Comm comm_ = MPI_COMM_NULL;
5252 int gnx_ = 0, gny_ = 0, gnz_ = 0;
5254 int bc_[6] = {0, 0, 0, 0, 0, 0};
5255 double bcVel_[6][3] = {};
5256 bool hasBc_ =
false, hasOutflow_ =
false;
5260 bool backflowWarned_ =
false;
5261 double backflowBeta_ =
5265 int bcProfNc_[6] = {0, 0, 0, 0, 0, 0};
5266 std::vector<double> bcProfRaw_[6];
5267 int bcProfNb_[6] = {0, 0, 0, 0, 0, 0};
5268 int bcProfRawNc_[6] = {0, 0, 0, 0, 0, 0};
5269 CCField bcDcorr_[3], bcBrhs_[3];
5270 bool advect_ =
true;
5271 bool cutcellPressure_ =
false, implicitFou_ =
false;
5272 bool deferredCorr_ =
true;
5274 bool incremental_ =
true,
5279 int pguessMode_ = 1;
5280 int pguessHistMax_ = 2;
5281 int pguessCount_ = 0;
5282 int pguessDriver_ = 0;
5284 bool dtDirty_ =
false;
5288 bool geometryBuilt_ =
false;
5289 int faceInterp_ = 9;
5292 bool advWallVel_ =
true;
5296 bool ufAdvect_ =
true;
5299 bool outflowOpCoeff_ =
true;
5302 bool exactResidual_ =
false;
5310 int decompLevels_ = 0;
5311 double decompMaxImbalance_ = 1.05;
5316 bool weightedDec_ =
false;
5317 double aspectTheta_ = 2.0;
5318 bool rotationalP_ =
true;
5320 bool rotFilter_ =
false;
5325 double rotFilterEps_ = 0.05;
5326 double rotWeight_ = 1.0;
5327 double rotWallW_ = 0.0;
5330 int apertureOrder_ = 2;
5331 int fluidOnlyMode_ = 0;
5332 StarOverlay starOv_;
5333 Kokkos::View<int, CCMem> starCounter_;
5335 bool useVelocityMg_ =
false;
5336 bool vmgExplicit_ =
false;
5340 long vmgAutoCells_ = std::numeric_limits<long>::max();
5341 long vmgAutoMinGlobal_ = 0
L;
5342 int vmgAutoMinExtent_ = 16;
5343 double vmgAutoMinCond_ = 13.0;
5345 bool vmgDecided_ =
false;
5346 int vmgLevels_ = 4, vmgVcycles_ = 8;
5347 bool useVelocityCheb_ =
false;
5348 bool vmgCheb_ =
false;
5349 int vmgChebDegree_ = 0;
5350 double vmgChebEigRatio_ = 10.0;
5351 int velChebMaxit_ = 400;
5354 int outerIters_ = 1;
5355 double outerTol_ = 0.0;
5356 long lastOuterIters_ = 0;
5357 double lastOuterCorr_ = 0.0;
5359 double tStep_ = 0.0, tPredictor_ = 0.0, tMomentum_ = 0.0, tProjection_ = 0.0;
5361 bool vofTiming_ =
false;
5363 double tStepSum_ = 0.0, tPredSum_ = 0.0, tMomSum_ = 0.0, tProjSum_ = 0.0;
5364 double vofTick()
const;
5367 void vofAdd(
double& acc,
double t0);
5372 static double phaseTick();
5375 CCField sdf_, ox_, oy_, oz_, phi_, div_, P_, ox1_, oy1_, oz1_, rhs1_, phi1_, r_, z_, pp_, Ap_;
5376 bool ghostProjection_ =
false;
5377 bool colSchemeAuto_ = Grid::collocated;
5380 Kokkos::View<int*, CCMem> gpIdMap_;
5381 Kokkos::View<int, CCMem> gpCounter_;
5383 int gpMatrixOrder_ = 2, gpRhsOrder_ = 2;
5385 bool hasExactCross_ =
false;
5388 double slipLambda_ = 0.0;
5389 bool wallSlip_ =
false;
5390 Kokkos::View<int, CCMem> slipSkipDev_;
5391 std::array<int, 3> slipSandwich_{0, 0, 0};
5392 bool sceneCrossings_ =
false;
5393 std::shared_ptr<peclet::core::geom::SceneQueryDevice<double, CCMem>> sceneQ_;
5394 bool hasScene_ =
false;
5400 Kokkos::View<int*, CCMem> cutOwner_;
5406 std::vector<double> instCen_, instLin_, instAng_;
5407 Kokkos::View<double*, CCMem> instCenD_, instLinD_, instAngD_;
5409 bool hasMotion_ =
false;
5421 bool haveUStar_ =
false;
5427 bool haveAdvRhs_ =
false;
5428 bool wallFluxDiv_ =
true;
5434 bool freshSeed_ =
true;
5437 std::shared_ptr<peclet::core::geom::SceneBuilder<double>> sceneB_;
5438 peclet::core::Vec3<double> sceneOrigin_{0, 0, 0}, sceneExtent_{0, 0, 0};
5439 bool scenePeriodic_ =
false;
5440 long imageOverlapCells_ = 0;
5441 std::vector<long> movingCutCells_;
5442 std::vector<int> instCenPinned_;
5443 std::vector<long> movingDegenerate_;
5444 bool sceneDirty_ =
false;
5445 std::vector<double> oxOverride_, oyOverride_, ozOverride_;
5446 bool hasOpenOverride_ =
false;
5462 peclet::core::FieldSet fields_;
5463 std::vector<ScalarField> scalars_;
5467 scg::ScalarCutGeometry scg_;
5468 long scgVersion_ = 0;
5472 bool scalarOpenValid_ =
false;
5474 bool pcEnabled_ =
false, pcThermal_ =
false, pcHasUser_ =
false;
5475 double pcRhoG_ = 1.0, pcRhoL_ = 1.0, pcHlv_ = 1.0;
5476 double pcTsat_ = 0.0, pcKg_ = 0.0, pcKl_ = 0.0, pcRint_ = 0.0;
5478 double pcRhoGPhys_ = 1.0, pcRhoLPhys_ = 1.0, pcHlvPhys_ = 1.0;
5479 double pcKgPhys_ = 0.0, pcKlPhys_ = 0.0, pcRintPhys_ = 0.0;
5480 double pcRcpGPhys_ = 1.0, pcRcpLPhys_ = 1.0;
5481 double pcInterfaceEps_ = 1
e-12, pcPureEps_ = 1
e-12;
5482 std::string pcTName_;
5483 CCField pcMdot_, pcSrc_, pcUser_, pcArea_, pcNrm_[3], pcDep_, pcTgt_, pcCnew_, pcDefic_;
5486 bool pcPlaneDir_ =
true;
5487 double pcGfmThMin_ = 0.1, pcGfmThMax_ = 1.9;
5488 bool pcQuadFit_ =
true;
5497 vof::VofInterfaceArea pcAreaC_;
5498 vof::VofMcArea pcAreaMc_;
5499 double pcMcOrphanArea_ = 0.0;
5504 bool pcDepositFallback_ =
false;
5505 bool pcEnergy_ =
false;
5506 double pcRcpG_ = 1.0, pcRcpL_ = 1.0;
5508 vof::VofEnergyAdvector vofEnergy_;
5509 double pcBandDiv_ = 0.0;
5510 CCField pcGn_[3], pcGphi_, pcTgam_;
5515 bool pcBudgetOn_ =
false;
5522 double pcFitKappa_ = 0.0;
5523 bool pcCarryConserve_ =
false;
5525 double pcCarryDeposited_ = 0.0, pcCarryLost_ = 0.0;
5530 bool pcMdotOperator_ =
false;
5531 int pcGfmOrder_ = 1;
5532 bool pcCurvDist_ =
false;
5536 bool pcMaskFresh_ =
false;
5537 double pcQOperator_ = 0.0;
5538 double pcQOrphan_ = 0.0;
5539 double pcMdotFitMean_ = 0.0;
5540 bool pcHasSink_ =
false;
5541 double pcSinkW_ = 0.0;
5542 std::vector<Closure> closures_;
5544 bool hasCellForce_ =
false;
5545 bool varProps_ =
false;
5546 bool harmonicMu_ =
false;
5547 bool fullStress_ =
false;
5548 bool viscousStressAuto_ =
true;
5549 bool fullStressAuto_ =
false;
5550 bool fullStressAutoNotice_ =
false;
5551 bool muUniform_ =
true;
5552 bool regDirty_ =
true;
5554 enum class SharpMode { kAuto, kSharp, kAveraged };
5555 SharpMode sharpMode_ = SharpMode::kAuto;
5556 bool sharpActive_ =
false;
5557 bool sharpAutoNotice_ =
false;
5558 vof::SharpGeom sharpGeom_;
5566 int varRotMode_ = 0;
5567 double varRotChi_ = 1.0;
5568 bool varRho_ =
false;
5571 bool vofEnabled_ =
false;
5574 bool rhoFaceHarmonic_ =
false;
5575 bool outflowCorrValid_ =
false;
5580 bool outflowRhoCorr_ =
true;
5584 bool vofSolidZero_ =
true;
5587 bool contactAngleSet_ =
false;
5588 double contactAngleDeg_ = 90.0;
5589 int contactPivot_ = vof::kVofPivotVolume;
5590 std::vector<double> contactAngleField_;
5594 vof::VofDynamicWetting vofDyn_;
5595 double contactSigmaOverride_ = 0.0;
5596 bool contactSigmaWarned_ =
false;
5598 vof::WyAdvector vofAdv_;
5600 double vofCflLimit_ = 0.25;
5601 double sigmaCsf_ = 0.0;
5602 double capillaryCfl_ = 1.0;
5603 double csfInterfaceEps_ = 1
e-8;
5605 bool kappaFrozen_ =
false;
5608 bool vofBcActive_ =
false;
5610 bool vofInflowSet_[6] = {
false,
false,
false,
false,
false,
false};
5611 bool vofBackflowSet_[6] = {
false,
false,
false,
false,
false,
false};
5612 double vofInflowC_[6] = {0, 0, 0, 0, 0, 0};
5613 double vofBackflowC_[6] = {0, 0, 0, 0, 0, 0};
5614 std::vector<double> vofInflowProfRaw_[6];
5615 int vofInflowProfNb_[6] = {0, 0, 0, 0, 0, 0};
5616 int vofInflowProfNc_[6] = {0, 0, 0, 0, 0, 0};
5617 CCField vofInflowProf3_[6], vofInflowProfG2_[6];
5618 int vofProf3Nc_[6] = {0, 0, 0, 0, 0, 0}, vofProfG2Nc_[6] = {0, 0, 0, 0, 0, 0};
5625 double vofBcVol_[6] = {0, 0, 0, 0, 0, 0};
5626 double vofBcVolTotal_[6] = {0, 0, 0, 0, 0, 0};
5628 vof::VofCurvature vofCurv_;
5629 CCField kappaField_, kappaBranch_;
5630 vof::VofCurvature::Stats vofCurvStats_{};
5632 bool vofMomEnabled_ =
false;
5633 vof::MomentumConsistentAdvector vofMom_;
5635 double vofRhoG_ = 1.0, vofRhoL_ = 1.0;
5636#ifdef PECLET_FLOW_MPI
5637 std::shared_ptr<GridHaloTopology<3>> vofHalo_;
5638 std::shared_ptr<GridHalo<double>> vofDev_;
5640 CCField rho1_, cx1_, cy1_, cz1_;
5641 bool porous_ =
false;
5642 double pressUnderRelax_ = 1.0;
5643 bool porousDepsDt_ =
true;
5647 CCField epsField_, epsPrev_, eps1_, depsdt_;
5654 bool porousCons_ =
true;
5656 bool hasDrag_ =
false;
5679#ifdef PECLET_FLOW_INSTANTIATING
5715#ifndef PECLET_FLOW_INSTANTIATING
5717extern template class Solver<Staggered>;
5718extern template class Solver<Colocated>;
flow — VoF rung V1: Weymouth & Yue (2010) directionally-split, exactly volume-conserving geometric ad...
flow — VoF Part III rung W0: the per-bubble VoF BLOCK, a third container over the same L1 kernels (su...
flow — VoF Part III rung W0: the block gather/scatter (VOF_PLAN.md §10 design items 2 and 4).
void imposeDomainWallKind(int mask)
void vofExchangeScalar(CCField f)
The colour block's ghost policy WITHOUT the colour-specific rules (no solid-band fill,...
int pressureBottomExtent() const
void setVofMomentumMuscl(bool on)
void projectAssembleDivergence()
void setScalarSource(const std::string &name, double S)
void setSolidUploadSdf(CCField din)
void setVofCurvatureMixedHeightFit(bool on)
double wallFluxImbalance()
Net wall flux this rank injects, sum over inner cells of u_w .
void scalarCutMatvecTwo(ScalarField &sc, CCField yf, CCField ys, CCField xf, CCField xs)
bool hasCutcellPressure() const
void setPressureLineRelaxation(bool enabled)
void setContactAngleClamp(double loDeg, double hiDeg)
const VofTiming & vofTimingReport() const
bool vofBlocksEnabled() const
void setPressureMeanRemoval(bool all)
std::vector< double > getScalarSolid(const std::string &name)
double multigridAspectThreshold() const
int phaseChangeArea() const
std::vector< double > getFaceVelocity(int c)
void setPhaseChangeGfmOrder(int order)
WO-P3g item 2: the order of the one-sided (ghost-fluid) Dirichlet row.
void setVofRhoFloorFrac(double f)
void harvestVofBlockUnion()
void setPhaseChangeEnergyMuscl(bool on)
MinMod-limited donor reconstruction of the face temperature in the consistent energy flux (vof/energy...
void pcMdotExtrema(long nIface)
bool pressureVcycleFp32() const
void noteChebyshevGrowthTrip(long iters)
void enableVofBlocksFromField(const std::vector< std::array< int, 6 > > &boxes)
static constexpr int kVofG
bool phaseChangeEnergyMuscl() const
void setSolidInitPressureMg()
void setScalarWall(const std::string &name, int type, double value, double coefficient, int instance)
void setInstanceTransform(int i, const std::array< double, 3 > &translation, const std::array< double, 4 > &quat)
Move one instance (Layer 3 rung 4).
std::array< int, 3 > globalResolution() const
long numPressureChebyshevRestarts() const
void projectPressureUpdate()
void extendSdfDomainGhosts(CCField f)
Repair a cell-centred geometry field's ghost band on every rank-owned NON-PERIODIC domain face,...
void setContactAngleSmoothing(bool on)
void setPhysicalDomain(const std::array< double, 3 > &extent, const std::array< double, 3 > &origin, const std::array< long, 3 > &globalCells)
Arm the physical domain.
void setPhaseChangeThermalOff()
void applyVelocityBcAll(int fold, bool doOutflow)
void vofApplyColourBc(CCField f)
The colour field's boundary rules, applied at the END of vofFillGhosts — i.e.
void fillVelGhosts(int comp, int fold)
void pcZeroDomainGhosts(CCField f)
Zero the two ghost layers on every NON-periodic domain face this rank owns.
std::vector< double > scalarGeometryField(int which)
void setIncrementalPressure(bool on)
void pcCarryDeposit(ScalarField &sc)
WO-P3f — the enthalpy the per-cell Dirichlet overwrite destroys, returned to the phase it came from.
std::function< double()> constCoeffResidual(int c, double bx, double by, double bz, double Ac)
long lastPressureAllreduceCount() const
void setVelocityTolerance(double rtol, int minIters)
double maxOpenDivergenceInternal()
The same diagnostic in INDEX units (per tRef), which is what the solver's own guards read.
void addCsfRhs(int c, CCField dst, bool rowScaled, bool faceRange=false)
double stencilBnorm(int c)
double capillaryCfl() const
void registerBalancedForceState()
void setContactAngleDynamicOff()
bool pressureCoarseGhost() const
void buildRhsVarMom(int c)
void scatterInner(CCField fld, const std::vector< double > &in)
void setSolid(const std::vector< double > &sdfInner, bool cutcellPressure)
Host entry point: upload the inner SDF once and delegate.
void phaseChangeStep()
The in-step driver: everything applyPhaseChange does, at the head of step().
bool advectsMomentum() const
void setContactAnglePivot(int mode)
void checkCgExit(CCField rhs1, CCField x1, long iters, const char *which, const StarOverlay *star)
void setVofBlockPool(bool on)
bool contactAngleSet() const
ScalarField & scalarField(const std::string &name)
PhaseChangeDiagnostics phaseChangeDiagnostics()
void setVofKappaConstant(double kappa)
kappa is a PHYSICAL curvature, 1/length (the internal field is 1/h; see vof_curvature()).
bool phaseChangeDepositFallback() const
bool balancedForceProjection() const
void buildOpenFaceField()
Build ufOpen_ = the face field with each open (outflow) domain face overwritten by its zero-gradient ...
void setScalarSourceField(const std::string &name, const std::vector< double > &S)
std::array< double, 3 > scalarMeanFlux(const std::string &name)
bool hasMovingInstance() const
True when at least one instance carries a nonzero velocity – i.e.
long solveBalancedForceSystem(double bref, double r0)
void fillDragBetaGhosts()
void fillGhosts(CCField f)
std::vector< double > getVofCurvature()
The interface curvature kappa = 2H in the caller's units, i.e.
long lastOuterIterations() const
long pressurePrefactorCount() const
void setMassFluxUniform(double v)
Prescribe a UNIFORM mass flux (P0), in mass per area per time.
double decompositionMaxImbalance() const
void fillDomainPeriodic(CCField f)
void setPressureCoarseGhost(bool on)
Neumann (zero-gradient) coarse ghost on wall/inflow faces before the pressure MG's prolongation — the...
void setDomainBc(int face, int type, double vx, double vy, double vz)
bool advWallInputs() const
R0 helper: allocate (once) and arm the per-component advective-term stash the reaction-force budget c...
void refreshWallVelocity()
Re-derive ONLY the wall-velocity fields and the momentum operator that folds them in.
void setUfAdvection(bool on)
Advect the collocated momentum with the PROJECTED, divergence-free MAC face field uf_/vf_/wf_ (DEFAUL...
void setPhaseChangeFitCurvature(double kappa)
WO-P3f INSTRUMENT: prescribe the interface curvature kappa = div(n) the one-sided fits use to correct...
void resolveSharpViscous()
int vofBlockAssign() const
void fillPropGhosts(CCField f, bool edges=false)
void requireCollocatedFaceForceScope(const char *who)
void seedFaceFieldFromCells()
double lastStepSeconds() const
void patchScalarDirichletFaceVar(CCField AC, CCField band, CCField kc, int a, int side)
void setFaceInterp(int mode)
void applyBackflowStab(int c)
void buildFullStressRegMasks()
void pcScatterSource()
(2) Deposit each interfacial cell's source into its chosen pure-gas cell, as a GATHER (each receiving...
void checkMovingInstancesAreCut()
A MOVING instance whose surface produces no fractional face aperture has no path for its wall velocit...
sco::MeanGradPosition scalarMeanGradPosition(const double Gphys[3]) const
std::vector< std::array< int, 3 > > pressureMgLevelRatios() const
void pcApplyDivergenceSource(CCField div)
Subtract the phase-change (and any prescribed) divergence source from div_ so the deflated pressure s...
int sceneInstanceCount() const
void checkVofBcFace(int f, int wantType, const char *who)
A VoF boundary colour is only meaningful on a face that already carries the matching domain BC,...
void setPhaseChangeMdotOperator(bool on)
WO-P3g item 1: take mdot from the energy operator's own interfacial flux instead of the one-sided lea...
std::vector< double > scalarSolidGeometryField(const std::string &name, int which)
void setVofTiming(bool on)
long numPressureEigenEstimates() const
std::vector< double > getField(const std::string &name)
std::vector< long > movingInstanceDegeneratePoints() const
Per instance: staggered points where the sampled sdf is exactly zero (see the warning).
void setOutflowRhoCorrection(bool on)
void setPropertyMode(bool variable, bool harmonic)
std::vector< double > vofBlockKappa(long id)
double lastPressureAllreduceSeconds() const
bool prefactorHoistEligible() const
void addCsfRhsBlocks(int c)
std::string vofMomentumScheme() const
double phaseChangeCarryDeposited() const
The carry ledger, physical: an energy with the consistent transport on, and a temperature times a vol...
void setVofMomentumCellFlag(bool on)
void setVelocityChebyshev(bool on, int maxit=400)
void applyVelocityBcComp(int comp, int fold, bool doOutflow)
void setOpennessOverride(const std::vector< double > &ox, const std::vector< double > &oy, const std::vector< double > &oz)
void setOuterTolerance(double tol)
CCField addField(const std::string &name)
void vofBcArm()
Arm the rung: install the mask, rebuild the profiles, and zero the boundary volume ledger.
void computeVofCurvature()
double lastMomentumResidual() const
double maxOpenDivergence()
void scalarCutRefusals(const ScalarField &sc) const
std::string vofViscousInterface() const
std::array< double, 3 > domainOrigin() const
Physical lower corner of the GLOBAL inner grid.
void computeVofBlockCsf()
void setPressureGraphAmg(bool on)
bool vofHasGeometry() const
void scalarCutMatvec(ScalarField &sc, CCField y, CCField x)
double vofSolidColourSum()
std::array< long, 3 > fluidMomentumCells()
The number of unmasked (fluid) staggered momentum cells per component – the exact discrete datum the ...
ScalarField & cutcellScalar(const std::string &name, const char *who)
void pcRegress(double dt)
(3) The regression: two Jacobi passes over the exchanged per-cell data, so the clip deficit is redist...
bool vofRhoClosureEnds(double &rho0Phys, double &rho1Phys) const
vof::VofInterfaceArea::Stats pcAreaCascadeCompute()
Run the cascade area driver on the (already bridged) g = 3 colour block.
void advectVofBlocksInternal(double dtInt, bool requireSolenoidal)
The same with dt already in INTERNAL time (step() passes its dt_).
VelocityMG::Comm vmgComm() const
double velocityResidualTolerance() const
void buildRhsColoVar(int c)
ScalarCutFacets scalarFacets(const std::string &name)
SField pcAreaCascadeField() const
The area field the last pcAreaCascadeCompute filled (either driver).
void setVelocitySolverAuto()
double pcEffPureEps() const
…and the mirror statement: a cell the ADVECTOR treats as a pure phase is a pure phase here too,...
void setPressureTelescope(bool on)
std::vector< double > getVofFilledColour()
double phaseChangeQOrphan() const
void setPressureStrict(bool on)
Throw instead of reporting when the pressure preconditioner returns a non-finite correction (ISSUES s...
void requireFullStressScope(const char *who) const
void pcUpdateThermalMask()
void enableVofBlocks(const std::vector< std::array< double, 4 > > &seeds)
OutflowBackflow outflowBackflow()
void fillGhostsFaces(CCField f)
bool freshCellSeed() const
bool advectionWallVelocity() const
void debugSetPressureEigenScale(double s)
void applyVelocityBcFace(CCField f, int comp, int a, int s, int fold, bool doOutflow)
void scaleForceTorque(std::vector< double > &out, std::size_t m) const
Hydrodynamic force and torque on each scene instance (Layer 4 rung 2) – the resolved CFD-DEM feedback...
void scalarCutAssembleSolve(ScalarField &sc, bool steady)
std::array< double, 3 > wallAreaProbe()
A_wall EXACTNESS PROBE (diagnostic for the Layer-4 force integral).
void pcUpdateEnergyProps()
Refresh k(C) and (rho c_p)(C) on the G=2 block from the current colour.
void rebuildGeometry()
Re-derive ALL geometry from the current instance transforms (Layer 3 rung 4): rebuild the accelerated...
void exchangeFieldAdd(const std::string &name)
void setSolidSelectScheme()
std::vector< double > getVofAdvectedVelocity(int c)
void advanceScalarCutCell(ScalarField &sc)
CCConst advVelView(int c) const
The velocity view the advection operators must read for component c: the wall-corrected scratch while...
void setContactAngleDynamic(double thetaEDeg, double slipCells, double muLiquid, double sigma=0.0)
void requireScalesPinned(const char *who, bool needRho) const
Under an armed extent, refuse a call that writes a dimensional value into a FIELD before the referenc...
void exchangeField(const std::string &name)
void setAdvection(bool on)
std::array< long, 3 > globalCells() const
void bridgeOutflowFacePlanes()
Bridge the HIGH-side boundary-face openness plane of every rank-owned outflow axis from the g=2 block...
void addFullStressRhsComp(int c)
void sharpViscousGeometry()
void setPressureExactResidual(bool on)
WO-R2 item 3 — the exact (matrix-free, double, flux-form) level-0 operator apply in the residual and ...
std::vector< double > getVofGeometry(int which)
double phaseChangeQOperator() const
The operator's interfacial heat (power), physical.
void setSolidFromScene(bool cutcellPressure)
Sample the scene onto this rank's inner grid and install it as the solid, entirely on device – no nx*...
void vofRebuildBcBlock()
(Re)build everything that lives on the g=3 block for this rung: the out-of-domain mask and the resamp...
void addScalar(const std::string &name, double D, int scheme, int iters, bool cutcell=false)
void setScalarResidualTolerance(const std::string &name, double rtol)
void fillFaceGhostsKeepBoundary(CCField f, int a)
std::vector< double > vofBcVolumes() const
Signed liquid volume that crossed each of the six domain faces during the LAST colour advection,...
void setScalarBcProfile(const std::string &name, int face, const std::vector< double > &prof, int n1, int n2)
double maxPorousResidual()
vof::SharpCensus vofViscousInterfaceCensus() const
bool phaseChangeEnabled() const
void uploadVelocity(const std::vector< double > &uu, const std::vector< double > &vv, const std::vector< double > &ww)
Upload an initial velocity field in the caller's PHYSICAL units (converted per component to the index...
double maxOpenDivergenceProjectedInternal()
The same diagnostic in INDEX units (per tRef), which is what the solver's own guards read.
std::vector< double > getVof()
double surfaceTension() const
The surface tension in the caller's units (what set_surface_tension was given).
bool outflowRhoCorrection() const
void copyInner(CCField dst, C3 de, int dg, CCConst src, C3 se, int sg)
void requireNoGeometry(const char *who) const
void setDivergenceSink(const std::vector< double > &w)
WO-P23: an AUTO-BALANCED sink region for the phase-change divergence source.
void applyVelocityBcCompTo(CCField f, int comp, int fold, bool doOutflow)
void setPressureVcycleSymmetric(bool enabled)
double capillaryDtInternal()
The same limit in the solver's index time (per tRef) — what the step's own guards compare to.
void setPropertyModel(const std::string &target, ClosureKind kind, const std::string &in0, const std::string &in1, const std::vector< double > ¶ms)
double maxAbsDiffInner(CCConst a, CCConst b)
void fillPeriodicAxes(CCField f, int axes)
void scalarCutAdvection(ScalarField &sc, bool steady)
void requireIsotropic(const char *what) const
Phase 2 §7 — refuse an ANISOTROPIC domain in a consumer this phase does not carry.
double vofTimingProjectionSeconds() const
CsfDiagnostics csfDiagnostics()
const scg::ScalarCutGeometry & scalarCutGeometry()
void setBackflowStab(double beta)
std::array< double, 3 > spacing() const
Cell size per axis (equal on every axis unless the Phase 2 anisotropic path is armed – see unitScales...
void setSurfaceTension(double sigma)
void exchangeExtRaw(CCField f)
Raw ghost fill of an extended-block field: the rank halo exchange under MPI, the periodic wrap single...
bool velocityChebyshevActive() const
void setVelocityIterations(int it)
void vofHarvestBcVolumes()
Move the advector's per-face boundary volume ledger into the solver's, once per advection.
void enableVofMomentum(double rhoGasPhys, double rhoLiquidPhys)
rhoGas / rhoLiquid are PHYSICAL densities, the same numbers the rho closure is given.
ScalarFaceFlux scalarFaceFlux(int a) const
double finishResidual(int c)
ScalarCutBudget scalarBudget(const std::string &name)
bool ufAdvVelocity() const
Are the advection operators reading the projected face field this step?
std::vector< double > getVofCurvatureBranch()
bool bcVelFacePair(int a) const
std::vector< double > scalarWallFlux(const std::string &name)
void setPressureChebyshev(bool on, int maxit, double rtol)
void setVofInflowProfile(int f, const std::vector< double > &prof, int nb, int nc)
Per-position inflow colour on face f: prof is (nb, nc) on the INNER grid of the face's two perpendicu...
double vofBlockImbalanceOf(int mode) const
void scalarCutWarnings(ScalarField &sc)
const UnitScales & unitScales() const
bool lastBalancedForceFailed() const
bool rhoFaceHarmonic() const
std::vector< int > getCutOwner() const
Per-inner-cell owning instance (Layer 3 rung 1), x-fastest, -1 where no scene has been sampled yet.
CCConst openFaceView(int c) const
Component c of the face field AS THE ADVECTION AND THE DIVERGENCE DIAGNOSTIC MUST READ IT: advFaceVie...
void applyScalarBcFace(CCField c, int a, int side, int type, double val, bool edges=false)
bool phaseChangeEnergy() const
void requireVofGeometry(const char *who)
void ensureScalarCutGeometry()
bool phaseChangeMdotOperator() const
void setSolidGhostProjectionOverlay(CCField din)
void addWallFluxDivergence(CCField d)
void ensureScalarSolidRecord(ScalarField &sc, const std::vector< char > &conj)
double capillaryDt()
The Brackbill capillary limit in the CALLER's time unit.
void setVof(const std::vector< double > &c)
void setContactAngleHysteresis(double thetaADeg, double thetaRDeg)
static constexpr double defaultVofWispEps()
The value enableVof starts from.
double maxOpenDivergenceProjected()
long lastBalancedForceIterations() const
void setScalarBc(const std::string &name, int face, int type, double value)
bool hasOpenDomainFace() const
std::vector< double > getOpenness(int c)
long periodicImageOverlapCells() const
Cells on this rank whose solid/fluid sign was set by a periodic IMAGE of an instance wider than the b...
bool pressureStrict() const
void buildVelocityOverlays(bool resetU)
Build the three per-component Robust-Scaled cut-cell overlays + solid masks from the CURRENT sdf_ (ex...
void setSolidBuildOverlaysAndStencils()
Solver(int nx, int ny, int nz)
vof::VofCurvature::Stats vofBlockCurvatureStats() const
void setPressureInitialGuess(int mode, int history)
void applyDomainWallGeometry(int mask)
void addDragDiagonal(int c)
void setPhaseChangeThermal(const std::string &tname, double Tsat, double kg, double kl, double Rint)
P1: compute mdot each step from the registered scalar tname by the one-sided pure-cell weighted least...
std::vector< double > getVofBlockForce(int c)
void setGhostProjection(bool on, int matrixOrder=2, int rhsOrder=2)
void debugDropPressureBounds()
bool scalarRootRank() const
rank 0 (or not distributed): the one that prints a warning
bool vofKappaFrozen() const
void pcBudgetPost(ScalarField &sc)
WO-P3f, part 2: the state AFTER the energy solve, the heat the plane-anchored rows actually delivered...
std::array< long, 2 > vofBlockPoolStats() const
void constraintDivergence(CCConst fx, CCConst fy, CCConst fz, CCField out)
int scalarNumBodies() const
void setVofCutFluxClamp(bool on)
CCConst advFaceView(int c) const
Component c of the collocated MAC face field (uf_/vf_/wf_), flow's low-face convention: entry i is th...
void setPhaseChangePlaneDirichlet(bool on)
The PLANE-ANCHORED (ghost-fluid) Dirichlet condition, ON by default.
int apertureOrder() const
ContactAngleDiagnostics contactAngleDiagnostics()
void setPressurePrefactorHoist(bool on)
void setVofCurvatureWeightWidth(double d)
void projectBuildCoefficients()
void setVariableRotational(int mode, double chi)
void setWallFluxDivergence(bool on)
Rung 3 on/off.
void setPressureUnderRelax(double w)
long lastMomentumSweeps() const
void setScalarMeanGradient(const std::string &name, const std::array< double, 3 > &G)
bool vofCutFluxClamp() const
double vofRhoFloorFrac() const
double vofTimingPredictorSeconds() const
double vofInterfaceArea()
The summed interfacial area over the inner region, PHYSICAL (globally reduced under MPI) — the E7 gal...
void setPressureLevels(int levels)
long balancedForceFailures() const
void closureUnitsNotice(const std::string &target) const
Under a physical domain, say on stderr that a closure on a target of unknown dimension takes its para...
void vofExchangeRaw(CCField f)
std::array< int, 3 > blockOrigin() const
void setFluidOnlyConstraint(int mode)
double wallSlipLength() const
The Navier slip length in the caller's units (0 = no-slip).
void setRotationalPressure(bool on)
void setInstanceMotion(int i, const std::array< double, 3 > &lin, const std::array< double, 3 > &ang, const double *center=nullptr)
Rigid-body motion of one scene instance (Layer 3 rung 2).
void setPhaseChangeQuadraticFit(bool on)
The QUADRATIC one-sided gradient fit (T - T_G = G phi + Q phi^2) instead of the linear one.
void setDeferredCorrection(bool on)
void setScalarSolid(const std::string &name, double D, double capacity, double partition, double contactResistance, int instance)
void applySuperficialVelocity()
double vofInterfaceEps() const
void clearDivergenceSink()
void setPressureGeometry(const std::vector< double > &sdfInner)
void setVofBlockAssign(int mode, long every)
void resampleBcProfile(int face)
double phaseChangeFitCurvature() const
double pcBandDivergence()
The BAND-EXTENDED LIQUID VELOCITY of VOF_PLAN §9 item 3, as a MEASUREMENT rather than a switch.
scg::ScalarCutCensus scalarCutCensus()
Solver(int nx, int ny, int nz, const std::array< double, 3 > &extent, const std::array< double, 3 > &origin, const std::array< long, 3 > &globalCells)
Physical-domain constructor (plan §3.3).
void pcBudgetPre(ScalarField &sc)
WO-P3f, the energy-budget instrument, part 1: the state BEFORE the energy solve, and the class-change...
double contactAngle() const
void setWallSlipLength(double lambdaCells)
WO-V6b – the VELOCITY half of the dynamic contact line.
std::array< double, 3 > instanceCenter(int i) const
The resolved centre of rotation of instance i and whether it is pinned (explicit) or follows the body...
void applyPhaseChange(double dtPhysArg)
Kinematic entry point (the P0a/P1 driver): build mdot/A_G/n from the current colour and temperature,...
void updateVofCurvature()
void requireWettingWall() const
void vofBlockCensus(std::vector< long > &masters, std::vector< long > &cells) const
void setPhaseChangeCarryConserve(bool on)
WO-P3f: make the per-cell Dirichlet overwrite ENTHALPY-CONSERVING.
void setVofBackflow(int f, double value)
inletOutlet backflow colour on outflow face f (default 0 = gas): where the boundary face velocity poi...
void applyBalancedForceProjection()
vof::MomentumConsistentAdvector::Diagnostics vofMomentumDiagnostics()
bool wallFluxDivergence() const
std::vector< double > vofBlockColour(long id)
std::vector< long > movingInstanceCutCells() const
Per instance: cut rows of the momentum operator (all three components) at inner points this rank owns...
std::vector< double > getVofDynamicField(int which)
std::vector< double > hydroForceTorque()
PHASE 2 (anisotropic cells), doc/anisotropic_metric.md §4.4 — ADMITTED since commit C4.
void resolveViscousStressAuto()
void setVofCurvatureWorklist(bool on)
VofCurvature::useWorklist — run the height-function cascade and the PV fallback over a COMPACTED list...
void setPressureVcyclePrecision(int mode)
void setPhaseChangeEnergyOff()
void setContactAngleField(const std::vector< double > &thetaDeg)
void seedFreshCells(CCField mOld[3])
FRESH CELLS: the points a moving body has just uncovered.
int pressureGuessCount() const
void setCapillaryCfl(double f)
SceneMap sceneMap() const
const vof::VofCurvature::Timing & vofCurvatureTiming() const
CCField resampleFaceScalar(const std::vector< double > &prof, int nb, int nc, int face, C3 ext, int g, int &outNc)
Clamp-resample a per-position face scalar from the user's (nb, nc) INNER grid onto the ghost-inclusiv...
bool vofMomentumEnabled() const
vof::VofCurvature::Stats vofCurvatureStats() const
void setCommAvoiding(int mask)
Communication-avoiding red-black smoothing: kCaMomentum | kCaMg.
void fillAxis(CCField f, int axis)
void setAdvectionWallVelocity(bool on)
A0 — wall velocity (not zeros) in the advection inputs' masked rows. DEFAULT true.
void pcBuildInterface()
(1) The interface build: for every inner interfacial cell reconstruct the PLIC plane from the canonic...
void setVofPhantomCapillaryBound(bool enabled)
std::vector< double > getMomentumDiagonal(int c)
std::vector< double > reactionBudgetTerms()
R0 DECOMPOSITION PROBE.
void setPorousDepsDt(bool on)
void updateVofBlockOverlap()
int contactAnglePivot() const
void setField(const std::string &name, const std::vector< double > &v)
void setVofMomentumScheme(const std::string &name)
void setSolidDevice(CCField din, bool cutcellPressure)
Device entry point (Layer 2): the inner SDF is ALREADY on device, so geometry never round-trips throu...
void setApertureOrder(int order)
double lastProjectionSeconds() const
bool fullStressActive() const
double lastSuperficialVelocityShift() const
The shift the last step() applied (caller's velocity units; 0 when off).
void setVelocity(int c, const std::vector< double > &v)
Write a component's inner velocity from a host vector (x-fastest, inner region) and re-impose the sol...
void setBodyForce(double fx, double fy, double fz)
Body force per unit volume, in the caller's units (e.g. a mean pressure gradient, or rho*g).
void solveScalarSteady(const std::string &name)
std::vector< double > getOpennessProj(int c)
double pcLedgerEnergyToPhys() const
The factor from an internal phase-change ledger entry (a per-cell sum of rcp' dT) to the caller's uni...
std::vector< double > vofBcVolumesTotal() const
The same, accumulated since enable_vof() (or the last resetVofBcVolumes()).
void closureRefreshUnits(Closure &cl)
Re-derive a closure's internal p / tabY from its physical pPhys / tabYPhys with the current reference...
void setVofWorklist(bool on)
WyAdvector::useWorklist — the compaction of the PLIC reconstruction pass onto the mixed cells.
void buildVofCellVelocity()
std::vector< double > getVelocity(int c)
void setPorousConservative(bool on)
void chebSolveComp(int c)
std::array< int, 3 > blockShape() const
bool geometryBuilt() const
void vofExtendWallBand(CCField f, int mask)
VofOverlapCensus vofBlockOverlapCensus() const
std::array< std::vector< double >, 5 > vofViscousInterfaceFit()
void setRhoFaceHarmonic(bool on)
void setVofInflow(int f, double value)
Colour of the fluid entering through inflow face f (0..5 = -x,+x,-y,+y,-z,+z), in [0,...
void setSolidBuildOpenness()
bool pressureExactResidual() const
bool contactAngleHysteresis() const
double lastPressureTrueResidual() const
void setVofStepParity(long n)
long strideOf(int c) const
const vof::WyAdvector::Timing & vofKernelTiming() const
void fillVelGhostsTo(CCField f, int comp, int fold, bool doOutflow=true, bool faceEdges=false)
bool pressureSolveFailed() const
void collocatedV8AutoFallback(const char *why)
peclet::core::geom::InstanceMotionView< double > motionView() const
bool hasField(const std::string &name) const
void clearDivergenceSource()
void setDomainBcProfile(int face, const std::vector< double > &prof, int nb, int nc)
void debugSetPressureFp32Fault(int kind, int at)
void setVofViscousInterface(const std::string &mode)
void setViscousStress(const std::string &form)
void setAdvectionScheme(int s)
void enablePhaseChange(double rhoG, double rhoL, double hlv)
Turn on phase change.
void throwVelocityMgVariableMu(const char *who) const
int pressureTelescopeCount() const
void setSolidStarOverlay()
void setExactCrossingsFromScene()
EXACT wall crossings straight from the scene, on device, on every rank – the in-solver replacement fo...
long lastPressureIterations() const
std::array< int, 3 > wallSlipSandwichCells() const
Cut-cell axes at which a one-cell fluid gap kept the no-slip closure (per component).
void setPressurePcg(bool on, int maxit, double rtol)
void setVelocityMultigridAuto(long cellsPerRank, long minGlobalCells=-1, int minBlockExtent=-1)
long solvePressureSystem(CCField rhs1, CCField x1)
void allocateBlock(int nx, int ny, int nz)
const char * projectedGuessIneligible() const
int pressureVcycleRestarts() const
void scalarCaptureOpenFaceFlux()
void setVelocityMultigrid(bool on, int levels, int vcycles)
void setRotationalWeight(double w)
void setVofBlockDeviceStaging(bool on)
void setDensityMode(bool variable)
double lastPredictorSeconds() const
void gpUploadSdf(const std::vector< double > &sdfGpHost, std::size_t nInner, CCField sdfGp)
void fillCellForceGhosts()
bool hasScalar(const std::string &name) const
void setMu(double m)
Dynamic viscosity, in the caller's units.
void setVofKappaFrozen(bool on)
void pcBuildInDomain()
WO-P3g — 1 on every cell that CARRIES A ROW in the energy solve, 0 otherwise.
int phaseChangeGfmOrder() const
void setDecomposition(int levels, double maxImbalance=1.05)
How the shared level-0 MPI decomposition is built.
void setExactCrossings(const std::vector< double > &t)
double vofRhoFloor() const
void setPressureWarmstart(bool on)
void superficialVelocityPrecheck() const
void velSweepLoop(Fill &&fill, Color &&sweepColor, ColorDu &&sweepColorDu, std::function< double()> resid=nullptr, double bnorm=0.0)
void setPressureIterations(int it)
void pcCarryApply(ScalarField &sc)
WO-P3f: consume pcCarrySrc_ into the energy solve's time base.
bool balancedForceActive() const
Kokkos::View< MReal *, CCMem > FV
double stepAdaptive(double cflTarget, double capillaryCflTarget, double dtMax)
void pcUpdateCurvature()
The per-cell Dirichlet mask of the energy scalar: T = T_sat + mdot R_int in every interfacial cell,...
bool velocityMgChebyshev() const
void bridgeVelocityToVof()
int heldResidualPlane(int c) const
void setVofBlockOverlapDensity(bool enabled)
void refreshUnitDerived()
Re-derive every internal (index-unit) quantity from the stored physical inputs.
long vofStepParity() const
void setScene(const std::vector< int > &nodeInts, const std::vector< double > &nodeReals, const std::vector< int > &instInts, const std::vector< double > &instReals, bool periodic=false)
Install an analytic scene from core's flat node/instance encoding (peclet/core/geom/scene_builder....
void setPropertyTable(const std::string &target, const std::string &in0, const std::vector< double > &xs, const std::vector< double > &ys)
void setSolidVelocityMgAuto()
void setPressureBottomSolver(int engine)
static double vofWallPlaneSdf(int gx, int gy, int gz, I3 gs, int mask)
void configurePorousDragSolver()
void setScalarMaxIterations(const std::string &name, int maxit)
void enableVofBlocksFromColours(const std::vector< std::array< int, 6 > > &boxes, const std::vector< std::vector< double > > &colours)
double pcEffInterfaceEps() const
The colour tolerance that decides which cells are INTERFACIAL, and it has to be at least the colour a...
void buildAdvStencil(int c)
void setVofBlockDebris(bool enabled)
void setPressureTelescopeForceLevel(int level)
void requireBalancedForceScope(const char *who, bool atStep) const
bool pressurePrefactorHoist() const
void advectVofKinematic(double dtPhysArg)
dt is in the caller's time unit.
void setVofInterfaceEps(double eps)
void checkSealedInflowCells()
Reject geometry that seals fluid cells against a prescribed INFLOW face off from the rest of the doma...
void setVofWispEps(double eps)
WO-R2 item 4 — the wisp threshold on the advector's mixed-cell predicate and on the interface Courant...
bool phaseChangeBudget() const
double effectiveContactSigma() const
void setVofBlockKappaClip(bool enabled, double kappaMaxPhys=-1.0)
CCField fieldView(const std::string &name)
double vofLastCourant() const
void pushVofMetric()
Hand the anisotropic cell metric to every VoF driver that exists (Phase 3).
std::string capillaryThrowMessage(double cap) const
void setCollocatedScheme(const std::string &name)
double lastMomentumSeconds() const
void setVelocityMgChebyshev(bool on, int degree=0, double eig_ratio=10.0)
void setFreshCellSeed(bool on)
Fresh-cell policy for moving geometry.
void setPressureBottomExtent(int cells)
The set_pressure_bottom("auto") criterion: agglomerate once the coarsest GLOBAL grid exceeds this man...
bool phaseChangeQuadraticFit() const
void filterCellField(CCField f, int axis)
double closureTargetToInt(const std::string &target) const
The internal-per-physical factor of a closure TARGET: rho, mu, force_x/y/z; 0.0 for any other field (...
bool contactAngleDynamic() const
void buildAdvStencilVar(int c)
bool ensureAdvStash(int c, bool adv)
bool bcStencilPath() const
void setOutflowOperatorCoefficient(bool on)
WO-R2 item 1 ABLATION: set_outflow_operator_coefficient(False) restores the pre-WO-R2 operator,...
double vofTimingMomentumSeconds() const
void setImplicitAdvection(bool on)
double vofTimingStepSeconds() const
void setVofSolidColourZero(bool on)
void setPhaseChangeCurvatureDistance(bool on)
WO-P3g item 3: measure the GFM row's theta and the one-sided fits' sample distances to the CURVED int...
std::vector< vof::VofBox > vofBlockRankBoxes(int size) const
bool instanceCenterPinned(int i) const
double vofCurvatureWeightWidth() const
void setVelocityResidualTolerance(double rtol)
vof::SharpFaceProps makeSharpFaceProps(int c, vof::SvRole role)
void setPhaseChangeEnergyOrder(int order)
WO-P3g — the SECOND-ORDER interfacial energy operator, as one package.
long numPressureChebyshevGrowthTrips() const
SharpViscousState sharpViscousState() const
std::function< double()> stencilResidual(int c, bool exchange=false)
bool mixedVelocityMg() const
void setPressureBottomMode(int mode)
void requirePhaseChange(const char *who) const
int phaseChangeEnergyOrder() const
void phaseDensityRange(double &lo, double &hi)
void setMassFlux(const std::vector< double > &v)
Prescribe a per-cell mass flux (P0), x-fastest over the inner region; units and call-order rule as se...
sco::MaterialTable scalarMaterialTable(ScalarField &sc, std::vector< char > &conj)
VarFaceProps makeFaceProps(int c)
void setPhaseChangeEnergy(double rcpGas, double rcpLiquid)
Turn on the CONSISTENT energy transport (VOF_PLAN §9 item 6) for the scalar set_phase_change_thermal ...
void setRotationalWallWeight(double w0)
long numPressureUnconvergedSolves() const
void vofBcPropGhosts(CCField f)
WO-R item 5 — the Neumann property policy at an inflow face.
void vofFillGhosts(CCField f)
bool pressureTelescope() const
void addCsfRhsCellInterp(int c, CCField dst, bool rowScaled, bool faceRange=false)
void setBalancedForceProjection(bool enabled)
const vof::WyAdvector & vofAdvector() const
double reduceMaxAbsInner(CCConst f)
void setPorousContinuity(bool on)
void setRho(double r)
Fluid density, in the caller's units.
double phaseChangeCarryLost() const
vof::WyAdvector::Diagnostics vofDiagnostics()
bool vofAxisPeriodic(int a) const
void patchScalarDirichletFace(CCField AC, CCField band, double Din, int a, int side)
void setVofCflLimit(double v)
void invalidateScalarCutGeometry()
void scalarDirichletMask(const std::string &name)
Allocate (idempotently) the per-cell Dirichlet mask + value of a registered scalar.
VofStepLimits vofStepLimits()
Both limits at the current state, in the CALLER's time unit (courant is dimensionless).
void setRotationalFilter(bool on, double eps=0.05)
void buildRhsForced(int c)
bool velocityMultigridActive() const
bool phaseChangeCurvatureDistance() const
std::array< double, 3 > domainExtent() const
Physical extent of the GLOBAL inner grid (cell counts without a physical domain).
std::vector< std::string > fieldNames() const
std::vector< double > gatherInner(CCField fld)
void setSuperficialVelocity(bool on, int axis, double velocity)
Hold the SUPERFICIAL velocity along a periodic axis: at the end of every step() one uniform shift is ...
double vofWispEps() const
bool vofSolidColourZero() const
bool phaseChangePlaneDirichlet() const
bool vofCurvatureWorklist() const
double vofBlockImbalance() const
std::vector< double > cellCentres(int axis) const
Physical cell-centre coordinates of THIS rank's inner block along axis (nx/ny/nz values).
void copyBlockShifted(CCField dst, C3 de, CCConst src, C3 se, int off)
int vofWetWallMask() const
bool phaseChangeCarryConserve() const
void buildBalancedFaceForce(int c)
void pcRefreshUnits()
Re-derive the INTERNAL phase-change constants (pcRhoG_ ... pcRcpL_) from the caller's physical ones (...
int decompositionLevels() const
std::vector< vof::VofBlockStats > vofBlockStats() const
CCConst wallVelView(int c) const
void fillPorousEpsGhosts()
void advectVofBlocks(double dtPhysArg, bool requireSolenoidal=true)
dt is in the caller's time unit.
void setContactAngle(double thetaDeg)
void setVofFluxClamp(bool on)
void setPhaseChangeBudget(bool on)
WO-P3f: turn the ENERGY BUDGET instrument on.
PhaseChangeBudget phaseChangeBudgetValues() const
The budget, physical: energies and powers with the consistent transport on, temperature x volume (and...
bool vofCurvatureMixedHeightFit() const
void setDivergenceSource(const std::vector< double > &v)
A PRESCRIBED extra divergence source (1/time, physical; set_dt must precede it under an extent,...
double contactAngleSlip() const
std::vector< double > hydroForceTorqueReaction()
Hydrodynamic force and torque per instance from the DISCRETE REACTION (route (b) of the design note's...
double vofCflLimit() const
bool outflowOperatorCoefficient() const
void setPressureFcg(bool on, int maxit, double rtol)
std::vector< double > getPressure()
const vof::VofBlockSet * vofBlockSet() const
The block container itself, read-only (tests: the metric and tunables its cascades carry).
void setMultigridAspectThreshold(double theta)
The anisotropic-coarsening aspect threshold theta shared by the pressure and velocity multigrids (doc...
void setOuterIterations(int iters)
void setPhaseChangeDepositFallback(bool on)
WO-P3f open item 6 / WO-P3g — the divergence source's 5^3 fallback target, as a setter (it was only r...
bool isCutcellScalar(const std::string &name) const
void setPhaseChangeArea(int mode)
WO-P3c — which geometry the interfacial AREA comes from.
bool colocatedFaceForce() const
bool hasPhysicalDomain() const
void projectCorrectVelocities()
The container: a replicated table of blocks, the per-step orchestration (gather → advect → re-centre ...
Weymouth-Yue split advection of a colour field on an extended (inner + ghost) block.
flow — collocated (ABC approximate-projection) variable-density kernels: the mass-adjoint pair of run...
flow — VoF rung V-BC (WO-R): the colour field's OPEN-BOUNDARY ghost rules and the out-of-domain mask ...
flow — VoF rung V2a (WO-J): the bridge between the solver's G = 2 block and the colour field's own g ...
flow — VoF rung V3 (WO-O): the view-level driver for the curvature cascade.
flow — VoF Part II (WO-P23): CONSISTENT rho c_p T transport, driven by the SAME geometric fluxes as t...
flow — face/cell material-property accessors for the variable-coefficient momentum operator.
flow — IbmSolver domain boundary conditions: setDomainBc/profiles, pressureBcGhost,...
flow — IbmSolver property closures: property/density modes, porous continuity, drag,...
flow — IbmSolver core: allocation, physical-domain scales, rho/mu/dt and pressure/velocity driver set...
flow — IbmSolver diagnostics: state getters, divergence probes, timers and the outflow/backflow censu...
flow — IbmSolver static solid geometry: setSolid / setSolidDevice and its stages, pressure geometry.
flow — IbmSolver hydrodynamic force and torque: the reaction-budget terms and wall probes.
flow — IbmSolver MPI: initMpi, redistribute, rebalanceByWeights and the post-repartition field-resize...
flow — IbmSolver phase change: interface area, mass flux, energy transport, budget accounting,...
flow — IbmSolver pressure projection: step(), the project() stages, the buildRhs family,...
flow — IbmSolver transported scalars: addScalar/setScalarBc/advanceScalars and their BC application.
flow — IbmSolver cut-cell scalar transport (doc/scalar_ibm_design.md): the geometry record of WO-2 — ...
flow — IbmSolver scene and moving geometry: scene instances and motion upload, wall velocity,...
flow — IbmSolver Volume-of-Fluid: the colour field, cut-cell VoF geometry, contact angle,...
flow — the transpose half of the full deviatoric viscous stress on the staggered grid.
flow — the gauge-exact directional cell-centre pressure gradient.
flow — OPT-IN forensics for the ghost-projection overlay (PECLET_FLOW_GP_DEBUG).
flow — GridLayout policy traits (placement of the velocity unknowns).
flow — WO-P3c: the view-level driver of the cascade-consistent interfacial area.
flow — collocated approximate (MAC) projection helpers (Almgren–Bell–Colella style).
flow — Chebyshev semi-iteration as a standalone momentum (implicit-diffusion) solver,...
flow — portable (Kokkos) geometric multigrid for the cut-cell (variable-openness) pressure Poisson.
flow — portable (Kokkos) IBM geometric fields + variable-coefficient RB-GS smoother.
flow — portable (Kokkos) cut-cell pressure operator + Chorin projection.
flow — portable (Kokkos) MAC stencil operators: Red-Black Gauss-Seidel smoothers + divergence.
flow — portable (Kokkos) velocity (momentum) multigrid for the IBM diffusion solve: the STAIRCASE coa...
flow — WO-P3d: the block driver of the marching-tetrahedra interfacial area.
flow — VoF rung V2b (WO-K): momentum-consistent transport of rho^c u_c on the half-shifted (MAC) mome...
Kokkos::View< unsigned char *, SMem > UCField
Kokkos::View< std::uint8_t *, CCMem > SvByte
Per-cell byte fields on the solver block: the band class and the fit-fallback flag.
Kokkos::View< long *, CCMem > SvList
The compacted interfacial cells of a fit (local linear indices), the device fit's worklist.
@ kAreaMcPlic
the PLIC signed-distance level set, centroid deposit
SvRole
Which half of the time split a SharpFaceProps feeds (§6.1, WO-5b): the implicit band (ibmBuildDiffusi...
Kokkos::View< double *, SMem > SField
GpOverlayReal< mreal > GpOverlayMReal
Kokkos::View< const double *, CCMem > CCConst
Kokkos::View< double *, CCMem > CCField
IbmOverlayT< IMem, mreal > IbmOverlay
Kokkos::View< std::uint8_t *, CCMem > RegMask
Per-component regular-node mask (§5.4): 1 = a velocity node with neither a solid nor a cut row.
Solver< Staggered > IbmSolver
flow — VoF phase change (Part II, rungs P0/P1): the container-free kernel set.
flow — the multidimensional iteration policies: iteration order follows storage.
flow — device property closures: material properties / body forces as functions of fields.
flow — cell-centred scalar transport (advection–diffusion) on the cut-cell grid.
flow — the sharp conservative viscous stress at a VoF interface on the staggered MAC grid: band geome...
flow — portable (Kokkos) staggered MAC momentum advection (Koren TVD + FOU).
std::vector< peclet::core::solver::AndersonRole > roles
std::array< double, 9 > signature
std::vector< CCField > fields
OUTFLOW REVERSAL CENSUS – the regime in which the zero-gradient (do-nothing) outflow is only conditio...
WO-P3f — the ENERGY BUDGET of the phase-change energy solve.
long nLeaveGas
interfacial -> gas (the bubble swallowing a cell)
double hMasked
the same over MASKED (interfacial) cells
double hOpenNew
the same, after the solve
double qGfm
heat INTO the unmasked set across the plane-anchored rows (W)
double dEoverwrite
sum rcp (dval - T) over masked cells: what the Dirichlet rows inject when they overwrite the transpor...
long nEnterLiquid
liquid -> interfacial transitions this step
double qBehind
WO-P3g: the second-order row's one-sided rescaling of the band BEHIND each interfacial face,...
long calls
how many energy solves have been instrumented
double eLeave
... and of the cells that LEFT it (carrying pcCarriedValue)
double dEoverwriteNew
the part of it on cells that were NOT masked last step
long nEnterGas
gas -> interfacial
double eEnter
sum rcp (T - T_sat) of the cells that JOINED the masked set
double hLiquid
sum rcp (T - T_sat) over PURE LIQUID cells, before the solve
long nMasked
size of the masked set
double hOpen
sum rcp (T - T_sat) over UNMASKED cells, before the solve
long nLeaveLiquid
interfacial -> liquid
long sourceCells
cells that RECEIVED a deposit
long deficitCells
cells that clipped at C = 0
double bandDiv
max |div(open u)| over interfacial cells (WO-P23; see pcBandDivergence)
double redistributed
|clip deficit| pushed into neighbours this step
long areaNone
WO-P3c: cells with NO cascade geometry (kept their MYC PLIC area).
double qOperator
WO-P3g: the heat (W) the operator's Dirichlet rows draw across the interface, i.e.
double mdotFit
WO-P3g: the AREA-WEIGHTED one-sided-fit mdot, kept as the diagnostic that item 1 replaced (0 unless t...
double areaOrphan
WO-P3d: area the JOINED sheet booked to cells that are not interfacial, i.e.
long areaPv
WO-P3c: cells whose area came from the PV paraboloid (tier 3).
long fallbackCells
interfacial cells whose +n walk found no pure gas cell
long areaHf
WO-P3c: cells whose area came from a height function (tiers 1/2a).
double sourceSum
sum of the deposited divergence source over inner cells (1/s)
double area
sum of the PLIC polygon areas over interfacial cells (h^2)
double removedVolume
sum of dV actually subtracted this step (+ = evaporated)
double Tmax
energy-scalar extrema (consistent transport only)
double unresolved
clip residue no neighbour could absorb (pushed anyway)
double qOrphan
... the part of it on interfacial cells with NO area, which the regression drops: the ONE non-conserv...
long excessCells
cells that clipped at C = 1
diagnostics.scalar_budget (§8.2), physical; collective under MPI.
diagnostics.scalar_facets (§8.2): this rank's facets, physical; per facet 3 values for the centroid a...
std::vector< int > instance
std::vector< double > flux
std::vector< double > normal
std::vector< double > wallValue
std::vector< double > area
std::vector< double > centroid
The ONE predicate for the cut-cell scalar's advective face flux (doc/scalar_ibm_design....
CCField vel
face-normal index velocity at the low a-face of cell i (internal)
CCField open
the projection's openness of that face
The map between the solver's INDEX coordinates and the coordinate system the analytic scene is writte...
double a[3]
scene_a = a[a] + b[a]*xi_a (xi = global index)
double velToInt[3]
scene velocity -> index velocity
double dToInt
scene signed distance -> index distance (1/hRef)
double angToInt
scene angular velocity -> index (omega*tRef)
double w[3]
w_a = 1 / h_a'^2 (<= 1)
double org[3]
physical lower corner of the GLOBAL inner grid
double areaToPhys() const
double powerToPhys() const
double angVelToInt() const
double rhoRef
reference density = the first set_rho
double forceToInt(int a) const
double speedToInt() const
vof::VofMetric vofMetric() const
bool physical
an extent was given (the scales are armed)
double timeToPhys() const
double h[3]
cell size per axis = extent / cells
double hp[3]
h_a' = h_a / hRef (>= 1, exactly 1 on the finest axis)
double sigmaToInt() const
double resistToInt() const
double forceTotalToPhys() const
double velToPhys(int a) const
double torqueToPhys() const
double vol
V' = h_x' h_y' h_z' (cell volume in hRef^3).
long cells[3]
the GLOBAL cell counts the extent spans
bool aniso
some h_a' != 1 — kernels dispatch the per-axis body
double energyToPhys() const
An internal energy (rho c_p T summed over cells of volume hRef^3) to joules: the internal energy unit...
double tRef
reference time = the first set_dt
double curvToPhys() const
double hRef
reference length = min_a h_a (== h_a, Phase 1)
double ext[3]
physical extent of the GLOBAL inner grid
double mdotToPhys() const
double velToInt(int a) const
double latentToInt() const
long cells
cells with S > 1 + 1e-8 (global)
bool active
the phantom-aware capillary bound is in force
double maxSum
max_cells S (global)
double excess
sum over cells of (S - 1)^+ (global, cell volumes)
double courant
the interface-local Courant number at the current dt
double cflDt
the largest dt the WY boundedness cap admits
double capillaryDt
the largest dt the Brackbill capillary constraint admits
double binding
min(cflDt, capillaryCfl * capillaryDt)
double bridge
... of which: the G=2 <-> g=3 bridges + the C ghost policy
double curvature
the V3 height-function cascade + the capillary dt check
double momBridge
... of which: its bridges
double blockAdvect
the block-container colour stage as a whole (advectVofBlocks)
double csf
the V4 balanced-force CSF added to the three momentum RHSs
double momAdvect
the momentum-consistent colour+rho^c u stage (advectVofMomentum)
double blockDebris
... of which: the debris/residue pass (§5.3/§13 of the note)
double phaseChange
the Part II phase-change stage (mdot, deposit, regression)
One entry per eliminated solid-centered cell: packed INNER flat index + the apertures of its (up to 6...
The geometry part of diagnostics.scalar_census (§8.2).
The whole record: per-cell fields on the extended block (kappa and unknown haloed; the apertures comp...
The per-body material of a conjugate scalar, internal units (§4.2): conj 1 on a conjugate body; lam =...
G.x at the centre of extended-block cell j (physical; cellCentres' formula, unwrapped).
The census of the band (§9, G-SV10) over [lo, hi), LOCAL to this block: interfacial cells,...
The face viscosity under the sharp interface (§5.4 a, §6): a band edge across a (a ≠ c) takes μ̄_c,...
The band geometry and the closure constants, by value into every kernel.
Per-call census of the cascade over this block's inner region (LOCAL; a distributed caller sums them ...
Per-call census over the inner region (LOCAL; a distributed caller sums it).
flow — VoF rung V4 (WO-P): balanced-force continuum surface force + the capillary Δt.
static double val(long gi)
static constexpr double AC
static double value(int gx, int gy, int gz)
flow — VoF rung V6 (WO-V6): the DYNAMIC contact angle (Cox-Voinov with an explicit slip length) and a...