Carmen Code
 All Classes Files Functions Variables Macros Pages
Functions
Flux.cpp File Reference

Computes the numerical fluxes HLL and HLLD. More...

#include "Carmen.h"
Include dependency graph for Flux.cpp:

Functions

Vector Flux (Cell &Cell1, Cell &Cell2, Cell &Cell3, Cell &Cell4, int AxisNo)
 Returns the flux at the interface between Cell2 and Cell3. Here a 4-point space scheme is used. Cell2 and Cell3 are the first neighbours on the left and right sides. Cell1 and Cell4 are the second neighbours on the left and right sides. More...
 

Detailed Description

Computes the numerical fluxes HLL and HLLD.

Function Documentation

Vector Flux ( Cell Cell1,
Cell Cell2,
Cell Cell3,
Cell Cell4,
int  AxisNo 
)

Returns the flux at the interface between Cell2 and Cell3. Here a 4-point space scheme is used. Cell2 and Cell3 are the first neighbours on the left and right sides. Cell1 and Cell4 are the second neighbours on the left and right sides.

Parameters
Cell1second neighbour on the left side
Cell2first neighbour on the left side
Cell3first neighbour on the right side
Cell4second neighbour on the right side
AxisNoAxis of interest
Returns
Vector
23 {
24  // --- Local variables ---
25 
26  Vector Result(QuantityNb);
27 
28  Cell C1, C2, C3, C4;
29 
30  int BoundaryCell1 = BoundaryRegion(Cell1.center());
31  int BoundaryCell2 = BoundaryRegion(Cell2.center());
32  int BoundaryCell3 = BoundaryRegion(Cell3.center());
33  int BoundaryCell4 = BoundaryRegion(Cell4.center());
34 
35  bool UseBoundaryCells = (UseBoundaryRegions && (BoundaryCell1!=0 || BoundaryCell2!=0 || BoundaryCell3!=0 || BoundaryCell4!=0));
36 
37  // --- Take into account boundary conditions ---
38 
39  if (UseBoundaryCells)
40  GetBoundaryCells(Cell1, Cell2, Cell3, Cell4, C1, C2, C3, C4, AxisNo);
41 
42  switch(SchemeNb)
43  {
44  case 1:
45  default:
46  if (UseBoundaryCells)
47  Result = SchemeHLL(C1, C2, C3, C4, AxisNo);
48  else
49  Result = SchemeHLL(Cell1, Cell2, Cell3, Cell4, AxisNo);
50  break;
51 
52  case 2:
53  if (UseBoundaryCells)
54  Result = SchemeHLLD(C1, C2, C3, C4, AxisNo);
55  else
56  Result = SchemeHLLD(Cell1, Cell2, Cell3, Cell4, AxisNo);
57  break;
58  break;
59 
60  }
61 
62 
63  return Result;
64 }
An object Cell contains all the informations of a cell for both multiresolution and finite volume com...
Definition: Cell.h:41
real center(const int AxisNo) const
Returns the component no. AxisNo of the cell-center position.
Definition: Cell.h:1112
int QuantityNb
Definition: Parameters.cpp:171
Standard class for every vector in Carmen.
Definition: Vector.h:29
void GetBoundaryCells(Cell &Cell1, Cell &Cell2, Cell &Cell3, Cell &Cell4, Cell &C1, Cell &C2, Cell &C3, Cell &C4, int AxisNo)
Transform the 4 cells of the flux Cell1, Cell2, Cell3, Cell4 into C1, C2, C3, C4, to take into accoun...
Definition: GetBoundaryCells.cpp:24
int BoundaryRegion(const Vector &X)
Returns the boundary region type at the position X=(x,y,z). The returned value correspond to: 0 = Fl...
Definition: BoundaryRegion.cpp:63
int SchemeNb
Definition: Parameters.cpp:67
Vector SchemeHLL(const Cell &Cell1, const Cell &Cell2, const Cell &Cell3, const Cell &Cell4, const int AxisNo)
Returns the HLL numerical flux for MHD equations. The scheme uses four cells to estimate the flux at ...
Definition: SchemeHLL.cpp:11
bool UseBoundaryRegions
Definition: Parameters.cpp:80
Vector SchemeHLLD(const Cell &Cell1, const Cell &Cell2, const Cell &Cell3, const Cell &Cell4, const int AxisNo)
Returns the HLLD numerical flux for MHD equations. The scheme uses four cells to estimate the flux at...
Definition: SchemeHLLD.cpp:12

Here is the caller graph for this function: