IBAMR  IBAMR version 0.19.
Public Member Functions | List of all members
IBAMR::StokesFifthOrderWaveBcCoef Class Referenceabstract

Class StokesFifthOrderWaveBcCoef is an implementation of the strategy class SAMRAI::solv::RobinBcCoefStrategy that provides Dirichlet velocity boundary condition based upon Stokes' fifth-order theory of water waves at the inlet of the wave tank. The class is meant to be used with INSVCStaggeredHierarchyIntegrator. More...

#include <ibamr/StokesFifthOrderWaveBcCoef.h>

Inheritance diagram for IBAMR::StokesFifthOrderWaveBcCoef:
Inheritance graph
[legend]

Public Member Functions

 StokesFifthOrderWaveBcCoef (std::string object_name, const int comp_idx, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db, SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > > grid_geom)
 Constructor. More...
 
 ~StokesFifthOrderWaveBcCoef ()
 Destructor. More...
 

Implementation of SAMRAI::solv::RobinBcCoefStrategy interface.

std::string d_object_name
 
int d_comp_idx = IBTK::invalid_index
 
IBTK::muParserRobinBcCoefs d_muparser_bcs
 
SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > > d_grid_geom
 
double d_depth
 Wave parameters. More...
 
double d_omega
 
double d_wave_number
 
double d_amplitude
 
double d_gravity
 
bool d_deep_water_limit = false
 
double d_A [6][6]
 
double d_B [6][6]
 
double d_C [5]
 
double d_p [5]
 
double d_eta [5]
 
double d_num_interface_cells
 
void setBcCoefs (SAMRAI::tbox::Pointer< SAMRAI::pdat::ArrayData< NDIM, double > > &acoef_data, SAMRAI::tbox::Pointer< SAMRAI::pdat::ArrayData< NDIM, double > > &bcoef_data, SAMRAI::tbox::Pointer< SAMRAI::pdat::ArrayData< NDIM, double > > &gcoef_data, const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > &variable, const SAMRAI::hier::Patch< NDIM > &patch, const SAMRAI::hier::BoundaryBox< NDIM > &bdry_box, double fill_time=0.0) const override
 Function to fill arrays of Robin boundary condition coefficients at a patch boundary. More...
 
SAMRAI::hier::IntVector< NDIM > numberOfExtensionsFillable () const override
 
 StokesFifthOrderWaveBcCoef ()=delete
 Default constructor. More...
 
 StokesFifthOrderWaveBcCoef (const StokesFifthOrderWaveBcCoef &from)=delete
 Copy constructor. More...
 
StokesFifthOrderWaveBcCoefoperator= (const StokesFifthOrderWaveBcCoef &that)=delete
 Assignment operator. More...
 
void getFromInput (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db)
 
void initStokesCoefficients ()
 
double getSurfaceElevation (double x, double time) const
 
double getVelocity (double x, double z_plus_d, double time) const
 

Detailed Description

The class can calculate surface elevation and velocities in the water domain in both shallow water regime as well as deep-water regime as indicated through input database. The default regime is shallow water (finite depth).

Constructor & Destructor Documentation

◆ StokesFifthOrderWaveBcCoef() [1/3]

IBAMR::StokesFifthOrderWaveBcCoef::StokesFifthOrderWaveBcCoef ( std::string  object_name,
const int  comp_idx,
SAMRAI::tbox::Pointer< SAMRAI::tbox::Database input_db,
SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > >  grid_geom 
)

◆ ~StokesFifthOrderWaveBcCoef()

IBAMR::StokesFifthOrderWaveBcCoef::~StokesFifthOrderWaveBcCoef ( )

◆ StokesFifthOrderWaveBcCoef() [2/3]

IBAMR::StokesFifthOrderWaveBcCoef::StokesFifthOrderWaveBcCoef ( )
privatedelete
Note
This constructor is not implemented and should not be used.

◆ StokesFifthOrderWaveBcCoef() [3/3]

IBAMR::StokesFifthOrderWaveBcCoef::StokesFifthOrderWaveBcCoef ( const StokesFifthOrderWaveBcCoef from)
privatedelete
Note
This constructor is not implemented and should not be used.
Parameters
fromThe value to copy to this object.

Member Function Documentation

◆ setBcCoefs() [1/2]

