Skip to main content

RegionInterface

Struct RegionInterface 

Source
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: usize

Index of the coupled patch within mesh_a.patches.

§mesh_b: Arc<FvMesh>

Mesh on side B of the interface.

§patch_b: usize

Index 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

Source

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.

Source

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.

Source

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()).

Trait Implementations§

Source§

impl Clone for RegionInterface

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RegionInterface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.