sunpeek.core_methods.dcam_lite_collective.dcam.forward_simulation#
D-CAM 2-N forward simulation
Scope#
This file implements the collector-array D-CAM 2-N model only. It is intentionally independent from the separate pipe model and HEX model modules.
That separation is important because the application may later want to use: - D-CAM alone, - pipe model (with D-CAM or alone), - HEX model in combination with pipe and DCAM model - or a combined D-CAM + pipe workflow in main.py.
Model summary#
The D-CAM 2-N model uses two temperature fields along normalized flow direction x ∈ [0, 1]:
T_f(t, x): fluid temperature
T_s(t, x): solid / collector metal temperature
The governing equations follow the same structure as the Julia implementation:
- mc_s * dT_s/dt =
tau_alpha * (iam * G_b + kd * G_d) - u1 * (T_s - T_amb) - u2 * (T_s - T_amb)^2 - u_int * (T_s - T_f)
- mc_f * dT_f/dt =
u_int * (T_s - T_f) - cap_fl_sp * dT_f/dx
with boundary / initial conditions: - T_f(t, x=0) = T_inlet(t) - T_f(t=0, x) = T_f_init(x) - T_s(t=0, x) = T_s_init(x)
Numerical approach#
The PDE system is discretized in space with a method-of-lines approach:
- x is discretized into n_discretization stations
- time integration is done with diffrax
- advection term dT_f/dx uses upwind differencing
- output is saved at the exact timestamps passed in data["index"]
Public API#
get_initial_states(…)
run_forward_simulation(…)
Expected inputs#
data is expected to be a dict containing interval-aligned arrays with at least:
- index : time base, either seconds-from-start or datetime-like index
- te_in : inlet fluid temperature [K]
- te_out : measured outlet fluid temperature [K] (needed for default initialization)
- te_op : operation temperature [K] (needed for default initialization)
- te_amb : ambient temperature [K]
- rd_bti : beam irradiance in collector plane [W/m²]
- rd_dti : diffuse irradiance in collector plane [W/m²]
- iam : incidence angle modifier [-]
- mf : mass flow [kg/s]
- cp_mean : mean fluid heat capacity [J/(kg K)]
collector_parameters_2n is expected to provide scalar SI values for:
- mc_s, mc_f, tau_alpha, kd, u1, u2, u_int
Notes
This module works with plain floats / numpy arrays.
Unit conversion should be done upstream before calling this file.
The solver settings API is intentionally simple and Python-native.
Functions
|
Compute initialization profiles for the D-CAM 2-N model. |
|
Run the D-CAM 2-N forward simulation in Python. |
Classes
|
Fluid and solid temperature state on the D-CAM 2-N spatial grid. |