void IBAMR::StokesFifthOrderWaveBcCoef::setBcCoefs ( SAMRAI::tbox::Pointer< SAMRAI::pdat::ArrayData< NDIM, double > > &  acoef_data,
SAMRAI::tbox::Pointer< SAMRAI::pdat::ArrayData< NDIM, double > > &  bcoef_data,
SAMRAI::tbox::Pointer< SAMRAI::pdat::ArrayData< NDIM, double > > &  gcoef_data,
const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > &  variable,
const SAMRAI::hier::Patch< NDIM > &  patch,
const SAMRAI::hier::BoundaryBox< NDIM > &  bdry_box,
double  fill_time = 0.0 
) const
override
See also
SAMRAI::solv::RobinBcCoefStrategy::setBcCoefs()
Parameters
acoef_dataBoundary coefficient data. The array will have been defined to include index range for corresponding to the boundary box bdry_box and appropriate for the alignment of the given variable. If this is a null pointer, then the calling function is not interested in a, and you can disregard it.
bcoef_dataBoundary coefficient data. This array is exactly like acoef_data, except that it is to be filled with the b coefficient.
gcoef_dataBoundary coefficient data. This array is exactly like acoef_data, except that it is to be filled with the g coefficient.
variableVariable to set the coefficients for. If implemented for multiple variables, this parameter can be used to determine which variable's coefficients are being sought.
patchPatch requiring bc coefficients.
bdry_boxBoundary box showing where on the boundary the coefficient data is needed.
fill_timeSolution time corresponding to filling, for use when coefficients are time-dependent.

◆ numberOfExtensionsFillable() [1/2]

SAMRAI::hier::IntVector<NDIM> IBAMR::StokesFifthOrderWaveBcCoef::numberOfExtensionsFillable ( ) const
override

◆ operator=()

StokesFifthOrderWaveBcCoef& IBAMR::StokesFifthOrderWaveBcCoef::operator= ( const StokesFifthOrderWaveBcCoef that)
privatedelete
Note
This operator is not implemented and should not be used.
Parameters
thatThe value to assign to this object.
Returns
A reference to this object.

◆ getFromInput()

void IBAMR::StokesFifthOrderWaveBcCoef::getFromInput ( SAMRAI::tbox::Pointer< SAMRAI::tbox::Database db)
private

Get wave parameters from input db.

◆ initStokesCoefficients()

void IBAMR::StokesFifthOrderWaveBcCoef::initStokesCoefficients ( )
private

Initialize Stokes coefficients.

◆ getSurfaceElevation()

double IBAMR::StokesFifthOrderWaveBcCoef::getSurfaceElevation ( double  x,
double  time 
) const
private

Get surface elevation at a specified horizontal position and time.

◆ getVelocity()

double IBAMR::StokesFifthOrderWaveBcCoef::getVelocity ( double  x,
double  z_plus_d,
double  time 
) const
private

Get velocity at a specified position and time.

◆ setBcCoefs() [2/2]

virtual void SAMRAI::solv::RobinBcCoefStrategy< DIM >::setBcCoefs ( tbox::Pointer< pdat::ArrayData< DIM, double > > &  acoef_data,
tbox::Pointer< pdat::ArrayData< DIM, double > > &  bcoef_data,
tbox::Pointer< pdat::ArrayData< DIM, double > > &  gcoef_data,
const tbox::Pointer< hier::Variable< DIM > > &  variable,
const hier::Patch< DIM > &  patch,
const hier::BoundaryBox< DIM > &  bdry_box,
const double  fill_time = 0.0 
) const
pure virtualinherited

This class specifies the Robin boundary condition coefficients at discrete locations on the patch boundary. Though these locations are defined by boundary box object, they do not necessarily coincide with the centers of the cells referred to by those boxes. These locations typically coincide with the nodes or face centers which do lie on the patch boundary. Accordingly, you use this function to provide the boundary coefficients at those locations by filling an array at indices corresponding to those locations.

When setting the values of the boundary condition coefficients it is useful to note that for any cell (i,j,k), the indices of the sides, edges and nodes are easily determined. The index on the lower side of the cell is the same as the index of the cell, whereas the index on the upper side of the cell has the next higher value. In 2D, the cell and its surrounding nodes and faces has the following indices:

*
*       (i,j+1)----(i,j+1)---(i+1,j+1)
*          |                     |
*          |                     |
*          |                     |
*          |                     |
*        (i,j)      (i,j)     (i+1,j)
*          |                     |
*          |                     |
*          |                     |
*          |                     |
*        (i,j)------(i,j)-----(i+1,j)
*
* 

