pub struct RegionInterface {
pub mesh_a: Arc<FvMesh>,
pub patch_a: usize,
pub mesh_b: Arc<FvMesh>,
pub patch_b: usize,
pub face_map: Vec<usize>,
}Expand description
Face-to-face mapping between two mesh patches at a shared interface.
Used by chtMultiRegionFoam-style solvers where a fluid region and a
solid region share an interface. Each side has a patch (identified by
mesh + patch index); the face_map gives the paired face index on side B
for each face on side A.
For matching meshes (same layout, same face count) face_map[i] = i.
For non-matching meshes (different refinements) the map is built by
nearest-face-centre search (see from_face_centres).
Fields§
§mesh_a: Arc<FvMesh>Mesh on side A of the interface.
patch_a: usizeIndex of the coupled patch within mesh_a.patches.
mesh_b: Arc<FvMesh>Mesh on side B of the interface.
patch_b: usizeIndex of the coupled patch within mesh_b.patches.
face_map: Vec<usize>face_map[fi_a] = fi_b on the B-side patch.
Implementations§
Source§impl RegionInterface
impl RegionInterface
Sourcepub fn matching(
mesh_a: Arc<FvMesh>,
patch_a: usize,
mesh_b: Arc<FvMesh>,
patch_b: usize,
) -> Self
pub fn matching( mesh_a: Arc<FvMesh>, patch_a: usize, mesh_b: Arc<FvMesh>, patch_b: usize, ) -> Self
Construct a matching interface: face i on A is coupled to face i on B.
Panics if the two patches have different sizes.
Sourcepub fn from_face_centres(
mesh_a: Arc<FvMesh>,
patch_a: usize,
mesh_b: Arc<FvMesh>,
patch_b: usize,
) -> Self
pub fn from_face_centres( mesh_a: Arc<FvMesh>, patch_a: usize, mesh_b: Arc<FvMesh>, patch_b: usize, ) -> Self
Construct a non-matching interface via nearest-face-centre search.
For each face on patch A, the closest face centre on patch B is found
and stored in face_map. O(n_A × n_B) — acceptable for boundary
patches which are typically small.
Sourcepub fn exchange_temperature(
&self,
t_a: &VolScalarField,
t_b: &VolScalarField,
) -> (PatchField<f64>, PatchField<f64>)
pub fn exchange_temperature( &self, t_a: &VolScalarField, t_b: &VolScalarField, ) -> (PatchField<f64>, PatchField<f64>)
Exchange temperature boundary values at the interface.
Returns (bc_a_new, bc_b_new) where each is a PatchField of
FixedValue temperatures drawn from the cell-centre values of the
opposite region’s cells adjacent to the interface.
This implements the simplest coupling: Dirichlet T on each side equals
the adjacent cell T of the other side. A more accurate coupling would
use the heat-flux equality condition; that requires knowing kappa on
both sides (available from SolidThermo::kappa()).