ODE examples (C++, Python)
# | Files | Description |
---|---|---|
1. |
C++ model: ode_example_1.cpp roberts.h Python model: tutorial_opencs_ode_1.py tutorial_opencs_aux.py Original model results: tutorial_opencs_ode_1.csv |
Reimplementation of CVodes cvsRoberts_dns example.
The Roberts chemical kinetics problem with 3 rate equations: The problem is solved on the time interval from 0.0 <= t <= 4.e10, with initial conditions: The problem is stiff. Run instructions: ode_example_1
or
python tutorial_opencs_ode_1.py
The program will generate OpenCS model into the ode_example_1-sequential
directory and perform a single CPU simulation.
|
2. |
C++ model: ode_example_2.cpp advection_diffusion_2d.h Python model: tutorial_opencs_ode_2.py tutorial_opencs_aux.py Original model results: tutorial_opencs_ode_2.csv |
Reimplementation of CVodes cvsAdvDiff_bnd example.
The problem is simple advection-diffusion in 2-D: on the rectangle 0 <= x <= 2, 0 <= y <= 1, and the time interval 0 <= t <= 1. Homogeneous Dirichlet boundary conditions are imposed, with the initial conditions: The PDE is discretized on a uniform Nx+2 by Ny+2 grid with central differencing. The boundary points are eliminated leaving an ODE system of size Nx x Ny. Run instructions: ode_example_2 Nx Ny
or
python tutorial_opencs_ode_2.py Nx Ny
where Nx and Ny are number of points in x and y domains, respectively.
If omitted, the default grid size Nx=10 and Ny=5 will be used.
The program will generate OpenCS model into the ode_example_2-sequential directory and perform a single CPU simulation. |
3. |
C++ model: ode_example_3.cpp diurnal_kinetics_2d.h Python model: tutorial_opencs_ode_3.py tutorial_opencs_aux.py Original model results: tutorial_opencs_ode_3.csv |
Reimplementation of CVodes cvsDiurnal_kry example.
2-species diurnal kinetics advection-diffusion PDE system in 2D: where Kh, V, Kv0, q1, q2, and c3 are constants, and q3(t) and q4(t) vary diurnally. The problem is posed on the square: 0 <= x <= 20 (km) and 30 <= y <= 50 (km), with homogeneous Neumann boundary conditions, and integrated for time t in 0 <= t <= 86400 sec (1 day). The PDE system is discretised using the central differences on a uniform 10 x 10 mesh. Run instructions: ode_example_3 Nx Ny
or
python tutorial_opencs_ode_3.py Nx Ny
where Nx and Ny are number of points in x and y domains, respectively.
If omitted, the default grid size Nx=80 and Ny=80 will be used.
The program will generate OpenCS model into the ode_example_3-sequential directory and perform a single CPU simulation. In addition, the OpenCS model for MPI simulation on 8 nodes will be generated in the ode_example_3-Npe=8-2D_Npde directory. Parallel simulation can be started from the examples directory on GNU/Linux and macOS: mpirun -np 8 ../bin/csSimulator ode_example_3-Npe=8-2D_Npde
and on Windows:
mpiexec -n 8 ../bin/csSimulator ode_example_3-Npe=8-2D_Npde
|
DAE examples (C++, Python)
# | Files | Description |
---|---|---|
1. |
C++ model: dae_example_1.cpp chemical_kinetics.h Python model: tutorial_opencs_dae_1.py tutorial_opencs_aux.py Original model results: tutorial_opencs_dae_1.csv |
Reimplementation of IDAS idasAkzoNob_dns example.
The chemical kinetics problem with 6 non-linear diff. equations. The system is stiff. Run instructions: dae_example_1
or
python tutorial_opencs_dae_1.py
The program will generate OpenCS model into the dae_example_1-sequential directory and perform a single CPU simulation. |
2. |
C++ model: dae_example_2.cpp heat_conduction_2d.h Python model: tutorial_opencs_dae_2.py tutorial_opencs_aux.py Original model results: tutorial_opencs_dae_2.csv |
Reimplementation of DAE Tools tutorial1.py example.
A simple heat conduction problem: conduction through a very thin, rectangular copper plate. Two-dimensional Cartesian grid (x,y) of 20 x 20 elements. Run instructions: dae_example_2 Nx Ny
or
python tutorial_opencs_dae_2.py Nx Ny
where Nx and Ny are number of points in x and y domains, respectively.
If omitted, the default grid size Nx=20 and Ny=20 will be used.
The program will generate OpenCS model into the dae_example_2-sequential directory and perform a single CPU simulation. |
3. |
C++ model: dae_example_3.cpp brusselator_2d.h Python model: tutorial_opencs_dae_3.py tutorial_opencs_aux.py Original model results: tutorial_opencs_dae_3.csv |
Reimplementation of IDAS idasBruss_kry_bbd_p example.
The PDE system is a two-species time-dependent PDE known as Brusselator PDE and models a chemically reacting system: BCs: Homogenous Neumann. ICs: The PDEs are discretised by central differencing on a Nx x Ny grid. Run instructions: dae_example_3 Nx Ny
or
python tutorial_opencs_dae_3.py Nx Ny
where Nx and Ny are number of points in x and y domains, respectively.
If omitted, the default grid size Nx=82 and Ny=82 will be used.
The program will generate OpenCS model into the dae_example_3-sequential directory and perform a single CPU simulation. In addition, the OpenCS model for MPI simulation on 8 nodes will be generated in the dae_example_3-Npe=8-2D_Npde directory. Parallel simulation can be started from the examples directory on GNU/Linux and macOS: mpirun -np 8 ../bin/csSimulator dae_example_3-Npe=8-2D_Npde
and on Windows:
mpiexec -n 8 ../bin/csSimulator dae_example_3-Npe=8-2D_Npde
|