You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains the code base for following publication:
" Learning closure relations using differentiable programming: an example in radiation transport "
The 'Examples/' directory provides a number scripts that can be used to reproduce solutions to the original and modified Su & Olson problem, as well as the training process:
RunSuOlson.py
This contains the default settings used to run solutions to the original Su & Olson problem for the various models. By default, it reads the closure parameters from the SimData/opt_closure_params.json file which contains optimal parameters found by the author using TrainSuOlson.py
TrainSuOlson.py
This contains the default settings used to train the closure relations to the original Su & Olson problem with the various models. N.B. the higher order flux limited diffusion (HFLD) model requires an accurate g-closure from the third order moment model to run. Therefore, if training from scratch, the third order model must be trained before HFLD. Optimal parameters are saved to a json file in 'SimData/'
RunModifiedSuOlson.py
This contains the default settings used to run solutions to the modified Su & Olson problem for the various models. By default, it reads the closure parameters from the SimData/opt_closure_params.json file.
The Su & Olson test problem
The training data for the closures comes from the Su & Olson test problem. In this problem, the coupled system of equations to be solved are the following:
Here $U$, $W$, $V$ and $Q$ are the scaled radiation intensity, radiation energy density, material energy density and external radiation source respectively. The coordinates $x$, $\mu$, and $\tau$ are the normalised distance, cosine of angle of propagation and the normalised time respectively.
The analytic solutions given are performed for a source term of the following form:
Su and Olson provide analytic solutions at various $x$ and $\tau$ values for $\epsilon = 1$, $x_0$ = 0.5 and $\tau_0$ = 10. Tabular data is given in the 'SuOlsonData' directory.
Code overview
We solve radiation transport for the Su & Olson type problems using various reduced models:
Pure diffusion
Flux-limited diffusion
Variable Eddington factor
Third order moment
Higher order flux-limited diffusion
Examples of running and training the models are given in the 'Examples' directory
Finite differencing details
All models are solved using finite volume methods fully explicitly. Reflective boundary conditions are applied. Time stepping was performed using Huen's method, which solves:
were solved using the forward-time-centred-space method - making the fluxes face-centred. Therefore, the flux limiter is also needed at the face. A donor cell approach was used to do this:
if $W_{i+1}-W_{i} > 0$ then $W_{i+1/2} = W_{i+1}$ else $W_{i+1/2} = W_i$; $i$ here is the spatial index and $\Delta x$ is the spatial step. This scheme has a stability which is poorer than the advective CFL condition ($\Delta \tau < \Delta x$) due to the diffusive terms.
where $R_W$ and $R_F$ are the numerical fluxes calculated by the Roe scheme:
where the correction matrix, $\underline{C}$, is given in Brunner and Holloway. In this scheme both flux and energy density are cell centred. The scheme's stability follows the advective CFL condition.
were solved using face-centred fluxes and first order finite differencing. The donor cell Eddington factor ($p$) was used to get a face centred value of the closure in the pressure equation:
if $F_{i+1/2} > 0$ then $p_{i+1/2} = \frac{P_{i}}{W_{i}}$ else $p_{i+1/2} = \frac{P_{i+1}}{W_{i+1}}$. The scheme's stability follows the advective CFL condition.
used a similar donor cell method to obtain face-centred values, as in flux-limited diffusion and third order moment models. This scheme has a stability which is poorer than the advective CFL condition due to the diffusive terms.
Discrete Ordinates
Discrete ordinates numerically solve the full radiation transport equation using a Gauss-Legendre quadrature set for the angular coordinate, $\mu$. This goes as follows, for $\mu > 0$:
where $n$ is the angular index. For each ordinate $\mu_n$, there is an ordinate weight, $w_n$. These are used to compute angular moments of $U_{i,n}$, for example:
$$
W_{i} = \sum_n w_n U_{i,n} \ .
$$
The $\mu_n$ and $w_n$ values for a 32 ordinates set are stored in files under the 'SimData' directory.
Tests
A number of tests of the numerical schemes are given in the 'Tests/' directory.
Installation
Clone git repository and pip install local copy
git clone https://github.com/aidancrilly/RTClosureJAX.git
cd RTClosureJAX
pip install -e .
About
Learning closure relations in radiation transport using JAX