flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
surface_tension.hpp
Go to the documentation of this file.
1
59#ifndef PECLET_FLOW_VOF_SURFACE_TENSION_HPP
60#define PECLET_FLOW_VOF_SURFACE_TENSION_HPP
61
62#include <Kokkos_Core.hpp>
63#include <Kokkos_MathematicalConstants.hpp>
64#include <Kokkos_NumericTraits.hpp>
65
66#include "vof/curvature.hpp" // CurvatureBranch
67
68namespace peclet::flow::vof {
69
77 const int b = static_cast<int>(branch + 0.5);
78 return b >= static_cast<int>(kCurvHf) && b <= static_cast<int>(kCurvPvReduced);
79}
80
87KOKKOS_INLINE_FUNCTION bool csfFaceCurvature(double k0, double b0, double k1, double b1,
88 double& kf) {
89 const bool d0 = csfKappaDefined(b0), d1 = csfKappaDefined(b1);
90 if (d0 && d1) {
91 kf = 0.5 * (k0 + k1);
92 return true;
93 }
94 if (d0) {
95 kf = k0;
96 return true;
97 }
98 if (d1) {
99 kf = k1;
100 return true;
101 }
102 kf = 0.0;
103 return false;
104}
105
129KOKKOS_INLINE_FUNCTION double csfFaceForce(double sigma, double kf, double dC, double hGrad) {
130 return sigma * kf * dC / hGrad;
131}
132
142KOKKOS_INLINE_FUNCTION double capillaryDt(double rhoSum, double h, double sigma) {
143 if (!(sigma > 0.0))
144 return Kokkos::Experimental::infinity_v<double>;
145 return Kokkos::sqrt(rhoSum * h * h * h / (4.0 * Kokkos::numbers::pi_v<double> * sigma));
146}
147
148} // namespace peclet::flow::vof
149
150#endif // PECLET_FLOW_VOF_SURFACE_TENSION_HPP
flow — thin shim: the container-free VoF height-function / paraboloid curvature kernels (rung V3) now...
double capillaryDt(double rhoSum, double h, double sigma)
Brackbill capillary time-step limit sqrt((ρ₁+ρ₂) h³ / (4πσ)).
bool csfKappaDefined(double branch)
Is the curvature of a cell carrying branch code branch usable?
double csfFaceForce(double sigma, double kf, double dC, double hGrad)
The balanced-force CSF contribution to the momentum RHS at one staggered velocity unknown,...
bool csfFaceCurvature(double k0, double b0, double k1, double b1, double &kf)
Face curvature for the balanced-force CSF, from the two cells sharing the face.