svMultiPhysics
Loading...
Searching...
No Matches
CoupledBoundaryCondition.h
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the University of California, and others.
2// SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef COUPLED_BOUNDARY_CONDITION_H
5#define COUPLED_BOUNDARY_CONDITION_H
6
7#include <string>
8#include <memory>
9#include <exception>
10#include <optional>
11#include <unordered_map>
12#include <utility>
13#include "consts.h"
14#include "CmMod.h"
15#include "SolutionStates.h"
16
17// Forward declarations to avoid heavy includes
19class faceType;
20class ComMod;
21
22namespace fsi_linear_solver {
23 class FSILS_faceType;
24}
25
26/// @brief Cap-surface nodal state: \c n_cap columns, column \c a is cap node \c a (same order as cap face \c gN / broadcast id list).
28 int n_cap = 0;
29 Array<double> x;
30 Array<double> Do;
31 Array<double> Dn;
32 Array<double> Yo;
33 Array<double> Yn;
34
35 void clear()
36 {
37 n_cap = 0;
38 x.resize(0, 0);
39 Do.resize(0, 0);
40 Dn.resize(0, 0);
41 Yo.resize(0, 0);
42 Yn.resize(0, 0);
43 }
44};
45
46/// @brief Base exception for capping surface (cap VTP) errors.
47///
48/// These indicate fatal errors while loading or using a cap surface. They are not
49/// expected to be recovered; callers may catch \ref CappingSurfaceBaseException to
50/// handle all cap-related failures.
51class CappingSurfaceBaseException : public std::exception {
52public:
53 explicit CappingSurfaceBaseException(std::string msg) : message_(std::move(msg)) {}
54
55 const char* what() const noexcept override { return message_.c_str(); }
56
57private:
58 std::string message_;
59};
60
61/// @brief Cap VTP file cannot be opened.
63public:
64 explicit CappingSurfaceFileException(const std::string& path)
65 : CappingSurfaceBaseException("[CappingSurface::load_from_vtp] Cannot open cap VTP file '" + path +
66 "' for reading.") {}
67};
68
69/// @brief VTP read, parse, or validation error during cap load.
71public:
72 explicit CappingSurfaceVtpException(const std::string& detail)
73 : CappingSurfaceBaseException("[CappingSurface::load_from_vtp] " + detail) {}
74};
75
76/// @brief Cap mesh shares no nodes with the coupled boundary face.
78public:
79 explicit CappingSurfaceCouplingTopologyException(const std::string& vtp_path, const std::string& coupled_face_name)
80 : CappingSurfaceBaseException("[CappingSurface::load_from_vtp] Cap VTP file '" + vtp_path +
81 "' has no GlobalNodeID entries in common with coupled face '" +
82 coupled_face_name + "'. The cap must share at least one mesh node with that face.") {}
83};
84
85/// @brief Cap VTP uses an unsupported cell type (only TRI3 is supported).
87public:
88 explicit CappingSurfaceUnsupportedCellException(int vtk_cell_type)
89 : CappingSurfaceBaseException("[CappingSurface::load_from_vtp] Unsupported cap cell type " +
90 std::to_string(vtk_cell_type) + ". Only VTK_TRIANGLE (TRI3) is supported.") {}
91};
92
93/// @brief Cap VTP connectivity does not match expected TRI3 topology.
95public:
96 explicit CappingSurfaceInvalidElementNodesException(int eNoN, int expected)
97 : CappingSurfaceBaseException("[CappingSurface::load_from_vtp] Invalid nodes-per-element for triangle cap: " +
98 std::to_string(eNoN) + " (expected " + std::to_string(expected) + ").") {}
99};
100
101/// @brief Cap face quadrature (shape functions on TRI3) setup failed.
103public:
104 explicit CappingSurfaceQuadratureException(const std::string& nested)
105 : CappingSurfaceBaseException("[CappingSurface::init_cap_face_quadrature] Failed to initialize cap face shape "
106 "functions: " + nested) {}
107};
108
109/// @brief Capping surface geometry and integration for a coupled boundary.
111 public:
112 /// @brief Default constructor.
113 CappingSurface() = default;
114 /// @brief Copy constructor.
115 CappingSurface(const CappingSurface& other);
116 /// @brief Copy assignment operator.
118 /// @brief Move constructor.
119 CappingSurface(CappingSurface&& other) noexcept = default;
120 /// @brief Move assignment operator.
121 CappingSurface& operator=(CappingSurface&& other) noexcept = default;
122
123 /// @brief Load the cap face from a VTP file.
124 void load_from_vtp(const std::string& vtp_file_path, const faceType& coupled_face,
125 const std::string& coupled_face_name);
126
127 /// @brief Initialize the cap face quadrature.
128 void init_cap_face_quadrature(const ComMod& com_mod);
129
130 /// @brief Initialize the cap contribution storage.
131 void initialize_valM();
132
133 /// Surface velocity flux through the cap using \a st columns indexed by cap IEN / GlobalNodeID (master / serial).
134 double integrate_velocity_flux(const CapGlobalMeshState& st, bool use_Yn_velocity,
135 consts::MechanicalConfigurationType cfg);
136
137 /// @brief Compute the cap contribution to the linear solver face (fills \ref valM_; safe under \c const *this).
138 void compute_valM(consts::MechanicalConfigurationType cfg, const CapGlobalMeshState& st) const;
139
140 /// @brief Get the cap face.
141 faceType* face() { return face_.get(); }
142 const faceType* face() const { return face_.get(); }
143
144 /// @brief Get the cap contribution.
145 const Array<double>& valM() const { return valM_; }
146
147 private:
148 /// @brief The cap face.
149 std::unique_ptr<faceType> face_;
150 /// @brief The global node IDs.
151 Vector<int> global_node_ids_;
152 /// @brief The normals.
153 Array<double> normals_;
154
155 /// @brief The number of spatial dimensions (3D).
156 static constexpr int cap_nsd_ = 3;
157 /// @brief The number of independent spatial dimensions (2D).
158 static constexpr int cap_insd_ = 2;
159
160 /// @brief Update the element position using cap-compact mesh columns (\a gn_to_cap_local maps global node id to column).
161 Array<double> update_element_position_global(int e, consts::MechanicalConfigurationType cfg,
162 const Array<double>& mesh_x, const Array<double>& mesh_Do,
163 const Array<double>& mesh_Dn,
164 const std::unordered_map<int, int>& gn_to_cap_local) const;
165
166 /// @brief Compute the Jacobian and normal vector for a given element and Gauss point.
167 std::pair<double, Vector<double>> compute_jacobian_and_normal(const Array<double>& xl, int e, int g) const;
168
169 /// @brief Cap contribution to the linear solver face; \c mutable so it can be refreshed under \c const *this.
170 mutable Array<double> valM_;
171 };
172
173/// @brief Object-oriented Coupled boundary condition
174///
175/// This class provides an interface for:
176/// - computing flowrates on the face for coupling, and
177/// - getting/setting pressure values from/to a 0D solver, and
178/// - (optionally) loading a cap face VTP for struct/ustruct coupling.
179///
180/// The class manages its own coupling data. svZeroD interface code accesses
181/// coupled boundary conditions by iterating through com_mod.eq[].bc[].
183private:
184 /// @brief Data members for BC
185 const faceType* face_ = nullptr; ///< Face associated with the BC (not owned by CoupledBoundaryCondition)
186 std::string cap_face_vtp_file_; ///< Path to VTP file (empty if no cap)
187
188 /// @brief 3D boundary condition type (Dirichlet or Neumann) for this Coupled BC.
189 consts::BoundaryConditionType bc_type_ = consts::BoundaryConditionType::bType_Neu;
190
191 /// @brief svZeroD coupling data
192 std::string block_name_; ///< Block name in svZeroDSolver configuration
193 std::string face_name_; ///< Face name from the mesh
194
195 /// @brief Flowrate data
196 double Qo_ = 0.0; ///< Flowrate at old timestep (t_n)
197 double Qn_ = 0.0; ///< Flowrate at new timestep (t_{n+1})
198
199 /// @brief Pressure data
200 double Po_ = 0.0; ///< Pressure at old timestep (for completeness)
201 double Pn_ = 0.0; ///< Pressure at new timestep (for completeness)
202 double pressure_ = 0.0; ///< Current pressure value from 0D solver (result)
203
204 /// @brief svZeroD solution IDs
205 int flow_sol_id_ = -1; ///< ID in svZeroD solution vector for flow
206 int pressure_sol_id_ = -1; ///< ID in svZeroD solution vector for pressure
207 double in_out_sign_ = 1.0; ///< Sign for inlet/outlet (+1 inlet to 0D model, -1 outlet)
208
209 /// @brief Configuration for flowrate computation
210 bool follower_pressure_load_ = false; ///< Whether to use follower pressure load (for struct/ustruct)
211 consts::EquationType phys_ = consts::EquationType::phys_NA; ///< Equation physics for this coupled BC (set at construction)
212 consts::MechanicalConfigurationType flowrate_cfg_o_ = consts::MechanicalConfigurationType::reference;
213 consts::MechanicalConfigurationType flowrate_cfg_n_ = consts::MechanicalConfigurationType::reference;
214
215 /// @brief True if this BC uses a chamber cap (broadcast in distribute so all ranks agree).
216 bool has_cap_ = false;
217 /// @brief True on ranks that hold \ref cap_ mesh/quadrature (MPI master when \ref has_cap_; true in serial when cap loaded).
218 bool owns_cap_ = false;
219 /// @brief Number of cap surface nodes (same as \ref cap_mesh_global_node_ids_.size(); broadcast in \c distribute()).
220 int cap_n_no_ = 0;
221 /// @brief Global mesh node id per cap surface node column (0-based solver ids; broadcast in \c distribute()).
222 Vector<int> cap_mesh_global_node_ids_;
223 /// @brief Cached map: global cap node id -> cap column index (derived from \ref cap_mesh_global_node_ids_).
224 std::unordered_map<int, int> cap_g_to_cap_col_;
225 /// @brief Cap geometry on ranks with \ref owns_cap_; empty on non-owning MPI ranks.
226 std::optional<CappingSurface> cap_;
227 /// @brief Cap-only mesh state for integration (columns 0..n_cap-1); refreshed by \ref gather_global_mesh_state.
228 mutable CapGlobalMeshState cap_global_mesh_state_;
229
230 /// @brief Simulation \c CmMod copy; set in \c distribute() for cap MPI (e.g. \c copy_cap_surface_to_linear_solver_face).
231 CmMod cm_mod_{};
232
233 /// Build \ref cap_g_to_cap_col_ from \ref cap_mesh_global_node_ids_.
234 void rebuild_cap_global_to_col_map();
235
236 /// Fill \ref cap_global_mesh_state_ with cap nodes only (uses \ref cap_mesh_global_node_ids_).
237 void gather_global_mesh_state(ComMod& com_mod, const CmMod& cm_mod, const SolutionStates& solutions, bool gather_Y) const;
238
239
240public:
241 /// @brief Default constructor - creates an uninitialized object
243
244 /// @brief Destructor
246
247 /// @brief Copy constructor
249
250 /// @brief Copy assignment operator
252
253 /// @brief Move constructor
255
256 /// @brief Move assignment operator
258
259 /// @brief Construct with a face association (no VTP data loaded)
260 /// @param bc_type The 3D boundary condition type (must be bType_Dir or bType_Neu)
261 /// @param face Face associated with this BC
262 /// @param face_name Face name from the mesh
263 /// @param block_name Block name in svZeroDSolver configuration
264 /// @param phys Equation physics for this boundary (struct, fluid, FSI, etc.)
265 /// @param follower_pressure_load Follower pressure load flag (struct/ustruct); false for fluid-like physics
266 CoupledBoundaryCondition(consts::BoundaryConditionType bc_type, const faceType& face, const std::string& face_name,
267 const std::string& block_name, consts::EquationType phys, bool follower_pressure_load);
268
269 /// @brief Construct and optionally point to a cap face VTP file
270 /// @param bc_type The 3D boundary condition type (must be bType_Dir or bType_Neu)
271 /// @param face Face associated with this BC
272 /// @param face_name Face name from the mesh
273 /// @param block_name Block name in svZeroDSolver configuration
274 /// @param cap_face_vtp_file Path to the cap face VTP file
275 /// @param phys Equation physics for this boundary (struct, fluid, FSI, etc.)
276 /// @param follower_pressure_load Follower pressure load flag (struct/ustruct); false for fluid-like physics
277 CoupledBoundaryCondition(consts::BoundaryConditionType bc_type, const faceType& face, const std::string& face_name,
278 const std::string& block_name, const std::string& cap_face_vtp_file,
279 consts::EquationType phys, bool follower_pressure_load);
280
281 /// @brief Get the 3D BC type for this Coupled boundary condition.
282 consts::BoundaryConditionType get_bc_type() const { return bc_type_; }
283
284 // =========================================================================
285 // svZeroD block configuration
286 // =========================================================================
287
288 /// @brief Get the svZeroD block name
289 /// @return Block name
290 const std::string& get_block_name() const;
291
292 /// @brief Set the svZeroD solution IDs for flow and pressure
293 /// @param flow_id Flow solution ID
294 /// @param pressure_id Pressure solution ID
295 /// @param in_out_sign Sign for inlet/outlet
296 void set_solution_ids(int flow_id, int pressure_id, double in_out_sign);
297
298 /// @brief Get the flow solution ID
299 int get_flow_sol_id() const;
300
301 /// @brief Get the pressure solution ID
302 int get_pressure_sol_id() const;
303
304 /// @brief Get the inlet/outlet sign
305 double get_in_out_sign() const;
306
307 // =========================================================================
308 // Flowrate computation and access
309 // =========================================================================
310
311 /// @brief Set follower load flag and mechanical configs used for flowrate integration (also run from the face constructors).
312 void set_flowrate_mechanical_configurations(consts::EquationType phys, bool follower_pressure_load);
313
314 /// @brief Compute flowrates at the boundary face at old and new timesteps
315 /// @param com_mod ComMod reference containing simulation data
316 /// @param cm_mod CmMod reference for communication
317 void compute_flowrates(ComMod& com_mod, const CmMod& cm_mod, const SolutionStates& solutions);
318
319 /// @brief Initialize cap quadrature on the master (call from \c baf_ini after partition).
320 void initialize_cap(ComMod& com_mod);
321
322 /// @brief Compute cap \a valM from current cap mesh state on owner and copy/broadcast cap data to FSILS face.
323 void copy_cap_surface_to_linear_solver_face(ComMod& com_mod, fsi_linear_solver::FSILS_faceType& lhs_face,
324 consts::MechanicalConfigurationType cfg,
325 const SolutionStates& solutions) const;
326
327 /// @brief Extra volumetric flux through the cap (old/new timestep); {0,0} if no cap; MPI-safe on all ranks.
328 std::pair<double, double> calculate_cap_contribution(ComMod& com_mod, const CmMod& cm_mod,
329 const SolutionStates& solutions,
330 consts::MechanicalConfigurationType cfg_o,
331 consts::MechanicalConfigurationType cfg_n);
332
333 /// @brief Compute average pressures at the boundary face at old and new timesteps (for Dirichlet BCs)
334 /// @param com_mod ComMod reference containing simulation data
335 /// @param cm_mod CmMod reference for communication
336 void compute_pressures(ComMod& com_mod, const CmMod& cm_mod, const SolutionStates& solutions);
337
338 /// @brief Get the flowrate at old timestep
339 /// @return Flowrate at t_n
340 double get_Qo() const;
341
342 /// @brief Get the flowrate at new timestep
343 /// @return Flowrate at t_{n+1}
344 double get_Qn() const;
345
346 /// @brief Set the flowrates directly
347 /// @param Qo Flowrate at old timestep
348 /// @param Qn Flowrate at new timestep
349 void set_flowrates(double Qo, double Qn);
350
351 /// @brief Perturb the new timestep flowrate by a given amount
352 /// @param diff Perturbation to add to Qn
353 void perturb_flowrate(double diff);
354
355 // =========================================================================
356 // Pressure access (result from 0D solver)
357 // =========================================================================
358
359 /// @brief Set the pressure value from 0D solver
360 /// @param pressure Pressure value to be applied as Neumann BC
361 void set_pressure(double pressure);
362
363 /// @brief Get the current pressure value
364 /// @return Current pressure value from 0D solver
365 double get_pressure() const;
366
367 /// @brief Get the pressure at old timestep
368 /// @return Pressure at t_n
369 double get_Po() const;
370
371 /// @brief Get the pressure at new timestep
372 /// @return Pressure at t_{n+1}
373 double get_Pn() const;
374
375 // =========================================================================
376 // State management for derivative computation
377 // =========================================================================
378
379 /// @brief State struct for saving/restoring Qn and pressure
380 struct State {
381 double Qn = 0.0;
382 double pressure = 0.0;
383 };
384
385 /// @brief Save current state (Qn and pressure)
386 /// @return Current state
387 State save_state() const;
388
389 /// @brief Restore state from a saved state
390 /// @param state State to restore
391 void restore_state(const State& state);
392
393 // =========================================================================
394 // Utility methods
395 // =========================================================================
396
397 /// @brief Distribute BC metadata from master to slave processes
398 /// @param com_mod Reference to ComMod object
399 /// @param cm_mod Reference to CmMod object for MPI communication
400 /// @param cm Reference to cmType object for MPI communication
401 /// @param face Face associated with the BC (after distribution)
402 void distribute(const ComMod& com_mod, const CmMod& cm_mod, const cmType& cm, const faceType& face);
403
404 /// @brief Load the cap face VTP file and associate it with this boundary condition
405 /// @param vtp_file_path Path to the cap face VTP file
406 void load_cap_face_vtp(const std::string& vtp_file_path);
407
408 /// @brief Check if this BC has a cap (broadcast in distribute so all ranks agree).
409 bool has_cap() const { return has_cap_; }
410
411 /// @brief True if this rank stores the cap mesh / quadrature in \ref cap_.
412 bool owns_cap() const { return owns_cap_; }
413
414 /// @brief Master reads Neumann pressure, one scalar \c MPI_Bcast, all ranks set pressure (svZeroD sync).
415 void bcast_coupled_neumann_pressure(const CmMod& cm_mod, cmType& cm);
416
417};
418
419#endif // COUPLED_BOUNDARY_CONDITION_H
Base exception for capping surface (cap VTP) errors.
Definition CoupledBoundaryCondition.h:51
Cap mesh shares no nodes with the coupled boundary face.
Definition CoupledBoundaryCondition.h:77
Cap VTP file cannot be opened.
Definition CoupledBoundaryCondition.h:62
Capping surface geometry and integration for a coupled boundary.
Definition CoupledBoundaryCondition.h:110
void compute_valM(consts::MechanicalConfigurationType cfg, const CapGlobalMeshState &st) const
Compute the cap contribution to the linear solver face (fills valM_; safe under const *this).
Definition CoupledBoundaryCondition.cpp:1159
void load_from_vtp(const std::string &vtp_file_path, const faceType &coupled_face, const std::string &coupled_face_name)
Load the cap face from a VTP file.
Definition CoupledBoundaryCondition.cpp:902
void initialize_valM()
Initialize the cap contribution storage.
Definition CoupledBoundaryCondition.cpp:1013
const Array< double > & valM() const
Get the cap contribution.
Definition CoupledBoundaryCondition.h:145
CappingSurface()=default
Default constructor.
CappingSurface & operator=(CappingSurface &&other) noexcept=default
Move assignment operator.
CappingSurface & operator=(const CappingSurface &other)
Copy assignment operator.
Definition CoupledBoundaryCondition.cpp:883
faceType * face()
Get the cap face.
Definition CoupledBoundaryCondition.h:141
double integrate_velocity_flux(const CapGlobalMeshState &st, bool use_Yn_velocity, consts::MechanicalConfigurationType cfg)
Surface velocity flux through the cap using st columns indexed by cap IEN / GlobalNodeID (master / se...
Definition CoupledBoundaryCondition.cpp:1124
CappingSurface(CappingSurface &&other) noexcept=default
Move constructor.
void init_cap_face_quadrature(const ComMod &com_mod)
Initialize the cap face quadrature.
Definition CoupledBoundaryCondition.cpp:982
Cap VTP connectivity does not match expected TRI3 topology.
Definition CoupledBoundaryCondition.h:94
Cap face quadrature (shape functions on TRI3) setup failed.
Definition CoupledBoundaryCondition.h:102
Cap VTP uses an unsupported cell type (only TRI3 is supported).
Definition CoupledBoundaryCondition.h:86
VTP read, parse, or validation error during cap load.
Definition CoupledBoundaryCondition.h:70
The CmMod class duplicates the data structures in the Fortran CMMOD module defined in COMU....
Definition CmMod.h:35
The ComMod class duplicates the data structures in the Fortran COMMOD module defined in MOD....
Definition ComMod.h:1563
Object-oriented Coupled boundary condition.
Definition CoupledBoundaryCondition.h:182
double get_pressure() const
Get the current pressure value.
Definition CoupledBoundaryCondition.cpp:334
void perturb_flowrate(double diff)
Perturb the new timestep flowrate by a given amount.
Definition CoupledBoundaryCondition.cpp:320
std::pair< double, double > calculate_cap_contribution(ComMod &com_mod, const CmMod &cm_mod, const SolutionStates &solutions, consts::MechanicalConfigurationType cfg_o, consts::MechanicalConfigurationType cfg_n)
Extra volumetric flux through the cap (old/new timestep); {0,0} if no cap; MPI-safe on all ranks.
Definition CoupledBoundaryCondition.cpp:717
double get_Qn() const
Get the flowrate at new timestep.
Definition CoupledBoundaryCondition.cpp:309
double get_Po() const
Get the pressure at old timestep.
Definition CoupledBoundaryCondition.cpp:339
CoupledBoundaryCondition & operator=(const CoupledBoundaryCondition &other)
Copy assignment operator.
Definition CoupledBoundaryCondition.cpp:48
bool has_cap() const
Check if this BC has a cap (broadcast in distribute so all ranks agree).
Definition CoupledBoundaryCondition.h:409
CoupledBoundaryCondition()=default
Default constructor - creates an uninitialized object.
~CoupledBoundaryCondition()=default
Destructor.
void initialize_cap(ComMod &com_mod)
Initialize cap quadrature on the master (call from baf_ini after partition).
Definition CoupledBoundaryCondition.cpp:490
void copy_cap_surface_to_linear_solver_face(ComMod &com_mod, fsi_linear_solver::FSILS_faceType &lhs_face, consts::MechanicalConfigurationType cfg, const SolutionStates &solutions) const
Compute cap valM from current cap mesh state on owner and copy/broadcast cap data to FSILS face.
Definition CoupledBoundaryCondition.cpp:1267
const std::string & get_block_name() const
Get the svZeroD block name.
Definition CoupledBoundaryCondition.cpp:206
void set_flowrates(double Qo, double Qn)
Set the flowrates directly.
Definition CoupledBoundaryCondition.cpp:314
void compute_pressures(ComMod &com_mod, const CmMod &cm_mod, const SolutionStates &solutions)
Compute average pressures at the boundary face at old and new timesteps (for Dirichlet BCs)
Definition CoupledBoundaryCondition.cpp:288
void set_pressure(double pressure)
Set the pressure value from 0D solver.
Definition CoupledBoundaryCondition.cpp:329
int get_flow_sol_id() const
Get the flow solution ID.
Definition CoupledBoundaryCondition.cpp:218
double get_in_out_sign() const
Get the inlet/outlet sign.
Definition CoupledBoundaryCondition.cpp:228
void distribute(const ComMod &com_mod, const CmMod &cm_mod, const cmType &cm, const faceType &face)
Distribute BC metadata from master to slave processes.
Definition CoupledBoundaryCondition.cpp:383
void restore_state(const State &state)
Restore state from a saved state.
Definition CoupledBoundaryCondition.cpp:358
double get_Qo() const
Get the flowrate at old timestep.
Definition CoupledBoundaryCondition.cpp:304
int get_pressure_sol_id() const
Get the pressure solution ID.
Definition CoupledBoundaryCondition.cpp:223
bool owns_cap() const
True if this rank stores the cap mesh / quadrature in cap_.
Definition CoupledBoundaryCondition.h:412
void load_cap_face_vtp(const std::string &vtp_file_path)
Load the cap face VTP file and associate it with this boundary condition.
Definition CoupledBoundaryCondition.cpp:448
void set_flowrate_mechanical_configurations(consts::EquationType phys, bool follower_pressure_load)
Set follower load flag and mechanical configs used for flowrate integration (also run from the face c...
Definition CoupledBoundaryCondition.cpp:240
void set_solution_ids(int flow_id, int pressure_id, double in_out_sign)
Set the svZeroD solution IDs for flow and pressure.
Definition CoupledBoundaryCondition.cpp:211
State save_state() const
Save current state (Qn and pressure)
Definition CoupledBoundaryCondition.cpp:353
double get_Pn() const
Get the pressure at new timestep.
Definition CoupledBoundaryCondition.cpp:344
consts::BoundaryConditionType get_bc_type() const
Get the 3D BC type for this Coupled boundary condition.
Definition CoupledBoundaryCondition.h:282
void compute_flowrates(ComMod &com_mod, const CmMod &cm_mod, const SolutionStates &solutions)
Compute flowrates at the boundary face at old and new timesteps.
Definition CoupledBoundaryCondition.cpp:262
void bcast_coupled_neumann_pressure(const CmMod &cm_mod, cmType &cm)
Master reads Neumann pressure, one scalar MPI_Bcast, all ranks set pressure (svZeroD sync).
Definition CoupledBoundaryCondition.cpp:1298
Definition LPNSolverInterface.h:18
The Vector template class is used for storing int and double data.
Definition Vector.h:24
The cmType class stores data and defines methods used for mpi communication.
Definition CmMod.h:55
The face type containing mesh at boundary.
Definition ComMod.h:524
Cap-surface nodal state: n_cap columns, column a is cap node a (same order as cap face gN / broadcast...
Definition CoupledBoundaryCondition.h:27
State struct for saving/restoring Qn and pressure.
Definition CoupledBoundaryCondition.h:380
Holds solution state at old, current, and intermediate time levels.
Definition SolutionStates.h:39