CppNoddy  0.92
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CppNoddy::Example::Euler_1d Class Reference

Define the system. More...

Inheritance diagram for CppNoddy::Example::Euler_1d:
CppNoddy::OneD_Hyperbolic_System CppNoddy::Uncopyable

Public Member Functions

 Euler_1d ()
 One dimemsional Euler problem, so 3rd order. More...
 
void flux_fn (const double &x, const DenseVector< double > &q, DenseVector< double > &f) const
 Define the vector flux. More...
 
double max_charac_speed (const DenseVector< double > &q) const
 Bound the shock speed. More...
 
- Public Member Functions inherited from CppNoddy::OneD_Hyperbolic_System
 OneD_Hyperbolic_System (const unsigned &order)
 
virtual ~OneD_Hyperbolic_System ()
 An empty destructor, virtual since we have virtual methods. More...
 
virtual void flux_fn (const double &x, const DenseVector< double > &q, DenseVector< double > &f) const
 A virtual flux function. More...
 
virtual void Jac_flux_fn (const double &x, const DenseVector< double > &q, DenseMatrix< double > &J) const
 A virtual function function to define the Jacobian of the flux function. More...
 
virtual double max_charac_speed (const DenseVector< double > &q) const
 A virtual method that is used to bound the shock speed and must be implemented by the user. More...
 
virtual bool_vec edge_values (const int face_index, const double &x, DenseVector< double > &q, const double &t=0.0) const
 Define the edge boundary conditions. More...
 
virtual void source_fn (const double &x, const DenseVector< double > &q, const DenseVector< double > &slope, DenseVector< double > &r) const
 
unsigned get_order ()
 

Additional Inherited Members

- Protected Attributes inherited from CppNoddy::OneD_Hyperbolic_System
const std::size_t ORDER_OF_SYSTEM
 The order of the system of equations. More...
 

Detailed Description

Define the system.

Definition at line 28 of file HYPSodsShocktube.cpp.

Constructor & Destructor Documentation

◆ Euler_1d()

CppNoddy::Example::Euler_1d::Euler_1d ( )
inline

One dimemsional Euler problem, so 3rd order.

Definition at line 34 of file HYPSodsShocktube.cpp.

35 {}
A class to represent a one dimensional hyperbolic system of equations.

Member Function Documentation

◆ flux_fn()

void CppNoddy::Example::Euler_1d::flux_fn ( const double &  x,
const DenseVector< double > &  q,
DenseVector< double > &  f 
) const
inlinevirtual

Define the vector flux.

Reimplemented from CppNoddy::OneD_Hyperbolic_System.

Definition at line 38 of file HYPSodsShocktube.cpp.

39 {
40 double u = q[ m ] / q[ rho ];
41 double p = ( gamma - 1. ) * ( q[ E ] - 0.5 * q[ rho ] * u * u );
42 f[ rho ] = q[ m ];
43 f[ m ] = q[ rho ] * u * u + p;
44 f[ E ] = u * ( q[ E ] + p );
45 }
@ f
Definition: BVPBerman.cpp:15
double gamma(1.4)
Adiabatic index – ratio of specific heats.

References E, f, CppNoddy::Example::gamma(), m, p, rho, and u.

◆ max_charac_speed()

double CppNoddy::Example::Euler_1d::max_charac_speed ( const DenseVector< double > &  q) const
inlinevirtual

Bound the shock speed.

Reimplemented from CppNoddy::OneD_Hyperbolic_System.

Definition at line 48 of file HYPSodsShocktube.cpp.

49 {
50 // sound speeds
51 double u = q[ m ] / q[ rho ];
52 double p = ( gamma - 1. ) * ( q[ E ] - 0.5 * q[ rho ] * u * u );
53 double c = sqrt( gamma * p / q[ rho ] );
54 // maximum shock speed
55 return std::max( u + c, u - c );
56 }

References E, CppNoddy::Example::gamma(), m, p, rho, and u.


The documentation for this class was generated from the following file:

© 2012

R.E. Hewitt