|
| 1 | +### Coupling svZeroDSolver to svMultiPhysics |
| 2 | + |
| 3 | +svZeroDSolver can be coupled to svMultiPhysics to prescribe lumped parameter network (LPN) boundary conditions at the outlet of the 3D domain. This provides a powerful, modular multi-fidelity framework where we can implement and assign different types of boundary conditions, with many options spanning from the standard Windkessel boundary conditions to fully closed-loop circulation models. |
| 4 | + |
| 5 | +#### svMultiPhysics file format |
| 6 | + |
| 7 | +To activate the coupling from the svMultiPhysics side, add an `svZeroDSolver_interface` block inside the equation definition and mark the corresponding boundary conditions as `Coupled`. A minimal XML excerpt looks like this: |
| 8 | + |
| 9 | +```xml |
| 10 | +<Add_equation type="fluid"> |
| 11 | + ... |
| 12 | + <svZeroDSolver_interface> |
| 13 | + <Coupling_type> semi-implicit </Coupling_type> |
| 14 | + <Configuration_file> svzerod_3Dcoupling.json </Configuration_file> |
| 15 | + <Shared_library> ../../../../svZeroDSolver/build/src/interface/libsvzero_interface.dylib </Shared_library> |
| 16 | + <Initial_flows> 0.0 </Initial_flows> |
| 17 | + <Initial_pressures> 0.0 </Initial_pressures> |
| 18 | + </svZeroDSolver_interface> |
| 19 | + |
| 20 | + <Add_BC name="lumen_outlet"> |
| 21 | + <Type>Neu</Type> |
| 22 | + <Time_dependence>Coupled</Time_dependence> |
| 23 | + <svZeroDSolver_block> RCR_coupling </svZeroDSolver_block> |
| 24 | + </Add_BC> |
| 25 | +</Add_equation> |
| 26 | +``` |
| 27 | + |
| 28 | +Where: |
| 29 | +- `Configuration_file` points to the 3D-0D coupling JSON file |
| 30 | +- `Shared_library` points to the svZeroDSolver interface in your svZeroDSolver build directory. |
| 31 | +- Each `Add_BC` `svZeroDSolver_block` should correspond to one `external_solver_coupling_block` listed in the svZeroDSolver JSON, enabling the 3D face to exchange data with the matching 0D block. |
| 32 | + |
| 33 | +#### svZeroDSolver file format |
| 34 | + |
| 35 | +We only need to add one additional key to the top level structure of the svZeroDSolver json file: |
| 36 | + |
| 37 | +```python |
| 38 | +{ |
| 39 | + "simulation_parameters": {...}, |
| 40 | + "vessels": [...], |
| 41 | + "junctions": [...], |
| 42 | + "boundary_conditions": [...], |
| 43 | + "external_solver_coupling_blocks": [...] |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +The `simulation_parameters` block reuses the standard svZeroDSolver keys, but a few fields are essential for 3D–0D coupling. The most common options are listed below. |
| 48 | + |
| 49 | +| Parameter key   | Required   | Description | |
| 50 | +|----------------------|-----------------|-------------| |
| 51 | +| `coupled_simulation`   | Yes   | Must be set to `true` so the solver exchanges interface data with svMultiPhysics. | |
| 52 | +| `number_of_time_pts`   | Yes   | Number of discrete points for which the svZeroDSolver will integrate the 0D model between 3D timesteps. | |
| 53 | +| `steady_initial`   | Optional   | Starts the coupled run from a steady-state solution when `true`; set to `false` if transient start-up data are provided by svMultiPhysics. `false` is preferred in most cases | |
| 54 | + |
| 55 | +Other general svZeroDSolver <a href="/documentation/rom_simulation.html#0d-solver-user-guide-input"> simulation parameters </a> (e.g. tolerances or error controls) can also be included as needed and behave the same as in standalone 0D simulations. |
| 56 | + |
| 57 | +each `external_solver_coupling_block` will connect some block in the 0D model to a boundary of the 3D model. The structure of each `external_solver_coupling_block` is as follows: |
| 58 | + |
| 59 | +```python |
| 60 | +{ |
| 61 | + "name": "sample_block", |
| 62 | + "type": "FLOW", |
| 63 | + "location": "inlet", |
| 64 | + "connected_block": "boundary_condition_1", |
| 65 | + "periodic": false, |
| 66 | + "values": { |
| 67 | + "t": [ |
| 68 | + 0.0, |
| 69 | + 1.0 |
| 70 | + ], |
| 71 | + "Q": [ |
| 72 | + 1.0, |
| 73 | + 1.0 |
| 74 | + ] |
| 75 | + } |
| 76 | +} |
| 77 | +``` |
| 78 | +The keys inside an `external_solver_coupling_block` control how a 3D boundary exchanges data with the 0D model. |
| 79 | + |
| 80 | +| Parameter key   | Required   | Description | |
| 81 | +|----------------------|-----------------|-------------| |
| 82 | +| `name`   | Yes   | Unique identifier for the coupling block; used to label exchanged interface results. | |
| 83 | +| `type`   | Yes   | Quantity sent from the 0D solver to the 3D solver; currently `FLOW` or `PRESSURE` are supported. | |
| 84 | +| `location`   | Yes   | Boundary location **with respect to the 0D model** (`inlet`, `outlet`) that the coupling block represents. For example, an outlet BC for the 3D model would use an `inlet` coupling block. | |
| 85 | +| `connected_block`   | Yes   | `name` of the svZeroDSolver boundary condition or block that supplies the coupled data. | |
| 86 | +| `periodic`   | Optional   | Set `true` if the provided waveform should repeat when the 3D solver requests multiple cycles. | |
| 87 | +| `values`   | Yes   | Populated by the solver for data handling between 3D and 0D simulation, leave at default values {"t": [0.0, 1.0], "Q": [1.0, 1.0]} | |
0 commit comments