Once this is understood, translation between the index in the boundary box index space to the index of things on the boundary is simple.

The boundary condition coefficients should be placed in the pdat::ArrayData<DIM> objects, acoef_data and gcoef_data (see argument list), which are dimensioned to contain the indices of the points alligned with variable and lying on the the boundary defined by bdry_box.

This function is only used with type-1 boundary boxes, such as faces in 3D. Other types of boundaries do not have a well-defined surface normal.

The parameter variable is passed through to tell the implementation of this function what variable to set the coefficients for. You may wish to ignore it if your implementation is intended for a specific variable.

Parameters
acoef_databoundary coefficient data. The array will have been defined to include index range for corresponding to the boundary box bdry_box and appropriate for the alignment of the given variable. If this is a null pointer, then the calling function is not interested in a, and you can disregard it.
bcoef_databoundary coefficient data. This array is exactly like acoef_data, except that it is to be filled with the b coefficient.
gcoef_databoundary coefficient data. This array is exactly like acoef_data, except that it is to be filled with the g coefficient.
variablevariable to set the coefficients for. If implemented for multiple variables, this parameter can be used to determine which variable's coefficients are being sought.
patchpatch requiring bc coefficients
bdry_boxboundary box showing where on the boundary the coefficient data is needed.
fill_timesolution time corresponding to filling, for use when coefficients are time-dependent.

◆ numberOfExtensionsFillable() [2/2]

virtual hier::IntVector<DIM> SAMRAI::solv::RobinBcCoefStrategy< DIM >::numberOfExtensionsFillable ( ) const
pure virtualinherited

Member Data Documentation

◆ d_object_name

std::string IBAMR::StokesFifthOrderWaveBcCoef::d_object_name
private

Book-keeping.

◆ d_comp_idx

int IBAMR::StokesFifthOrderWaveBcCoef::d_comp_idx = IBTK::invalid_index
private

Velocity component index.

◆ d_muparser_bcs

IBTK::muParserRobinBcCoefs IBAMR::StokesFifthOrderWaveBcCoef::d_muparser_bcs
private

muparser object for filling boundary conditions other than wave inlet.

◆ d_grid_geom

SAMRAI::tbox::Pointer<SAMRAI::geom::CartesianGridGeometry<NDIM> > IBAMR::StokesFifthOrderWaveBcCoef::d_grid_geom
private

The Cartesian grid geometry object provides the extents of the computational domain.

◆ d_depth

double IBAMR::StokesFifthOrderWaveBcCoef::d_depth
private
Parameters
d_wave_number: Wave number of dominant wave component [$2\pi/m$]
d_amplitude: Amplitude of the dominant wave component [m]
d_depth: Depth of water, from sea bed to still water level [m]
d_gravity: Acceleration due to gravity [$m/s^2$]
d_omega: Angular frequency [$2 \pi/s$] (optional)

\NOTE The class calculates a more accurate value of omega from the expansion coefficients and the provided value in not used.

◆ d_omega

double IBAMR::StokesFifthOrderWaveBcCoef::d_omega
private

◆ d_wave_number

double IBAMR::StokesFifthOrderWaveBcCoef::d_wave_number
private

◆ d_amplitude

double IBAMR::StokesFifthOrderWaveBcCoef::d_amplitude
private

◆ d_gravity

double IBAMR::StokesFifthOrderWaveBcCoef::d_gravity
private

◆ d_deep_water_limit

bool IBAMR::StokesFifthOrderWaveBcCoef::d_deep_water_limit = false
private

If we are calculating in deep water limit.

◆ d_A

double IBAMR::StokesFifthOrderWaveBcCoef::d_A[6][6]
private

Stokes coefficients.

◆ d_B

double IBAMR::StokesFifthOrderWaveBcCoef::d_B[6][6]
private

◆ d_C

double IBAMR::StokesFifthOrderWaveBcCoef::d_C[5]
private

◆ d_p

double IBAMR::StokesFifthOrderWaveBcCoef::d_p[5]
private

◆ d_eta

double IBAMR::StokesFifthOrderWaveBcCoef::d_eta[5]
private

◆ d_num_interface_cells

double IBAMR::StokesFifthOrderWaveBcCoef::d_num_interface_cells
private

Number of interface cells.


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