1 #include "modular_flux_calculator.hpp" 3 #include "../../misc/utils.hpp" 8 sr_(sr), rs_(rs), interpolated_(vector<pair<ComputationalCell, ComputationalCell> >()) {}
12 pair<Vector2D, Vector2D> calc_parallel_normal(
const Tessellation& tess,
const Edge& edge)
15 return pair<Vector2D, Vector2D>(
Vector2D(n.
y, -n.
x), n);
18 Extensive convert_conserved_to_extensive(
const Conserved& conserved,
const pair<ComputationalCell, ComputationalCell>& cells)
24 res.
tracers.resize(cells.first.tracers.size());
26 for (
size_t i = 0; i < N; ++i)
27 res.
tracers[i] = conserved.
Mass*(conserved.
Mass>0 ? cells.first.tracers[i] : cells.second.tracers[i]);
34 const vector<ComputationalCell>& cells,
const vector<Extensive>& ,
const CacheData& cd,
39 pair<ComputationalCell, ComputationalCell>(cells[0], cells[0]));
40 sr_(tess, cells, time, interpolated_, tracerstickernames,cd);
41 vector<bool> flags(static_cast<size_t>(tess.
getAllEdges().size()),
false);
43 for (
size_t i = 0; i < tess.
getAllEdges().size(); ++i)
48 const pair<Vector2D, Vector2D> p_n = calc_parallel_normal(tess, tess.
getAllEdges().at(i));
50 const double speed =
ScalarProd(p_n.second, edge_velocities.at(i)) /
abs(p_n.second);
53 (interpolated_.at(i).first, eos,tracerstickernames);
56 (interpolated_.at(i).second, eos,tracerstickernames);
58 convert_conserved_to_extensive
60 (rs_, p_left, p_right,
61 speed, p_n.second, p_n.first), interpolated_.at(i));
Set of conserved variables (extensive)
Vector2D Momentum
Momentum.
vector< Extensive > operator()(const Tessellation &tess, const vector< Vector2D > &edge_velocities, const vector< ComputationalCell > &cells, const vector< Extensive > &extensives, const CacheData &cd, const EquationOfState &eos, const double time, const double dt, TracerStickerNames const &tracerstickernames) const
Calculates fluxes.
Spatial reconstruction of the primitive functions.
Abstract class for tessellation.
Vector2D momentum
momentum, in relativity it is = rho*h*gamma*v
Primitive convert_to_primitive(const ComputationalCell &cell, const EquationOfState &eos, TracerStickerNames const &tracerstickernames)
Converts computational cell to primitive variables.
double mass
rest mass times gamma
Interface between two cells.
virtual Vector2D GetMeshPoint(int index) const =0
Returns Position of mesh generating point.
ModularFluxCalculator(const SpatialReconstruction &sr, const RiemannSolver &rs)
Class constructor.
double Energy
Total energy (kinetic + thermal)
double energy
energy, in relativity it is = rho*h*gamma^2-P-rho
double y
Component in the y direction.
Base class for Riemann solver.
Conserved rotate_solve_rotate_back(const RiemannSolver &rs, const Primitive &left, const Primitive &right, const double velocity, const Vector2D &n, const Vector2D &p)
Rotates, solve riemann problem and rotates results back.
double ScalarProd(Vector3D const &v1, Vector3D const &v2)
Scalar product of two vectors.
virtual const vector< Edge > & getAllEdges(void) const =0
Returns reference to the list of all edges.
Base class for equation of state.
Container for cache data.
Vector2D normalize(const Vector2D &v)
Normalized a vector.
Class for keeping the names of the tracers and stickers.
virtual int GetTotalSidesNumber(void) const =0
Returns the total number of faces.
std::pair< int, int > neighbors
Neighboring cells.
double abs(Vector3D const &v)
Norm of a vector.
Primitive hydrodynamic variables.
double x
Component in the x direction.