1. Introduction
Thermal–hydraulic energy systems play an important role in the ongoing transformation of heating, cooling, refrigeration, and industrial process infrastructures. Heat pumps, refrigeration cycles, geothermal systems, district heating and district cooling networks, and thermal process plants are expected to provide efficient energy conversion, integrate renewable and waste-heat sources, and operate flexibly under changing boundary conditions. The International Energy Agency identifies energy efficiency, electrification, and flexibility as key system-wide themes across buildings, industry, and transport [
1]. These developments increase the need for computational methods that can represent the coupled thermal, hydraulic, and thermodynamic behavior of energy systems under varying design and operating conditions.
Steady-state thermal–hydraulic network models are a well-established tool for this purpose. In such models, energy systems are represented as interconnected networks of components and junctions, and quantities such as pressures, mass flow rates, temperatures, enthalpies, heat flows, pressure losses, pumping power, and heat losses are determined throughout the network. These quantities are essential for steady-state performance prediction, off-design analysis, component sizing, operational constraint checking, comparison of design alternatives, and support of operational decision making. The need for such models is well documented in the literature on district energy systems and thermo-fluid process systems. Thermo-hydraulic simulation models have been used to analyze district heating networks, where hydraulic flow distribution and thermal temperature fields jointly determine heat losses, pumping energy, and operational feasibility [
2]. Wang et al. investigated thermal network representations for the optimal design and operation of distributed multi-energy systems and compared optimization-oriented network models with district heating network simulation models [
3]. Fiorentini et al. emphasized a recurring trade-off in district energy optimization: detailed models may be unsuitable for numerical optimization, whereas simplified models may neglect relevant operational conditions [
4]. Similar challenges arise in refrigeration, heat-pump, and process system applications, where nonlinear component behavior, thermodynamic property evaluation, and network coupling must be represented with sufficient fidelity while maintaining computational tractability.
In their classical use, steady-state thermal–hydraulic network models are employed to solve direct problems. In a direct problem, boundary conditions, component parameters, and operating inputs are prescribed, and the corresponding thermodynamic state of the network is computed. For this class of problems, component-based, equation-oriented frameworks have become a mature and effective modeling paradigm. They assemble mass, energy, momentum, and pressure-loss relations across components and network junctions, yielding a global algebraic system that is solved for the unknown state variables. Witte et al. introduced TESPy as an open-source Python implementation of this paradigm, supporting flexible specification of boundary conditions for a wide range of thermal energy systems [
5]. Equation-based object-oriented environments such as Modelica provide standardized interfaces and component models for one-dimensional thermo-fluid networks, including vessels, pipes, pumps, valves, and fittings [
6]. Related equation-oriented concepts are also used in process systems engineering, where frameworks such as IDAES combine modular process models with algebraic modeling and nonlinear optimization capabilities for simulation and optimization tasks [
7]. As long as the problem is structurally well posed and all required boundary conditions and inputs are prescribed, direct steady-state problems can be solved in a robust and largely automated manner with existing tools and numerical methods.
In many practical applications, however, the modeling task goes beyond direct simulation. Instead of asking which network state results from prescribed inputs, engineers often need to determine which inputs, boundary conditions, or model parameters are required to achieve prescribed system-level targets. Such inverse problems arise, for example, in set-point tracking, parameter identification, calibration against measurements, and operation under target constraints. Examples include determining the compressor speed and expansion valve opening required to reach a desired cooling load and superheat, identifying heat transfer or pressure-loss parameters from measured operating data, or finding boundary conditions that satisfy a prescribed supply temperature in a district heating network. Hence, direct and inverse problems often need to be addressed within the same modeling workflow, although many simulation workflows are primarily designed around the repeated solution of direct problems.
The numerical solution of direct steady-state problems commonly relies on the Newton–Raphson method and related variants for nonlinear algebraic systems [
8,
9]. In thermal–hydraulic networks, the resulting systems are typically sparse and strongly structured because each component contributes a limited set of local balance or constitutive equations, while network junctions impose coupling relations between adjacent components. At the same time, object-oriented thermo-fluid formulations can lead to large nonlinear equation systems whose numerical solution is challenging [
10]. This motivates structural reduction techniques that exploit the topology of the network and the computational dependencies of the component models before the nonlinear problem is solved.
A central technique for reducing the nonlinear core of such equation systems is tearing. Graph-theoretic tearing methods identify a reduced set of variables—the tearing variables—whose values, once fixed, allow the remaining variables and equations to be resolved sequentially. This idea is rooted in classical structural decomposition approaches by Steward [
11] and Dulmage and Mendelsohn [
12]. Tearing is also a well-established technique in object-oriented equation-based modeling, where automatic or model-library-supported tearing can be used to reduce the nonlinear part of large coupled systems [
13]. For thermal–hydraulic applications, tripartite-graph formulations have been proposed by Huang et al. that explicitly distinguish known variables, unknown variables, and equations, thereby supporting structural analysis tailored to this class of systems [
14]. Across all components, thermodynamic state evaluation further relies on robust fluid-property routines; CoolProp provides reference-quality property data for pure fluids and mixtures and has become a widely used open-source library in thermal-system modeling [
15].
A key modeling aspect in this context is the distinction between causal and acausal formulations. In causal component representations, an input–output direction is assigned to the component equations, such that selected output variables can be evaluated from prescribed inputs. In acausal formulations, by contrast, equations are assembled without prescribing a computational direction a priori. Ghiaus [
16] highlighted the importance of causality in thermal balance models and showed that inappropriate causal assignments can lead to physically inconsistent formulations. In the present work, however, the hybrid causal–acausal formulation is introduced primarily as a structural device for reducing the dimensions of the nonlinear problem. Component models are represented by causal input–output relations whenever their internal variables can be evaluated explicitly or sequentially from a selected set of inputs. The interconnection of components is formulated acausally through mass, energy, and pressure balance equations at the network level. This separation exposes the structural dependencies of the model and enables graph-based tearing: only the variables required to close the coupled network are retained as nonlinear tearing variables, while the remaining component and connection variables are resolved by forward evaluation.
For inverse problems, a common strategy is to solve such tasks in a nested manner, in which an outer optimization, calibration, or control loop iteratively updates selected decision variables while repeatedly calling an inner direct solver. Ghiaus formulated the analysis of cooling and dehumidification processes as a control problem, thereby showing how psychrometric system analysis can be recast as the determination of process inputs or intermediate states required to satisfy prescribed output conditions [
17]. For district heating systems, Wang et al. combined steady-state thermal network simulation with model-parameter calibration, illustrating how simulation models are embedded in inverse workflows when uncertain network parameters must be inferred from operating data [
18]. Maldonado et al. used a steady-state TESPy-based model together with a heuristic calibration procedure, in which uncertain network parameters were iteratively adjusted until simulated temperatures matched measurements with a mean absolute error below
°C after calibration [
19]. Related steady-state simulation–optimization workflows have also been reported for refrigeration and process systems. Zhou et al. developed a steady-state model of a vapor-compression refrigeration system for high heat-flux removal and used it for constrained Pareto optimization of the operating conditions [
20]. Likewise, Ghasemi et al. modeled and optimized a binary geothermal power plant in Aspen Plus using a sequential modular flowsheet formulation [
21]. A shared characteristic of such approaches is that the direct problem must be solved repeatedly for updated values of design, calibration, or control variables, which can become computationally burdensome as model complexity grows.
A conceptually related reduced-space strategy is exemplified by pyCycle, a tool for gas turbine-cycle analysis and optimization built on OpenMDAO [
22,
23]. In this setting, gradient-based optimization is performed in an outer loop, while accurate total derivatives are obtained from component-level partial derivatives assembled through OpenMDAO’s derivative framework [
23]. This substantially improves derivative accuracy and efficiency compared with finite-difference approximations and has been shown to accelerate cycle optimization in practice [
22]. Nevertheless, the overall workflow retains a reduced-space structure: the nonlinear cycle equations are still solved in an inner analysis loop at each optimizer iteration. Similarly, equation-oriented environments such as TESPy provide a flexible way to reformulate steady-state problems by changing which quantities are prescribed and which are solved for within the same network model [
5]. When inverse or optimization tasks are coupled to external optimizers, however, the resulting workflow is typically nested, in the sense that the steady-state network equations are solved repeatedly for updated decision variables.
The nested strategy is a particular instance of the general nested analysis and design (NAND) paradigm in engineering optimization. The alternative, simultaneous analysis and design (SAND), treats both state variables and design or control variables as unknowns within a single enlarged nonlinear program, while the governing equations are enforced directly as equality constraints. This distinction is well established in coupled-system optimization: in NAND, the optimizer updates design variables while the state variables are recomputed by an analysis solver at each iteration, whereas in SAND, state and design variables are determined simultaneously by the optimizer [
24,
25]. In PDE-constrained optimization, full-space or one-shot formulations have been shown to offer computational advantages for certain classes of large-scale and strongly coupled problems [
26,
27]. This suggests that similar benefits may be attainable for steady-state thermal–hydraulic networks, particularly when the direct problem itself is computationally expensive, strongly coupled, or poorly conditioned.
Against this background, the present work proposes a unified computational methodology for direct and inverse steady-state problems in thermal–hydraulic networks. The methodology combines causal component relations with acausal network balance equations to expose the structural dependencies of the model and enable a tripartite-graph-based tearing reduction. Direct problems are formulated as tearing-reduced nonlinear root-finding problems. In contrast, inverse problems are posed in a tearing-reduced SAND framework, in which tearing variables and selected system inputs are determined simultaneously while the steady-state balance equations are enforced directly as equality constraints. More generally, this yields a residual-constrained optimization framework for steady-state network operation under bounds, target conditions, and additional operational constraints.
The methodology is implemented in an open-source Python module and demonstrated using a vapor-compression refrigeration cycle as a test case.. In the direct problem, the steady-state operating point is computed for prescribed boundary conditions and component inputs. In the inverse problem, compressor speed and expansion valve opening are adjusted to satisfy prescribed cooling-load and superheat targets under varying condenser inlet conditions. The example illustrates how the same network model can be used for both direct simulation and inverse operation within a unified tearing-reduced formulation.
The remainder of this paper is structured as follows.
Section 2 introduces the computational modeling methodology, including the hybrid causal–acausal paradigm, the tripartite-graph tearing strategy, and the direct and inverse problem formulations.
Section 3 describes the vapor-compression refrigeration cycle used as a test case and the corresponding component models.
Section 4 presents the simulation and set-point tracking results for both direct and inverse problems.
Section 5 discusses the findings in the context of existing approaches, and
Section 6 summarizes the conclusions and outlines directions for future work.
2. Computational Modeling
This section introduces the computational framework used to model and solve steady-state thermal–hydraulic networks. The framework is based on a hybrid causal–acausal representation of the network. Individual physical components are described by causal input–output models, i.e., each component computes its output variables from a prescribed set of input variables and component parameters. The coupling between components is represented separately by junction equations, which impose the mass, energy, and pressure balances required for a physically consistent network solution. Boundary conditions specify those quantities that are imposed externally rather than determined through the network equations.
The combination of causal component models and acausal junction equations leads to a coupled set of algebraic relations for the steady-state network. Instead of solving all network variables simultaneously, the proposed methodology exploits the structural dependencies of this formulation by means of a tripartite-graph-based tearing procedure. The procedure determines which variables can be propagated through causal component evaluations and which variables must be retained as tearing variables in order to satisfy the remaining junction coupling equations. Consequently, the original network problem is transformed into a reduced nonlinear residual system in the tearing variables, while the dependent variables are obtained from the causal evaluation sequence.
This tearing-reduced residual formulation provides the common basis for all computational problems considered in this work. In a direct problem, the boundary conditions are prescribed and the tearing variables are determined such that the remaining coupling residuals vanish. In inverse and optimization problems, selected externally specified quantities are instead treated as additional decision variables and determined together with the tearing variables, subject to the same steady-state coupling equations and, where applicable, additional constraints and an objective function.
The following subsections formalize this methodology. First, the representation of components, junctions, boundary conditions, and network variables is introduced. The tripartite-graph-based tearing procedure is then described and used to derive the reduced residual formulation. Finally, the resulting formulations for direct, inverse, and optimization problems are presented.
2.1. Problem Classes and Causality
Steady-state thermal–hydraulic network models are governed by conservation of mass, momentum, and energy. While these laws describe the underlying physics, they do not prescribe how a model is evaluated numerically. This distinction is captured by computational causality, i.e., the assignment of directed input–output relationships that define an execution order in a numerical workflow.
We distinguish between two main classes of steady-state problems:
Direct problems (simulation). Boundary conditions, component parameters, and operating inputs are prescribed, and the task is to compute the corresponding steady-state network state.
Inverse and optimization problems. Selected quantities that are physically interpreted as inputs, such as actuator settings, boundary conditions, or design parameters, are treated as unknowns and must be determined such that prescribed outputs are met or a performance objective is optimized under constraints.
The distinction between direct and inverse problems is therefore not determined by the physical nature of a variable alone, but by its role in the numerical formulation. For example, a compressor speed, valve opening, boundary pressure, or inlet temperature may be prescribed in a direct simulation, but treated as an unknown decision variable in an inverse or optimization problem.
From a modeling perspective, causal and acausal formulations provide complementary capabilities. Causal models define directed evaluation maps, which can be executed once their inputs are known, but require a prescribed computational direction. Acausal equation-based models define implicit relations without assigning an input–output direction a priori. They provide strong modularity and a natural representation of physical coupling, but typically yield larger coupled nonlinear systems.
The proposed methodology uses these two views at different structural levels as shown in
Figure 1. Computational causality is imposed on component interfaces to obtain executable component maps, whereas the coupling between components is retained in acausal form through junction balance equations. This separation is essential for the tearing reduction introduced below: causal component maps and locally solvable junction relations can be evaluated by forward propagation, while only the remaining algebraic loop variables are retained as tearing variables.
2.2. Component Interfaces: Externally Causal and Internally Implicit Models
A thermal–hydraulic network consists of components such as compressors, pumps, heat exchangers, valves, pipes, and separators. At steady state, each component interacts with the surrounding network only through its port variables, typically pressure p, specific enthalpy h, and mass flow rate . In the proposed methodology, components are exposed to the network assembly through externally causal interfaces, while their internal physics may remain implicit.
Let
denote the input vector of component
c, as defined by the assigned computational causality, and let
denote the corresponding output vector. The component is interfaced to the network solver through an evaluation map
where
denotes component parameters.
The map defines the externally visible computational causality of the component. Once the required input port variables are available, the component returns the corresponding output port variables . This externally causal interface is the object used by the network-level structural analysis and tearing algorithm.
Importantly, the existence of an externally causal interface does not imply that the component physics must be explicit. Many components are more naturally described by local implicit relations, for example, in residual form
where
denotes component-internal states, such as segment pressures, enthalpies, or wall temperatures in a discretized heat-exchanger model. In this case, the evaluation of
involves solving the local system for
and subsequently computing the output port variables.
This distinction is essential for the proposed reduction strategy. Component- internal states are not exposed as global network variables. The global network problem is formulated only in terms of port-level coupling variables, whereas component-local nonlinear systems are encapsulated within the corresponding component maps. Consequently, increasing the internal resolution of a component, for example, by using more heat-exchanger segments, does not necessarily increase the dimension of the global tearing problem. The nonlinear iterations at the network level are restricted to the coupling variables that remain after graph-based tearing.
Figure 2 illustrates this distinction for an externally causal component map and for a component whose external map contains an encapsulated local implicit solve.
2.3. Model Nonlinearities
The proposed methodology is not restricted to a particular degree of model nonlinearity. Component models may be linear, nonlinear, empirical, tabulated, or internally implicit, depending on the selected level of model fidelity. The only requirement at the network level is that each component provides an externally causal computational interface consistent with the assigned component causality.
The nonlinearities of the assembled residual system therefore originate from the selected component and property models, as well as from the thermal–hydraulic coupling equations, rather than from the causal–acausal formulation itself. In thermal–hydraulic applications, typical sources of nonlinearity include thermodynamic property evaluations, such as , , or saturation relations; component characteristic maps, such as compressor or valve correlations; heat transfer relations involving temperature differences; and pressure-flow relations in hydraulic components. In addition, junction energy balances introduce nonlinear coupling terms through the products of mass flow rate and specific enthalpy, whenever both quantities are unknown. In inverse and optimization problems, additional nonlinearities may enter through target functions, operational constraints, or actuator limits.
Consequently, the degree of nonlinearity is not a fixed property of the proposed methodology, but depends on how a thermal–hydraulic network is constructed within the framework. In particular, it is determined by the modeler’s choice of component models, property models, and coupling equations, provided that the selected models satisfy the externally causal interface requirements introduced above.
2.4. Computational Causality Types at Component Ports
To assemble and evaluate a network, each component is assigned a computational causality that specifies which port variables must be provided as inputs and which port variables are returned as outputs. This causality assignment is a computational interface convention, not a statement about the physical direction of cause and effect inside the component. It defines how the component can be executed during the forward reconstruction induced by the tearing algorithm.
In the present framework, each port is described by the variables pressure
p, specific enthalpy
h, and mass flow rate
. Following [
14], we distinguish two component causality types:
Pressure-based components. These components take the pressures at the inlet and outlet ports, together with the inlet specific enthalpies, as inputs. They return the mass flow rates at all ports and the outlet specific enthalpies. Typical examples are compressors, pumps, and throttling or expansion devices, for which the mass flow rate is determined from pressure levels and component characteristics.
Mass flow-based components. These components take pressure, specific enthalpy, and mass flow rate at the inlet ports as inputs and return the corresponding outlet port variables. Typical examples are heat exchangers, pipes, or other flow-through components that are evaluated along a prescribed flow direction.
These two causality types cover the component classes used in the present methodology: components whose mass flow rate is determined by pressure levels and components whose outlet state is evaluated along a known mass-flow direction. Once the required input variables of a component are available, the component becomes executable and its output variables can be propagated through the network. This executable structure is exploited by the graph-based tearing procedure described in
Section 2.6.
The two causality types are summarized in
Table 1 and illustrated in
Figure 3 for a pressure-based compressor and a mass-flow-based heat exchanger.
2.5. Network Coupling: Junction Equations, Boundary Conditions, and Loop Closure
The system-level state of a thermal–hydraulic network is described by the port variables of all component connections. We collect the unknown pressures, specific enthalpies, and mass flow rates at component ports into the global network variable vector
The vector
contains only network coupling variables and no component-internal states. Quantities that are prescribed externally, such as boundary pressures, inlet enthalpies, inlet mass flow rates, actuator settings, and fixed component specifications, are collected in the input vector
Boundary conditions are therefore not introduced as additional residual equations. Instead, they determine which quantities are treated as prescribed inputs and which port variables remain unknowns in . This assignment follows from the combination of network topology and component causality: variables required by a component interface but not determined through junction coupling or by the output of another component must be supplied as external specifications. The residual equations of the network are then assembled for the remaining unknown port variables.
2.5.1. Junction Balance Equations
Components are interconnected through junctions. For each junction
j, let
denote the set of ports whose mass flow enters the junction and
the set of ports whose mass flow leaves the junction. Mass flow rates are treated as non-negative with respect to the assigned port direction; the sets
and
therefore define the signs with which the corresponding streams enter the junction balances. Each connected port carries the variables
, which are either unknown entries of
or prescribed quantities contained in
. An illustrative coupling of two component ports through a junction is shown in
Figure 4.
At steady state, junctions neither store mass nor energy. The mass and energy balances are therefore given by
Pressure continuity is enforced by requiring all connected ports to share the same pressure. Choosing one connected port
as reference, this can be written as
Two basic junction patterns are distinguished. A
split junction connects one incoming stream to multiple outgoing streams. Since no mixing between different incoming streams occurs, all outgoing streams inherit the specific enthalpy of the incoming stream:
where
denotes the unique incoming port.
A
merge junction connects multiple incoming streams to one outgoing stream. In this case, perfect mixing is represented by the energy balance above; no equal-enthalpy constraints are imposed on the incoming streams. The outlet enthalpy is therefore determined implicitly by the mixed energy balance. The basic split and merge connection patterns are illustrated in
Figure 5.
Collecting all junction balance and junction consistency equations yields the network coupling system of residual equations:
Here, the dependence on indicates that prescribed boundary values and fixed component inputs enter the residual evaluation as known quantities, whereas the remaining unknown port variables are collected in .
2.5.2. Boundary Conditions and Structural Well-Posedness
A well-posed steady-state network problem requires a structurally non-singular set of equations for the unknown network variables. In the proposed methodology, boundary conditions are assigned before the residual system is solved. They classify selected port variables, actuator settings, or model specifications as prescribed quantities and collect them in the input vector . The remaining unknown port variables form the network variable vector .
The need for boundary conditions follows from the combination of network topology and component causality. If a variable required by a component interface is not provided by junction coupling or by the output of another component, it must be prescribed externally. For example, an unconnected inlet of a mass-flow-based component requires pressure, specific enthalpy, and mass flow rate as boundary specifications. For a pressure-based component, pressures at the inlet and outlet ports and inlet specific enthalpies must be available as inputs to the component map, whereas the corresponding mass flow rates and outlet enthalpies are computed by the component model.
Thus, boundary conditions do not add independent balance equations to the network residual. Rather, they determine which quantities are known and which port variables remain unknown. This classification fixes the dimension of , determines the arguments of the component evaluation maps, and thereby defines the structure of the network coupling system of residuals .
2.5.3. Closed Loops and Additional Closure Relations
Network topology directly affects structural well-posedness. In particular, closed fluid loops may leave one or more degrees of freedom undetermined by junction balances and causally evaluated components alone.
Figure 6 illustrates the difference between open- and closed-loop configurations.
The structural origin of this indeterminacy is that mass balance equations around a closed loop become linearly dependent. As a result, the junction balance equations and component evaluations are insufficient to determine all loop variables uniquely. In such cases, additional independent closure relations must be introduced. The number of required closure relations follows from the structural degrees of freedom of the assembled system; for the simple closed loops considered in this work, one additional independent closure relation is required per independent loop.
Unlike ordinary boundary conditions, which classify quantities as prescribed inputs in , closure relations are added as residual equations or equality constraints. They may encode physically meaningful specifications, such as fixing a pressure level, prescribing a thermodynamic state, imposing a receiver-state condition, fixing the total fluid inventory, or enforcing a device-specific steady-state assumption.
We denote the collection of closure relations in residual form by
Together with the junction coupling residual, the structurally closed network problem is then written as
2.6. Tripartite-Graph-Based Tearing and Forward Reconstruction
After assigning component causalities, prescribing the required boundary conditions, and adding any necessary closure relations, the steady-state network problem is represented by the structurally closed residual system
Although component models are exposed through externally causal interfaces, the acausal junction balance equations can induce algebraic loops at the network level. Solving the full residual system directly may therefore become computationally expensive and numerically brittle, especially for large networks. To restrict nonlinear iterations to a reduced subset of variables, we apply tearing techniques [
11,
12,
13]. The key idea is to identify a set of tearing variables that remain unknown in the nonlinear solve, while all remaining network variables are reconstructed by directed forward evaluation of executable component maps and solvable junction relations.
2.6.1. Tearing Algorithm
We adopt the tripartite-graph tearing algorithm of Huang et al. [
14]. In the present framework, the tearing algorithm is used as a structural preprocessing step. Based on the assigned component causalities, the network junction equations, and any required closure relations, it determines (i) a causally admissible execution order of component evaluations and solvable junction relations, (ii) a set of tearing variables, and (iii) the residual equations that remain after forward evaluation.
The underlying principle is to exploit all causal relations that can be evaluated directly once their inputs are known. A component becomes executable as soon as all variables required by its computational causality are available. Likewise, a junction relation becomes solvable when all variables required to determine the remaining unknown are known. By successively marking variables as known and evaluating all executable components and solvable junction relations, the algorithm propagates information through the network as far as possible without iteration.
If no further forward evaluation is possible, additional tearing is introduced by selecting variables that remain temporarily undetermined and promoting them to tearing variables. These variables are retained as unknowns in the reduced network closure problem, while all remaining variables are determined by forward evaluation. The tearing procedure induces a partition of the unknown network variables,
where
denotes the vector of tearing variables,
collects all remaining non-tearing port variables, and
is a permutation matrix that maps the ordered partition back to the original ordering of
. By construction of the execution order,
can be reconstructed by a single forward pass once
is given.
The residual equations are formed by those balance relations that are not eliminated through forward propagation and therefore close the remaining algebraic loop. Collecting these residuals defines a compact nonlinear system, referred to as the
tearing-reduced residual system:
where the subscript
t denotes
tearing-reduced. In typical applications, the reduced dimension
d is much smaller than
, which reduces the cost of nonlinear iterations. The tearing procedure does not alter the underlying physical model. Rather, it reorganizes the algebraic structure of the network equations such that only a reduced subset of variables remains in the nonlinear solve, while the remaining variables are recovered by directed forward evaluation.
Accordingly, the structural reduction achieved by tearing is governed by the number and arrangement of algebraic couplings that cannot be resolved by forward evaluation. Networks for which only a comparatively small set of tearing variables remains therefore lead to a correspondingly compact network-level nonlinear residual system. The resulting computational benefit, however, also depends on the cost of evaluating the selected component and property models.
2.6.2. Forward Reconstruction Operator
In addition to the tearing variables and residual equations, the tearing algorithm provides a causally admissible execution order for component evaluations and solvable junction relations. This execution order induces a deterministic forward reconstruction operator
which reconstructs all non-tearing port variables from the tearing variables and prescribed inputs. Component-internal solves, if present, are encapsulated within the component maps
and therefore do not introduce additional global unknowns.
The complete network port-variable state implied by
is then given by
For notational simplicity,
may be omitted when the network variables are ordered such that the tearing variables appear first.
The tearing-reduced residual system can therefore be viewed as a reduced representation of the structurally closed steady-state network problem
. Formally, the reduced residual is obtained by evaluating the remaining residual equations after forward reconstruction:
where
denotes the selection operator of residual equations that remain after tearing and forward propagation.
In summary, the proposed methodology transforms the structurally closed steady-state network problem into a tearing-reduced formulation in terms of , together with a forward reconstruction operator . This reduced representation provides the common mathematical basis for both direct simulation and tearing-reduced residual-constrained inverse or optimization problems.
2.7. Problem Formulations: Direct and Inverse Problems
The tearing reduction yields a compact nonlinear residual system and a forward reconstruction operator . Together, they define the reconstructed network state . This common representation enables different computational workflows without changing the underlying network model.
In addition to port variables, many tasks require system output quantities such as cooling load, superheat, compressor power, pressure levels, or efficiency. We therefore define a vector of system outputs as
where
is a post-processing map evaluated from the reconstructed steady-state solution and prescribed inputs.
2.7.1. Direct Problem (Steady-State Simulation)
In the direct problem, all external inputs are prescribed. These include boundary conditions, actuator settings, and fixed component specifications collected in
. The unknowns of the reduced nonlinear problem are therefore only the tearing variables
. The steady-state solution is obtained by solving
for
using a nonlinear root-finding method [
8,
9].
Once a solution
is obtained, the non-tearing variables, the full port-variable state, and the system outputs follow from
2.7.2. Residual-Constrained Inverse and Optimization Problems
Inverse and optimization problems for steady-state networks can be expressed as residual-constrained optimization problems. Inverse problems in steady-state modeling arise naturally in design, parameter identification, and set-point tracking applications [
28,
29]. In equation-oriented environments such as TESPy, inverse tasks can often be addressed very naturally by changing which quantities are prescribed and which are solved for within the same steady-state model [
5,
30]. TESPy also supports the use of component parameters as variables and provides design/off-design switching mechanisms for adapting model specifications accordingly [
30,
31]. For many applications, this offers a flexible and elegant way to formulate alternative operating or design problems within a common network model.
In the present work, inverse problems are formulated explicitly in a simultaneous analysis and design setting on the tearing-reduced system. The key difference is that the tearing variables and selected variable inputs are treated as unknowns simultaneously, while the steady-state balance equations are enforced directly as constraints of the optimization problem. By contrast, when external optimization tools are coupled to a steady-state network model, the resulting workflow is typically nested, in the sense that the optimizer updates the decision variables and the network model is solved repeatedly for each new candidate point [
32]. The simultaneous formulation adopted here is particularly attractive when the solution of the direct problem is itself computationally expensive or numerically challenging, as discussed in the Introduction.
The inverse problem is then formulated as a tearing-reduced residual-constrained optimization problem. The input vector is partitioned into variable and fixed inputs according to
where
contains selected variable inputs, such as actuator settings, boundary values, and design parameters, and
contains the prescribed inputs that remain fixed during the optimization. For any candidate pair
, the full port-variable state is obtained from the forward reconstruction operator,
The resulting optimization problem is written as
Here,
denotes the tearing-reduced residual system and enforces steady-state feasibility of the reconstructed network state. The objective function
represents either a set-point tracking objective or a performance metric evaluated from the reconstructed state and the variable inputs. The functions
and
encode additional equality and inequality constraints beyond steady-state feasibility, such as operational requirements, design specifications, or physical admissibility conditions. The bound constraints restrict the tearing variables and variable inputs to admissible ranges, for example, to represent actuator limits or physically meaningful operating domains.
This formulation is a tearing-reduced SAND formulation: the tearing variables and selected variable inputs are determined simultaneously, while all remaining network variables are obtained by forward reconstruction. Direct simulation, inverse problems, and more general optimization tasks are therefore expressed within the same tearing-reduced modeling framework. They differ only in the role assigned to selected entries of the input vector and in the choice of objective function and additional constraints.
The formulation in Equation (
23) should be interpreted as a general nonlinear programming problem. In the general thermal–hydraulic case, global optimality guarantees cannot be stated without additional restrictive assumptions. Such guarantees are available only for special cases, for example, when the residual equality constraints are affine, the inequality constraints define a convex feasible set, the objective function is convex, and suitable regularity and feasibility conditions hold.
As discussed in
Section 2.3, thermal–hydraulic inverse problems generally involve nonlinear component, property, and coupling relations. Consequently, the residual-constrained inverse problems considered in this work are generally nonconvex. Solutions obtained with nonlinear programming solvers should therefore be interpreted as locally optimal or stationary solutions, depending on the solver, initialization, and constraint regularity, rather than as globally optimal solutions in the general case.