@@ -383,22 +383,18 @@ class GLC(BVP1D):
383383 transfer via Sieverts' law, and hydrostatic pressure variation along
384384 the column.
385385
386- The block is a thin specialisation of the native
387- :class:`~pathsim.blocks.BVP1D` block: the constructor seeds the parent with
388- the Malara right-hand side and boundary conditions, and the four block
389- inputs supply the per-evaluation boundary data. The hydrodynamic
390- correlations and dimensionless groups are computed from the current input
391- inside the collocation callbacks. As for any ``BVP1D``, the solve is
392- warm-started from the previous mesh and skipped entirely when the input is
393- unchanged.
394-
395- The block output is the dimensionless solution sampled at the two domain
396- endpoints (``xi=0`` liquid outlet, ``xi=1`` liquid inlet), in the
397- :class:`~pathsim.blocks.BVP1D` row-major layout
398- ``[x_T(0), x_T(1), x_T'(0), x_T'(1), y_T2(0), y_T2(1), y_T2'(0), y_T2'(1)]``.
399- Use :meth:`results` to post-process the current solution into dimensional
400- quantities (concentrations, extraction efficiency, molar flows, mass
401- balance).
386+ The block is a specialisation of the native :class:`~pathsim.blocks.BVP1D`
387+ block: the constructor seeds the parent with the Malara right-hand side and
388+ boundary conditions, and the four block inputs supply the per-evaluation
389+ boundary data. The hydrodynamic correlations and dimensionless groups are
390+ computed from the current input inside the collocation callbacks. As for any
391+ ``BVP1D``, the solve is warm-started from the previous mesh and skipped
392+ entirely when the input is unchanged. After each solve the dimensionless
393+ endpoint solution is post-processed into the dimensional output ports.
394+
395+ Use :meth:`results` to retrieve the full dimensional result dictionary,
396+ which additionally contains partial pressures, physical properties and the
397+ dimensionless groups.
402398
403399 Reference: https://doi.org/10.13182/FST95-A30485
404400
@@ -408,6 +404,16 @@ class GLC(BVP1D):
408404 ``y_T2_inlet`` -- T₂ mole fraction in inlet gas [-],
409405 ``flow_g`` -- gas mass flow rate [kg/s].
410406
407+ **Output ports:**
408+ ``c_T_out`` -- dissolved tritium concentration in liquid outlet [mol/m³],
409+ ``y_T2_out`` -- T₂ mole fraction in outlet gas [-],
410+ ``eff`` -- extraction efficiency [-],
411+ ``P_out`` -- total gas outlet pressure [Pa],
412+ ``Q_l`` -- liquid volumetric flow rate [m³/s],
413+ ``Q_g_out`` -- gas volumetric flow rate at outlet [m³/s],
414+ ``n_T_out_liquid`` -- tritium molar flow in liquid outlet [mol/s],
415+ ``n_T_out_gas`` -- tritium molar flow in gas outlet [mol/s].
416+
411417 Parameters
412418 ----------
413419 P_in : float
@@ -439,6 +445,16 @@ class GLC(BVP1D):
439445 "y_T2_inlet" : 2 ,
440446 "flow_g" : 3 ,
441447 }
448+ output_port_labels = {
449+ "c_T_out" : 0 ,
450+ "y_T2_out" : 1 ,
451+ "eff" : 2 ,
452+ "P_out" : 3 ,
453+ "Q_l" : 4 ,
454+ "Q_g_out" : 5 ,
455+ "n_T_out_liquid" : 6 ,
456+ "n_T_out_gas" : 7 ,
457+ }
442458
443459 def __init__ (
444460 self ,
@@ -529,6 +545,39 @@ def _bc(self, Sa, Sb, p, u):
529545 y_T2_in = max (u [2 ], 1e-20 )
530546 return _boundary_conditions (Sa , Sb , dim , y_T2_in , self .BCs )
531547
548+ def update (self , t ):
549+ """Solve the BVP and expose the dimensional results at the output ports.
550+
551+ Delegates the solve to :class:`~pathsim.blocks.BVP1D` (warm-started, and
552+ skipped when the input is unchanged), then post-processes the
553+ dimensionless endpoint solution into the eight dimensional output ports.
554+
555+ Parameters
556+ ----------
557+ t : float
558+ evaluation time
559+
560+ Raises
561+ ------
562+ RuntimeError
563+ if the BVP solve did not converge
564+ """
565+ super ().update (t )
566+ if not self .success :
567+ raise RuntimeError ("BVP solver failed to converge." )
568+
569+ res = self .results ()
570+ self .outputs .update_from_array (np .array ([
571+ res ["c_T_outlet [mol/m^3]" ],
572+ res ["y_T2_outlet_gas" ],
573+ res ["extraction_efficiency [fraction]" ],
574+ res ["total_gas_P_outlet [Pa]" ],
575+ res ["liquid_vol_flow [m^3/s]" ],
576+ res ["gas_vol_flow_outlet [m^3/s]" ],
577+ res ["tritium_out_liquid [mol/s]" ],
578+ res ["tritium_out_gas [mol/s]" ],
579+ ]))
580+
532581 def results (self ):
533582 """Post-process the current BVP solution into dimensional results.
534583
0 commit comments