Folder of the UQ tutorial 2.
More...Files | |
| CGnoiseTest.H | |
| CGtest.H | |
| directBC.H | |
| IHTP01inverseLaplacian.C | |
| Implementation of an inverse heat transfer problem. | |
| IHTP01inverseLaplacian.H | |
| parameterizedBCtest.H | |
| parameterizedBCtest_RBFwidth.H | |
| postProcess.H | |
| solveTrue.H | |
| thermocouplesLocation_CG.H | |
| thermocouplesLocation_paramBC.H | |
| thermocouplesNumberTest_CG.H | |
| thermocouplesNumberTest_paramBC.H | |
Folder of the UQ tutorial 2.
This tutorial demonstrates inverse problem solving for a one–dimensional heat transfer problem. The objective is to reconstruct unknown boundary fluxes (heat flux at the left wall) and/or the internal state of the domain given noisy temperature measurements at selected points (thermocouples).
Two methods are implemented and compared:
Both are tested on a analytical benchmark problem with known solution, allowing error assessment.
The heat equation governs the domain
$$ \rho C_p \frac{\partial T}{\partial t} + k \Delta T = 0, \quad x \in (0,1) $$
with boundary conditions:
Temperature measurements $y_i(t)$ are collected at locations $x_i$ inside the domain. The inverse problem is to find $g(t)$ and/or the state $T(x,t)$ that minimize the discrepancy between measurements and predictions, subject to the PDE constraint.
An analytical solution is prescribed as
$$ T_{true}(x,y,z) = ax^2 + bxy + cy - az^2 + c $$
for constants $a,b,c,d$ (set to 5, 10, 15, 20 by default). The flux $g_{true}$ is derived from this solution. During the inverse solve, a slightly different flux $g$ is assumed to intentionally introduce model error.
This method solves
$$ \min_g \Vert H(g) - y_{meas} \Vert^2 + \lambda \Vert g \Vert^2, $$
where $H$ is the forward operator (solving the forward heat equation) and $\lambda$ is a regularization parameter. The CG algorithm iteratively refines the flux estimate using adjoint gradients.
Implemented in inverseLaplacianProblem_CG class and tested via the #include "CGtest.H" section of the main.
Instead of solving for $g(t)$ directly at every boundary node, the flux is parametrized as a linear combination of basis functions centred at control points. The RBF parameters are then optimized.
Implemented in inverseLaplacianProblem_paramBC class; tested via #include "parameterizedBCtest.H".
The included headers provide OpenFOAM finite-volume tools, inverse Laplacian problem classes, POD and utility routines from ITHACA-FV, interpolation and field-manipulation utilities, and the tutorial-specific header IHTP01inverseLaplacian.H. Together, these dependencies support both the forward heat-transfer solve and the inverse reconstruction procedures.
In main, two problem objects are created: example_paramBC, which uses a parameterized boundary condition, and example_CG, which uses a conjugate-gradient regularization method.
The coefficients a, b, c, and d are then assigned to both objects in order to define the analytical benchmark used throughout the tutorial.
The code reads from ITHACAdict which tests must be executed. These switches control whether the program performs the standard conjugate-gradient inversion, the parameterized boundary-condition inversion, sensitivity studies with respect to the RBF width, and tests that vary the location or number of thermocouples.
At the same time, the code reads the physical and numerical parameters needed by the inverse solvers, such as conductivity, heat-transfer coefficient, tolerances, maximum CG iterations, and the RBF shape parameter.
An analytical reference temperature field T_true is then constructed directly from the mesh coordinates. This field acts as the exact benchmark solution. Using it, the code defines the corresponding exact boundary heat flux on the hot side through the analytical expression $g(x)=k(bx+c)$. This exact flux is assigned to both inverse-problem objects and used to generate the true forward solution.
The methods solveTrue() are then called for both objects to compute the numerical reference solution associated with the exact heat flux.
After that, the analytical field and the numerical solution are compared. The code exports the analytical solution and the numerical error field, and prints relative and absolute error norms. This verifies that the direct solver is consistent with the chosen benchmark.
Next, the thermocouple positions are read for both problem formulations, and the synthetic measurements are generated by sampling the analytical field at those locations. These measurements become the data used in the inverse problem.
The rest of the file is organized as a collection of optional tests. If CGtest is enabled, the inverse problem is solved with Alifanov’s regularization method. If parameterizedBCtest is enabled, the heat flux is reconstructed by parameterizing the boundary condition. Additional tests explore the influence of the RBF width and the sensitivity of both methods to the thermocouple placement and to the number of sensors. Each test is included through a dedicated header file, so the driver remains compact while still supporting multiple study configurations.
The plain code is available here.
1.16.1