This section lists the automated tests that compare the finite element solution to an analytical (or semi-analytical) solution. Each entry states the problem setup, the assumptions that make an analytical solution possible, the solution itself, and the error metric used to pass or fail the test.
All tests solve a steady-state problem on a quasi-1D domain unless stated otherwise. Nodal errors are evaluated at the mesh nodes along a line through the domain.
- Heterogeneous Conduction and Flow
- Axisymmetric Conduction and Flow
- Advection–Diffusion
- Non-linear Viscosity
- Buoyancy
- Wellbore Heat Exchange
Test: test_heterogeneous
Setup. A column
Assumptions.
- Steady state, no advection, no gravity.
- Constant fluid density and viscosity
$\mu$ . - Material properties are piecewise constant. The layer interface
$z_I$ is the element boundary closest to the geometric interface, because regions are assigned per element. - The uniform flux at
$z=H$ makes the problem 1D in$z$ .
Analytical solution. Under steady state, the flux is the same at every height. Fourier's and Darcy's laws then give piecewise-linear profiles:
with subscript 1 denoting the lower layer.
Comparison. Analytical and finite element (RAFT) nodal solutions.
Heterogeneous Conduction and Flow: temperature
Heterogeneous Conduction and Flow: pressure
Error metric. Sum of squared relative nodal errors for both fields:
Test: test_axisymmetry
Setup. A 2D axisymmetric annulus
Assumptions.
- Steady state, no advection, no gravity.
- Homogeneous, isotropic, constant properties (
$\lambda$ ,$k$ ,$\mu$ ,$\rho_f$ ). - The solution depends only on
$r$ .
Analytical solution. The radial diffusion equation
Comparison. Analytical and finite element (RAFT) nodal solutions.
Axisymmetric Conduction and Flow: temperature
Axisymmetric Conduction and Flow: pressure
Error metric. Squared nodal errors along the two radial edges. Temperature errors are normalized by the mean exact temperature, and pressure errors by the exact pressure at
Test: test_advection
Setup. A column
Assumptions.
- Steady state, advection on, no gravity.
- Incompressible fluid with no thermal expansion and constant viscosity, so the Darcy velocity is uniform:
- Constant effective conductivity,
$\lambda_e = \phi\lambda_f + (1-\phi)\lambda_s$ .
Analytical solution. The 1D advection–diffusion equation
With SUPG stabilization, the nodal values should be close to exact.
Comparison. Analytical and finite element (RAFT) nodal solutions.
Advection–Diffusion: normalized temperature
Error metric. Sum of squared nodal errors in the normalized temperature
Test: test_nonlinear_viscosity
Setup. A column
Assumptions.
- Steady state, advection on, no gravity.
- Constant fluid density
$\rho_f$ , so the prescribed mass flux sets a uniform Darcy velocity$v = |q_m|/\rho_f$ everywhere. - Viscosity is the real-fluid (CoolProp) function
$\mu(p,T)$ . - Constant effective conductivity
$\lambda_e$ .
Semi-analytical solution. Since
The pressure follows from Darcy's law with the variable viscosity:
This ODE is integrated with the trapezoidal rule on a fine grid. Because
Comparison. Analytical and finite element (RAFT) nodal solutions.
Non-linear Viscosity: temperature
Non-linear Viscosity: viscosity
Non-linear Viscosity: pressure
Error metric. Relative
Test: test_buoyancy
Setup. A vertical column
Assumptions.
- Steady state, no advection, so the temperature is linear in
$z$ . - Linear (Boussinesq-type) density with thermal expansion
$\alpha_f$ , reference density$\rho_0$ , and an incompressible fluid:
- Constant viscosity and permeability.
- Steady mass conservation requires a uniform mass flux,
$\rho_f, v = \text{const}$ .
Analytical solution. Darcy's law with gravity, together with the constant mass flux, gives
The analytical solution becomes
Comparison. Analytical and finite element (RAFT) nodal solutions.
Error metric. Relative sum of squared nodal pressure errors:
Test: test_well_conduction
Setup. A straight horizontal well of diameter
Assumptions.
- Steady state, advection on, no gravity.
- Constant fluid properties (
$\rho_f$ ,$\mu$ ,$c_{pf}$ ,$\lambda_f$ ). - No perforations, so there is no mass exchange with the rock, and the mass flow rate is uniform along the well.
- Laminar, fully developed flow from the inlet onward, with Nusselt number
$\mathrm{Nu}=4.01$ and heat transfer factor 1. The heat transfer coefficient is$h = \frac{Nu \lambda_f}{D}$ . - Axial conduction in the fluid is neglected.
- Frictional (pressure-work) heating follows Hagen–Poiseuille flow, giving a constant heat source
$\Phi$ per unit length.
Analytical solution. Along the well coordinate
With
The frictional term is negligible at the test's flow rate.
Comparison. Analytical and finite element (RAFT) nodal solutions.
Wellbore Heat Exchange: fluid temperature along the well
Error metric. Relative sum of squared nodal temperature errors at the well nodes:
