HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Containts the structures and definitions for boundary condition implementation. More...
#include <basic.h>
Go to the source code of this file.
Data Structures | |
struct | DomainBoundary |
Structure containing the variables and function pointers defining a boundary. More... | |
Macros | |
#define | _PERIODIC_ "periodic" |
#define | _EXTRAPOLATE_ "extrapolate" |
#define | _DIRICHLET_ "dirichlet" |
#define | _REFLECT_ "reflect" |
#define | _SPONGE_ "sponge" |
#define | _NOSLIP_WALL_ "noslip-wall" |
#define | _THERMAL_NOSLIP_WALL_ "thermal-noslip-wall" |
#define | _SLIP_WALL_ "slip-wall" |
#define | _THERMAL_SLIP_WALL_ "thermal-slip-wall" |
#define | _SUBSONIC_INFLOW_ "subsonic-inflow" |
#define | _SUBSONIC_OUTFLOW_ "subsonic-outflow" |
#define | _SUBSONIC_AMBIVALENT_ "subsonic-ambivalent" |
#define | _SUPERSONIC_INFLOW_ "supersonic-inflow" |
#define | _SUPERSONIC_OUTFLOW_ "supersonic-outflow" |
#define | _TURBULENT_SUPERSONIC_INFLOW_ "turbulent-supersonic-inflow" |
#define | _NO_FLUX_BC_ "numa-nfbc" |
#define | _SW_SLIP_WALL_ "shallow-water-slip-wall" |
#define | _SW_NOSLIP_WALL_ "shallow-water-noslip-wall" |
Functions | |
int | BCInitialize (void *, int) |
int | BCCleanup (void *, int) |
int | BCPeriodicU (void *, void *, int, int, int *, int, double *, double) |
int | BCExtrapolateU (void *, void *, int, int, int *, int, double *, double) |
int | BCDirichletU (void *, void *, int, int, int *, int, double *, double) |
int | BCReflectU (void *, void *, int, int, int *, int, double *, double) |
int | BCNoslipWallU (void *, void *, int, int, int *, int, double *, double) |
int | BCThermalNoslipWallU (void *, void *, int, int, int *, int, double *, double) |
int | BCSlipWallU (void *, void *, int, int, int *, int, double *, double) |
int | BCThermalSlipWallU (void *, void *, int, int, int *, int, double *, double) |
int | BCSubsonicInflowU (void *, void *, int, int, int *, int, double *, double) |
int | BCSubsonicOutflowU (void *, void *, int, int, int *, int, double *, double) |
int | BCSubsonicAmbivalentU (void *, void *, int, int, int *, int, double *, double) |
int | BCSupersonicInflowU (void *, void *, int, int, int *, int, double *, double) |
int | BCSupersonicOutflowU (void *, void *, int, int, int *, int, double *, double) |
int | BCTurbulentSupersonicInflowU (void *, void *, int, int, int *, int, double *, double) |
int | BCNoFluxU (void *, void *, int, int, int *, int, double *, double) |
int | BCSWSlipWallU (void *, void *, int, int, int *, int, double *, double) |
int | BCSpongeSource (void *, int, int, int, int *, double *, double *, double *) |
int | BCSpongeUDummy (void *, void *, int, int, int *, int, double *, double) |
int | BCReadTemperatureData (void *, void *, int, int, int *) |
int | BCReadTurbulentInflowData (void *, void *, int, int, int *) |
int | gpuBCPeriodicU (void *, void *, int, int, int *, int, double *, double) |
int | gpuBCSlipWallU (void *, void *, int, int, int *, int, double *, double) |
Containts the structures and definitions for boundary condition implementation.
Definition in file boundaryconditions.h.
#define _PERIODIC_ "periodic" |
Periodic boundary conditions
Definition at line 12 of file boundaryconditions.h.
#define _EXTRAPOLATE_ "extrapolate" |
Extrapolative boundary conditions (values at ghost cells are copied from interior)
Definition at line 14 of file boundaryconditions.h.
#define _DIRICHLET_ "dirichlet" |
Dirichlet boundary conditions (values at ghost cells specified through input)
Definition at line 16 of file boundaryconditions.h.
#define _REFLECT_ "reflect" |
Reflective boundary conditions (values at ghost cells negative of interior)
Definition at line 18 of file boundaryconditions.h.
#define _SPONGE_ "sponge" |
Sponge boundary conditions
Definition at line 20 of file boundaryconditions.h.
#define _NOSLIP_WALL_ "noslip-wall" |
Viscous wall boundary condition (specific to Navier-Stokes)
Definition at line 24 of file boundaryconditions.h.
#define _THERMAL_NOSLIP_WALL_ "thermal-noslip-wall" |
Viscous thermal wall boundary condition where wall temperature is specified (specific to Navier-Stokes)
Definition at line 26 of file boundaryconditions.h.
#define _SLIP_WALL_ "slip-wall" |
Inviscid wall boundary condition (specific to Euler/Navier-Stokes)
Definition at line 28 of file boundaryconditions.h.
#define _THERMAL_SLIP_WALL_ "thermal-slip-wall" |
Inviscid thermal wall boundary condition where wall temperature is specified (specific to Euler/Navier-Stokes)
Definition at line 30 of file boundaryconditions.h.
#define _SUBSONIC_INFLOW_ "subsonic-inflow" |
Subsonic inflow boundary condition: density and velocity are specified in the input, pressure is extrapolated from the interior (specific to Euler/Navier-Stokes)
Definition at line 32 of file boundaryconditions.h.
#define _SUBSONIC_OUTFLOW_ "subsonic-outflow" |
Subsonic outflow boundary condition: pressure is specified in the input, density and velocity are extrapolated from the interior (specific to Euler/Navier-Stokes)
Definition at line 34 of file boundaryconditions.h.
#define _SUBSONIC_AMBIVALENT_ "subsonic-ambivalent" |
Subsonic "ambivalent" boundary condition: (specific to Euler/Navier-Stokes) the velocity at the boundary is extrapolated from the interior, and based on that, either subsonic outflow or inflow boundary conditions are applied. Specify all flow quantities (density, velocity, and pressure) in the input; depending on whether it is inflow or outflow, the appropriate quantities will be used.
Definition at line 39 of file boundaryconditions.h.
#define _SUPERSONIC_INFLOW_ "supersonic-inflow" |
Supersonic inflow boundary condition: density, velocity, and pressure are specified in the input (specific to Euler/Navier-Stokes)
Definition at line 41 of file boundaryconditions.h.
#define _SUPERSONIC_OUTFLOW_ "supersonic-outflow" |
Supersonic outflow boundary condition: all flow quantities are extrapolated from the interior (specific to Euler/Navier-Stokes)
Definition at line 43 of file boundaryconditions.h.
#define _TURBULENT_SUPERSONIC_INFLOW_ "turbulent-supersonic-inflow" |
Turbulent, supersonic inflow boundary condition: density, velocity, and pressure are specified in the input, along with turbulent fluctuations (specific to Euler/Navier-Stokes)
Definition at line 45 of file boundaryconditions.h.
#define _NO_FLUX_BC_ "numa-nfbc" |
No-flux boundary condition (specific to NUMA)
Definition at line 49 of file boundaryconditions.h.
#define _SW_SLIP_WALL_ "shallow-water-slip-wall" |
Slip boundary condition (specific to shallow water equations)
Definition at line 53 of file boundaryconditions.h.
#define _SW_NOSLIP_WALL_ "shallow-water-noslip-wall" |
Viscous wall boundary condition (specific to shallow water equations) (not implemented yet)
Definition at line 55 of file boundaryconditions.h.
int BCInitialize | ( | void * | b, |
int | flag_gpu | ||
) |
Function to initialize the boundary conditions
Assign the function pointers for boundary condition application depending on the boundary type, for a given boundary object
b | Boundary object of type DomainBoundary |
flag_gpu | Flag to indicate if GPU is being used |
Definition at line 12 of file BCInitialize.c.
int BCCleanup | ( | void * | b, |
int | flag_gpu | ||
) |
Function to clean up boundary conditions-related variables and arrays
Cleans up a boundary object of type DomainBoundary
b | Boundary object of type DomainBoundary |
flag_gpu | Flag indicating if GPU is being used |
Definition at line 12 of file BCCleanup.c.
int BCPeriodicU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Periodic boundary conditions for the solution vector U
Applies periodic boundary conditions: Implemented by copying the solution from the other end of the domain into the physical boundary ghost points.
Note**: This function only acts if the the number of processors is 1 along the spatial dimension this boundary corresponds to. If there are more than 1 processors along this dimension, periodicity is handled by MPIExchangeBoundariesnD() to minimize communication.
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 19 of file BCPeriodic.c.
int BCExtrapolateU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
extrapolate boundary conditions for the solution vector U
Apply the extrapolative boundary condition: Values at the physical boundary ghost points are extrapolated from the interior points adjacent to the boundary
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 13 of file BCExtrapolate.c.
int BCDirichletU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Dirichlet boundary conditions for the solution vector U
Applies (steady) Dirichlet boundary conditions for the solution: the ghost points at the physical boundaries are set to specified values
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 13 of file BCDirichlet.c.
int BCReflectU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Reflection boundary conditions for the solution vector U
Applies the reflection boundary condition: The values at the physical boundary ghost points are set to the negative of the interior values adjacent to the boundary.
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 14 of file BCReflect.c.
int BCNoslipWallU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
No-slip wall (viscous) boundary conditions for the solution vector U
Applies the no-slip wall boundary conditions: Used to simulate viscous walls. The density and pressure at the physical boundary ghost points are extrapolated from the interior, while the velocities are set such that the interpolated velocity at the boundary face is the specified wall velocity. This boundary condition is specific to the two and three dimensional Navier-Stokes systems (NavierStokes2D, NavierStokes3D).
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 20 of file BCNoslipWall.c.
int BCThermalNoslipWallU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
No-slip thermal wall (viscous) boundary conditions for the solution vector U
Applies the thermal no-slip-wall boundary condition: This is specific to the 3D Navier-Stokes system (NavierStokes3D). It is used for simulating walls boundaries, where the temperature is specified. The density at the ghost points is extrapolated from the interior. The velocity at the ghost points is set such that the interpolated velocity at the boundary face is the specified wall velocity. The pressure at the ghost points is set by multiplying the extrapolated density by the specified temperature.
Note: It is assumed that the temperature already contains the gas constant factor, i.e., \( T = P/\rho\).
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 27 of file BCThermalNoslipWall.c.
int BCSlipWallU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Slip (inviscid) wall boundary conditions for the solution vector U
Applies the slip-wall boundary condition: This is specific to the two and three dimensional Euler and Navier-Stokes systems (Euler2D, NavierStokes2D, NavierStokes3D). It is used for simulating inviscid walls or symmetric boundaries. The pressure, density, and tangential velocity at the ghost points are extrapolated from the interior, while the normal velocity at the ghost points is set such that the interpolated value at the boundary face is equal to the specified wall velocity.
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 22 of file BCSlipWall.c.
int BCThermalSlipWallU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Slip (inviscid) thermal wall boundary conditions for the solution vector U
Applies the thermal slip-wall boundary condition: This is specific to the 3D Navier-Stokes system (NavierStokes3D). It is used for simulating inviscid walls or symmetric boundaries, where the temperature is specified. The density and the tangential velocity at the ghost points are extrapolated for the interior. The normal velocity at the ghost points is set such that the interpolated velocity at the boundary face is the specified wall velocity. The pressure at the ghost points is set by multiplying the extrapolated density by the specified temperature.
Note: It is assumed that the temperature already contains the gas constant factor, i.e., \( T = P/\rho\).
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 27 of file BCThermalSlipWall.c.
int BCSubsonicInflowU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Subsonic inflow boundary conditions for the solution vector U
Applies the subsonic inflow boundary condition: The density and velocity at the physical boundary ghost points are specified, while the pressure is extrapolated from the interior of the domain. This boundary condition is specific to two and three dimension Euler and Navier-Stokes systems (Euler2D, NavierStokes2D, NavierStokes3D).
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 20 of file BCSubsonicInflow.c.
int BCSubsonicOutflowU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Subsonic outflow boundary conditions for the solution vector U
Applies the subsonic outflow boundary condition: The pressure at the physical boundary ghost points is specified, while the density and velocity are extrapolated from the interior. This boundary condition is specific to two and three dimensional Euler/ Navier-Stokes systems (Euler2D, NavierStokes2D, NavierStokes3D).
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 19 of file BCSubsonicOutflow.c.
int BCSubsonicAmbivalentU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Subsonic "ambivalent" boundary conditions for the solution vector U
Applies the subsonic "ambivalent" boundary condition: The velocity at the boundary face is extrapolated from the interior and its dot product with the boundary normal (pointing into the domain) is computed.
This boundary condition is specific to two and three dimension Euler and Navier-Stokes systems (Euler2D, NavierStokes2D, NavierStokes3D).
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 28 of file BCSubsonicAmbivalent.c.
int BCSupersonicInflowU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Supersonic inflow boundary conditions for the solution vector U
Applies the supersonic (steady) inflow boundary condition: All the flow variables (density, pressure, velocity) are specified at the physical boundary ghost points, since it is supersonic inflow. This boundary condition is specific to two and three dimensional Euler/Navier-Stokes systems (Euler2D, NavierStokes2D, NavierStokes3D).
Note: the Dirichlet boundary condition (_DIRICHLET_) could be used as well for supersonic inflow; however the specified Dirichlet state should be in terms of the conserved variables, while the specified supersonic inflow state here is in terms of the flow variables.
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 24 of file BCSupersonicInflow.c.
int BCSupersonicOutflowU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Supersonic outflow boundary conditions for the solution vector U
Applies the supersonic outflow boundary condition: All flow variables (density, pressure, velocity) are extrapolated from the interior since the outflow is supersonic. This boundary condition is specific to two and three dimensional Euler/Navier-Stokes systems (Euler2D, NavierStokes2D, NavierStokes3D).
Note: The extrapolate boundary condition (_EXTRAPOLATE_) can be used as well for this boundary. I am not entirely sure why I wrote the code for this boundary in such a complicated fashion.
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 24 of file BCSupersonicOutflow.c.
int BCTurbulentSupersonicInflowU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Turbulent Supersonic inflow boundary conditions for the solution vector U
Applies the turbulent supersonic inflow boundary condition: The inflow consists of a mean supersonic inflow on which turbulent flow fluctuations are added. This boundary condition is specific to the 3D Navier-Stokes system (NavierStokes3D).
Note: Some parts of the code may be hardcoded for use with the shock-turbulence interaction problem (for which this boundary condition was written).
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 21 of file BCTurbulentSupersonicInflow.c.
int BCNoFluxU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
No-Flux (inviscid wall) boundary conditions for the solution vector U
Applies the no-flux boundary conditions: This boundary condition is specific to the NUMA 2D/3D (Numa2D, Numa3D). Used for simulating inviscid walls or symmetry boundaries. It's equivalent to the slip-wall BC of the Euler/Navier- Stokes system.
The density, potential temperature, and tangential velocity are extrapolated, while the normal velocity at the ghost point is set to the negative of that in the interior (to enforce zero-normal velocity at the boundary face).
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 22 of file BCNoFlux.c.
int BCSWSlipWallU | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
Slip (inviscid) wall boundary conditions for the solution vector U
Applies the slip-wall boundary condition: This is specific to the one and two dimenstional shallow water equations (ShallowWater1D, ShallowWater2D). It is used for simulating inviscid walls or symmetric boundaries. The height, and tangential velocity at the ghost points are extrapolated from the interior, while the normal velocity at the ghost points is set such that the interpolated value at the boundary face is equal to the specified wall velocity.
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 21 of file BCSWSlipWall.c.
int BCSpongeSource | ( | void * | b, |
int | ndims, | ||
int | nvars, | ||
int | ghosts, | ||
int * | size, | ||
double * | grid, | ||
double * | u, | ||
double * | source | ||
) |
a special BC enforcement - an absorbent sponge - enforced through a source term
Applies the sponge boundary condition: This function computes the source term required to apply a sponge boundary condition that gradually relaxes the solution to a specified state. This boundary condition is different from other boundary conditions in the sense that it is applied at interior grid points (but within the defined sponge zone).
The source term for the sponge is computed as:
\begin{align} {\bf S}_i &= \sigma_i \left( {\bf U}_i - {\bf U}_{\rm ref} \right),\\ \sigma_i &= \frac {x_i - x_{\rm start}} {x_{\rm end} - x_{\rm start}} \end{align}
where \(i\) is the grid index along the spatial dimension of the sponge, \({\bf U}_{\rm ref}\) is the specified state to which the solution is relaxed, and \(x_i\), \(x_{\rm start}\), and \(x_{\rm end}\) are the spatial coordinates of the grid point, sponge start, and sponge end, respectively, along the spatial dimension of the sponge.
b | Boundary object of type DomainBoundary |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
ghosts | Number of ghost points |
size | Integer array with the number of grid points in each spatial dimension |
grid | 1D array with the spatial coordinates of the grid points, one dimension after the other |
u | Solution |
source | Source term to which the sponge term is added |
Definition at line 26 of file BCSponge.c.
int BCSpongeUDummy | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | size, | ||
int | ghosts, | ||
double * | phi, | ||
double | waqt | ||
) |
dummy function that get called during applying BCs - they don't do anything
Dummy function to ensure consistency with the overall boundary condition implementation. The actual sponge boundary condition is implemented by BCSpongeSource()
b | Boundary object of type DomainBoundary |
m | MPI object of type MPIVariables |
ndims | Number of spatial dimensions |
nvars | Number of variables/DoFs per grid point |
size | Integer array with the number of grid points in each spatial dimension |
ghosts | Number of ghost points |
phi | The solution array on which to apply the boundary condition |
waqt | Current solution time |
Definition at line 73 of file BCSponge.c.
int BCReadTemperatureData | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | DomainSize | ||
) |
Function to read in unsteady temperature data for thermal slip wall BC (BCThermalSlipWallU())
Read in the temperature data: The temperature data needs to be provided as a binary file. For parallel runs, only rank 0 reads the file, and then distributes the data to the other processors.
This function needs to be better documented.
Definition at line 147 of file BCIO.c.
int BCReadTurbulentInflowData | ( | void * | b, |
void * | m, | ||
int | ndims, | ||
int | nvars, | ||
int * | DomainSize | ||
) |
Function to read in unsteady boundary data for turbulent inflow
Read in the turbulent inflow data: The turbulent inflow data needs to be provided as a binary file. For parallel runs, only rank 0 reads the file, and then distributes the data to the other processors.
This function needs to be better documented.
Definition at line 19 of file BCIO.c.
int gpuBCPeriodicU | ( | void * | , |
void * | , | ||
int | , | ||
int | , | ||
int * | , | ||
int | , | ||
double * | , | ||
double | |||
) |
Periodic boundary conditions for the solution vector U
int gpuBCSlipWallU | ( | void * | , |
void * | , | ||
int | , | ||
int | , | ||
int * | , | ||
int | , | ||
double * | , | ||
double | |||
) |
Slip (inviscid) wall boundary conditions for the solution vector U