|
HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Linear Advection-Diffusion-Reaction model. More...
#include <basic.h>Go to the source code of this file.
Data Structures | |
| struct | LinearADR |
| Structure containing variables and parameters specific to the linear advection-diffusion-reaction model. More... | |
Macros | |
| #define | _LINEAR_ADVECTION_DIFFUSION_REACTION_ "linear-advection-diffusion-reaction" |
Functions | |
| int | LinearADRInitialize (void *, void *) |
| int | LinearADRCleanup (void *) |
Linear Advection-Diffusion-Reaction model.
Linear Advection-Diffusion-Reachtion
\begin{equation} \frac {\partial u} {\partial t} + \sum_d \frac {\partial} {\partial x_d} \left( a_d d \right) = \sum_d \nu_d \frac {\partial^2 u} {\partial x_d^2} + k u \end{equation}
where \(a_d\) are the advection speeds, \(\nu_d\) are the diffusion coefficients, and \(k\) is the reaction rate.
Definition in file linearadr.h.
| struct LinearADR |
Structure containing variables and parameters specific to the linear advection-diffusion-reaction model.
This structure contains the physical parameters, variables, and function pointers specific to the linear advection-diffusion-reaction equation.
Definition at line 37 of file linearadr.h.
| Data Fields | ||
|---|---|---|
| int | constant_advection |
Is the advection field constant (1) or spatially-varying (0) |
| char | adv_filename[_MAX_STRING_SIZE_] |
Filename of file to read in spatially-varying advection field from |
| int | adv_arr_size |
Size of the advection array: depends on whether advection coeff is constant or spatially-varying |
| double * | a |
advection speed for each variable along each dimension |
| double * | d |
diffusion coefficient for each variable along each dimension |
| char | centered_flux[_MAX_STRING_SIZE_] |
turn off upwinding and just take arithmetic average of left and right biased fluxes? |
| #define _LINEAR_ADVECTION_DIFFUSION_REACTION_ "linear-advection-diffusion-reaction" |
Linear advection-diffusion-reaction model
Definition at line 21 of file linearadr.h.
| int LinearADRInitialize | ( | void * | s, |
| void * | m | ||
| ) |
Initialize the linear advection-diffusion-reaction model
Initialize the linear advection-diffusion-reaction physics module - allocate and set physics-related parameters, read physics-related inputs from file, and set the physics-related function pointers in HyPar
This file reads the file "physics.inp" that must have the following format:
begin
<keyword> <value>
<keyword> <value>
<keyword> <value>
...
<keyword> <value>
end
where the list of keywords are:
| Keyword name | Type | Variable | Default value -------— |
|---|---|---|---|
| advection_filename | char[] | LinearADR::adv_filename | "none" |
| advection | double[] | LinearADR::a | 0 |
| diffusion | double[] | LinearADR::d | 0 |
| centered_flux | char[] | LinearADR::centered_flux | "no" |
Note:
| s | Solver object of type HyPar |
| m | Object of type MPIVariables containing MPI-related info |
Definition at line 59 of file LinearADRInitialize.c.
| int LinearADRCleanup | ( | void * | s | ) |
Clean up the linear advection-diffusion-reaction model
| s | Solver object of type HyPar |
Definition at line 10 of file LinearADRCleanup.c.