simple_flux_calculator_1d.cpp
2 #include "flux_conversion.hpp"
3 
5 (const RiemannSolver& rs,
6  const SpatialReconstruction1D& interp,
7  const BoundaryConditions1D& bc):
8  rs_(rs),
9  interp_(interp),
10  bc_(bc) {}
11 
12 vector<Extensive> SimpleFluxCalculator1D::operator()
13 (const SimulationState1D& ss,
14  const vector<double>& vertex_velocity,
15  const EquationOfState& eos,
16  const double dt) const
17 {
18  // Bulk
19  vector<Extensive> res(ss.getVertices().size());
20  const vector<Primitive> primitives = ccs2primitives
21  (ss.getCells(), eos);
22  for(size_t i=1;i<ss.getVertices().size()-1;++i){
23  const Primitive left = interp_
24  (ss.getVertices(),
25  primitives,
26  vertex_velocity.at(i),
27  i,
28  0,
29  dt);
30  const Primitive right = interp_
31  (ss.getVertices(),
32  primitives,
33  vertex_velocity.at(i),
34  i,
35  1,
36  dt);
37  const Conserved hydro_flux = rs_(left, right, vertex_velocity.at(i));
38  res.at(i) = flux2extensive(hydro_flux,
39  ss.getCells().at(i-1),
40  ss.getCells().at(i));
41  }
42 
43  // Boundary conditions
44  res.front() = bc_(ss,
45  eos,
46  rs_,
47  vertex_velocity,
48  false);
49  res.back() = bc_(ss,
50  eos,
51  rs_,
52  vertex_velocity,
53  true);
54  return res;
55 }
Set of conserved variables (extensive)
const vector< double > & getVertices(void) const
Access to vertices.
Base class for spatial reconstruction.
Base class for Riemann solver.
const vector< ComputationalCell > & getCells(void) const
Access to hydro cells.
Base class for equation of state.
SimpleFluxCalculator1D(const RiemannSolver &rs, const SpatialReconstruction1D &interp, const BoundaryConditions1D &bc)
Class constructor.
Simple flux calculator.
Primitive hydrodynamic variables.
Base class for boundary conditions.
Package for computational domain and hydro cells.