Functions
hydrodynamics_2d.hpp File Reference

Various manipulations of hydrodynamic variables. More...

#include "spatial_distribution2d.hpp"
#include "../common/equation_of_state.hpp"
#include "point_motion.hpp"
#include "spatial_reconstruction.hpp"
#include "SourceTerm.hpp"
#include "../../misc/utils.hpp"
#include "../../misc/lazy_list.hpp"
#include "../common/hydrodynamics.hpp"
#include "../../misc/universal_error.hpp"
#include "../../tessellation/ConvexHull.hpp"
#include "../../tessellation/polygon_overlap_area.hpp"
#include <boost/scoped_ptr.hpp>
#include "../../tessellation/EdgeLengthCorrect.hpp"
#include "physical_geometry.hpp"
#include "time_step_function.hpp"
#include "cache_data.hpp"
#include "../common/riemann_solver.hpp"
Include dependency graph for hydrodynamics_2d.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Primitive RotatePrimitive (const Vector2D &normaldir, const Vector2D &paraldir, const Primitive &p)
 Rotates primitive variables to align with edge. More...
 
Conserved RotateFluxBack (const Conserved &c, const Vector2D &n, const Vector2D &p)
 Rotates flux from the edge frame back to the lab frame. More...
 
int get_other_index (const Edge &edge, const int index)
 Given an edge and an index of one neighbor, returns the index of another neighbor. More...
 
vector< PrimitiveInitialiseCells (SpatialDistribution const &density, SpatialDistribution const &pressure, SpatialDistribution const &xvelocity, SpatialDistribution const &yvelocity, EquationOfState const &eos, Tessellation const &tess, bool CMvalue=true)
 Initialize computational cells. More...
 
vector< ConservedCalcConservedIntensive (vector< Primitive > const &cells)
 Calculates the intensive conserved variables. More...
 
vector< ConservedCalcConservedExtensive (const vector< Conserved > &cons_int, const Tessellation &tess, const PhysicalGeometry &pg)
 Calculates the extensive conserved variables. More...
 
double TimeStepForCell (Primitive const &cell, double width, vector< Vector2D > const &face_velocites)
 Calculates the time step for a cell. More...
 
vector< int > MoveMeshPoints (vector< Vector2D > const &pointvelocity, double dt, Tessellation &tessellation, bool reorder, vector< Vector2D > oldpoints=vector< Vector2D >())
 Move mesh points. More...
 
vector< int > MoveMeshPoints (vector< Vector2D > const &pointvelocity, double dt, Tessellation &tessellation, Tessellation const &vproc, bool reorder, vector< Vector2D > oldpoints=vector< Vector2D >())
 Move mesh points. More...
 
vector< Conservedcalc_conserved_intensive (const Tessellation &tess, const vector< Conserved > &extensive, const PhysicalGeometry &pg)
 Calculates the intensive conserved variables. More...
 
void UpdateConservedIntensive (Tessellation const &tessellation, vector< Conserved > const &conservedextensive, vector< Conserved > &conservedintensive)
 Updates the intensive conserved variables. More...
 
Conserved FluxInBulk (Vector2D const &normaldir, Vector2D const &paraldir, Primitive const &left, Primitive const &right, Vector2D const &edge_velocity, RiemannSolver const &rs)
 Calculates the flux in the bulk of the fluid. More...
 
void ExternalForceContribution (const Tessellation &tess, const PhysicalGeometry &pg, const CacheData &cd, const vector< ComputationalCell > &cells, const vector< Extensive > &fluxes, const vector< Vector2D > &point_velocities, const SourceTerm &source, double t, double dt, vector< Extensive > &extensives, TracerStickerNames const &tracerstickernames)
 Adds force contribution to the extensive conserved variables. More...
 
vector< Vector2Dget_all_mesh_points (Tessellation const &tess)
 Returns the position of all mesh generating points. More...
 
vector< Primitivemake_eos_consistent (vector< Primitive > const &vp, EquationOfState const &eos)
 Changes the energy and sound speed so they would satisfy the equation of state. More...
 
vector< double > GetForceEnergy (Tessellation const &tess, vector< double > const &g)
 Returns the energies due to external potentials. More...
 
vector< vector< double > > calc_extensive_tracer (const vector< vector< double > > &intensive_tracer, const Tessellation &tess, const vector< Primitive > &cells, const PhysicalGeometry &pg)
 Calculates extensive tracers. More...
 
void MakeTracerExtensive (vector< vector< double > > const &tracer, Tessellation const &tess, vector< Primitive > const &cells, vector< vector< double > > &result)
 Calculates the extensive tracer. More...
 
void GetPointToRemove (Tessellation const &tess, Vector2D const &point, double R, vector< int > &PointToRemove, int Inner)
 Makes a list of points to remove. More...
 
