49 const Point & elem_to_face,
50 const Point & face_to_neighbor,
51 const RealVectorValue & elem_diffusion,
52 const RealVectorValue & neighbor_diffusion,
53 const RealVectorValue & elem_gradient,
54 const RealVectorValue & neighbor_gradient,
55 const RealVectorValue & elem_rho_hbya,
56 const RealVectorValue & neighbor_rho_hbya,
58 const bool use_nonorthogonal_correction,
66 const auto side_data = [&](
const Point & half_cell,
67 const RealVectorValue & diffusion,
68 const RealVectorValue & gradient,
71 Real & normal_distance,
72 Real & normal_diffusion)
74 RealVectorValue diffusion_normal;
76 diffusion_normal(i) = diffusion(i) * normal(i);
78 normal_diffusion = normal * diffusion_normal;
79 normal_distance = half_cell * normal;
80 if (!std::isfinite(normal_distance) || normal_distance <= 0.0 ||
81 !std::isfinite(normal_diffusion) || normal_diffusion <= 0.0 || face_area <= 0.0)
84 conductance = face_area * normal_diffusion / normal_distance;
86 RealVectorValue correction_vector = diffusion_normal - normal_diffusion * normal;
87 if (use_nonorthogonal_correction)
88 correction_vector += normal_diffusion * (normal - half_cell / normal_distance);
90 correction = face_area * correction_vector * gradient;
91 return std::isfinite(conductance) && conductance > 0.0 && std::isfinite(correction);
94 const bool elem_valid = side_data(elem_to_face,
101 const bool neighbor_valid = side_data(face_to_neighbor,
108 if (!elem_valid || !neighbor_valid)
PressureJumpInterfaceData pressureJumpInterfaceData(const RealVectorValue &normal, const Point &elem_to_face, const Point &face_to_neighbor, const RealVectorValue &elem_diffusion, const RealVectorValue &neighbor_diffusion, const RealVectorValue &elem_gradient, const RealVectorValue &neighbor_gradient, const RealVectorValue &elem_rho_hbya, const RealVectorValue &neighbor_rho_hbya, const Real face_area, const bool use_nonorthogonal_correction, const Real elem_jump)
Construct the conservative half-cell interface coefficients for a diagonal diffusion tensor.
Real pressureJumpOneSidedFaceValue(const PressureJumpInterfaceData &data, const Real cell_pressure, const Real mass_flux, const bool elem_side)
Recover one side's face pressure from the common oriented face mass flux.
Real pressureJumpFlux(const PressureJumpInterfaceData &data, const Real elem_pressure, const Real neighbor_pressure)
Compute the pressure part of the element-to-neighbor flux after eliminating the interface pressures.