|
rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
|
Unit tests for hydroStep()'s boundary geometry and its input guards. More...
#include "models/nrp/HydroStep.h"#include "thermo/GammaLawThermo.h"#include <gtest/gtest.h>#include <algorithm>#include <cmath>#include <stdexcept>#include <vector>Go to the source code of this file.
Unit tests for hydroStep()'s boundary geometry and its input guards.
Two things live here that the Python suite reaches only indirectly. The first is WHERE the two ghost cells sit: a closed-form ghost filled at the face radius lands half a cell inside where the ghost is, which under a prescribed equation of state is an O(1) error in the boundary cell that refinement does not remove (NUMERICS.md section 7.6). Here the radius can be read straight out of the callback instead of being inferred from a converged error. The second is the guard set: every throw is a precondition a caller can trip, and EXPECT_THROW is the only way to cover them without a crafted array for each one.
The recording accessor below is what makes both cheap. It is a ThermoAccessor that answers like a gamma-law gas and writes down every radius it was asked about, which is exactly what PrescribedPressureThermo exposes to the Python cases, without a callable crossing a language boundary.
Definition in file HydroStep_test.cpp.