void FixAdvection (vector< Conserved > &extensive, vector< Conserved > const &intensive, Tessellation const &tessold, Tessellation const &tessnew, vector< Vector2D > const &facevelocity, double dt, vector< Vector2D > const &pointvelocity)
 Applies a correction to the extensive variables due to the change in volume during time step. More...
 
double determine_time_step (double hydro_time_step, double external_dt, double current_time, double end_time)
 Determines the time step. More...
 

Detailed Description

Various manipulations of hydrodynamic variables.

Author
Almog Yalinewich

Definition in file hydrodynamics_2d.hpp.

Function Documentation

◆ calc_conserved_intensive()

vector<Conserved> calc_conserved_intensive ( const Tessellation tess,
const vector< Conserved > &  extensive,
const PhysicalGeometry pg 
)

Calculates the intensive conserved variables.

Parameters
tessTessellation
extensiveExtensive conserved variables
pgPhysical geometry
Returns
List of intensive conserved variables

Definition at line 296 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calc_extensive_tracer()

vector<vector<double> > calc_extensive_tracer ( const vector< vector< double > > &  intensive_tracer,
const Tessellation tess,
const vector< Primitive > &  cells,
const PhysicalGeometry pg 
)

Calculates extensive tracers.

Parameters
intensive_tracerIntensive tracers
tessTessellation
cellsList of primitive variables
pgPhysical geometry
Returns
List of extensive tracers

Definition at line 453 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalcConservedExtensive()

vector<Conserved> CalcConservedExtensive ( const vector< Conserved > &  cons_int,
const Tessellation tess,
const PhysicalGeometry pg 
)

Calculates the extensive conserved variables.

Parameters
cons_intConserved intensive variables
tessTessellation
pgPhysical geometry
Returns
List of conserved variables

Definition at line 190 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalcConservedIntensive()

vector<Conserved> CalcConservedIntensive ( vector< Primitive > const &  cells)

Calculates the intensive conserved variables.

Parameters
cellsHydrodynamical cells
Returns
List of conserved variables

Definition at line 133 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ determine_time_step()

double determine_time_step ( double  hydro_time_step,
double  external_dt,
double  current_time,
double  end_time 
)

Determines the time step.

Parameters
hydro_time_stepTime step derived from hydrodynamics
external_dtTime step suggested by user
current_timeCurrent simulation time
end_timeTermination time
Returns
Time step

Definition at line 566 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:

◆ ExternalForceContribution()

void ExternalForceContribution ( const Tessellation tess,
const PhysicalGeometry pg,
const CacheData cd,
const vector< ComputationalCell > &  cells,
const vector< Extensive > &  fluxes,
const vector< Vector2D > &  point_velocities,
const SourceTerm source,
double  t,
double  dt,
vector< Extensive > &  extensives,
TracerStickerNames const &  tracerstickernames 
)

Adds force contribution to the extensive conserved variables.

Parameters
tessTessellation
pgPhysical geometry
cdCache data
cellsComputational cells
fluxesFluxes
point_velocitiesVelocities of the mesh generating points
sourceSource term
tTime
dtTime step
extensivesExtensive variables
tracerstickernamesThe names of the tracers and stickers

Definition at line 349 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FixAdvection()

void FixAdvection ( vector< Conserved > &  extensive,
vector< Conserved > const &  intensive,
Tessellation const &  tessold,
Tessellation const &  tessnew,
vector< Vector2D > const &  facevelocity,
double  dt,
vector< Vector2D > const &  pointvelocity 
)

Applies a correction to the extensive variables due to the change in volume during time step.

This method calculates the change in extensive by calculating the volume swept by an edge and multiplying it by the intensive variables of the respective cell.

Parameters
extensiveExtensive variables
intensiveIntensive variables
tessoldOld tessellation
tessnewNew tessellation
facevelocityFace velocity
dtTime step
pointvelocityVelocities of mesh generating points

Definition at line 496 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:

◆ FluxInBulk()

Conserved FluxInBulk ( Vector2D const &  normaldir,
Vector2D const &  paraldir,
Primitive const &  left,
Primitive const &  right,
Vector2D const &  edge_velocity,
RiemannSolver const &  rs 
)

Calculates the flux in the bulk of the fluid.

Parameters
normaldirA unit vector normal to the interface
paraldirA unit vector parallel to the interface
leftPrimitive variables on the left side of the interface
rightPrimitive variables on the right side of the interface
edge_velocityVelocity of the interface
rsRiemann solver
Returns
Flux

Definition at line 334 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:

◆ get_all_mesh_points()

vector<Vector2D> get_all_mesh_points ( Tessellation const &  tess)

Returns the position of all mesh generating points.

Parameters
tessTessellation
Returns
Position of all mesh generating points

Definition at line 375 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_other_index()

int get_other_index ( const Edge edge,
const int  index 
)

Given an edge and an index of one neighbor, returns the index of another neighbor.

Parameters
edgeVoronoi edge
indexIndex of one neighbor
Returns
Index of the other neighbor

Definition at line 7 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:

◆ GetForceEnergy()

vector<double> GetForceEnergy ( Tessellation const &  tess,
vector< double > const &  g 
)

Returns the energies due to external potentials.

Parameters
tessTessellation
gTBA
Returns
TBA
Todo:
Add documentation

Definition at line 393 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:

◆ GetPointToRemove()

void GetPointToRemove ( Tessellation const &  tess,
Vector2D const &  point,
double  R,
vector< int > &  PointToRemove,
int  Inner 
)

Makes a list of points to remove.

Parameters
tessTessellation
pointTBA
RRadius?
PointToRemoveoutput
InnerTBA
Todo:
Add documentation

Definition at line 476 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:

◆ InitialiseCells()

vector<Primitive> InitialiseCells ( SpatialDistribution const &  density,
SpatialDistribution const &  pressure,
SpatialDistribution const &  xvelocity,
SpatialDistribution const &  yvelocity,
EquationOfState const &  eos,
Tessellation const &  tess,
bool  CMvalue = true 
)

Initialize computational cells.

Parameters
densityDensity distribution
pressurePressure distribution
xvelocityDistribution of the x component of the velocity
yvelocityDistribution of the y component of the velocity
eosEquation of state
tessTessellation
CMvalueDetermines whether to evaluate the spatial distributions in the mesh generating points or the center of mass
Returns
List of primitive variables

Definition at line 95 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_eos_consistent()

vector<Primitive> make_eos_consistent ( vector< Primitive > const &  vp,
EquationOfState const &  eos 
)

Changes the energy and sound speed so they would satisfy the equation of state.

Parameters
vpPrimitive variables
eosEquation of state
Returns
Primitive variable with corrected sound speed and energy

Definition at line 384 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:

◆ MakeTracerExtensive()

void MakeTracerExtensive ( vector< vector< double > > const &  tracer,
Tessellation const &  tess,
vector< Primitive > const &  cells,
vector< vector< double > > &  result 
)

Calculates the extensive tracer.

Parameters
tracerIntensive tracer
tessTessellation
cellsFluid elements
resultList of extensive tracers

Definition at line 464 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:

◆ MoveMeshPoints() [1/2]

vector<int> MoveMeshPoints ( vector< Vector2D > const &  pointvelocity,
double  dt,
Tessellation tessellation,
bool  reorder,
vector< Vector2D oldpoints = vector< Vector2D >() 
)

Move mesh points.

Parameters
pointvelocityVelocities of all mesh points
dtTime step
tessellationTessellation
oldpointsPossible input for the location of the old points
reorderShould we reorder the points
Returns
The indeces of the hilbert order of the points

Definition at line 235 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MoveMeshPoints() [2/2]

vector<int> MoveMeshPoints ( vector< Vector2D > const &  pointvelocity,
double  dt,
Tessellation tessellation,
Tessellation const &  vproc,
bool  reorder,
vector< Vector2D oldpoints = vector< Vector2D >() 
)

Move mesh points.

Parameters
pointvelocityVelocities of all mesh points
dtTime step
tessellationThe local tessellation
vprocThe processor tessellation
oldpointsPossible input for the location of the old points
reorderShould we reorder the points
Returns
The indeces of the hilbert order of the points

Definition at line 250 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:

◆ RotateFluxBack()

Conserved RotateFluxBack ( const Conserved c,
const Vector2D n,
const Vector2D p 
)

Rotates flux from the edge frame back to the lab frame.

Parameters
cFlux
nNormal direction
pParallel direction
Returns
Rotated flux

Definition at line 324 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RotatePrimitive()

Primitive RotatePrimitive ( const Vector2D normaldir,
const Vector2D paraldir,
const Primitive p 
)

Rotates primitive variables to align with edge.

Parameters
normaldirNormal directions
paraldirParallel direction
pPrimitive variables
Returns
Rotated cell

Definition at line 314 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TimeStepForCell()

double TimeStepForCell ( Primitive const &  cell,
double  width,
vector< Vector2D > const &  face_velocites 
)

Calculates the time step for a cell.

Parameters
cellComputational cell
widthCell width
face_velocitesVelocities of the edges of the cell
Returns
Time step

Definition at line 197 of file hydrodynamics_2d.cpp.

Here is the call graph for this function:

◆ UpdateConservedIntensive()

void UpdateConservedIntensive ( Tessellation const &  tessellation,
vector< Conserved > const &  conservedextensive,
vector< Conserved > &  conservedintensive 
)

Updates the intensive conserved variables.

Parameters
tessellationTessellation
conservedextensiveExtensive conserved variables
conservedintensiveIntensive conserved variables

Definition at line 303 of file hydrodynamics_2d.cpp.

Here is the call graph for this function: