AdH Kraken 0.0.0
Next generation Adaptive Hydraulics
Loading...
Searching...
No Matches
fe_wet_dry_integrations.c File Reference
#include "adh.h"

Functions

void fe_sw2_wd_average (SVECT *elem_nds, double *depth, SVECT2D *v_wd, double *f_wd, double djac, double *f_wd_avg, SVECT2D *v_wd_avg)
 Wet/Dry routine for calculating the wet-dry integral of shallow water a generic function, f, and/or vector, v: $  \int_{0}^{1} \int_{0}^{1-\widehat{x}} \big( c \, f(\widehat{x},\widehat{y})\big) d\widehat{y}\,d\widehat{x} $. More...
 
void fe_sw2_wd_convection_triangle (SVECT *elem_nds, double *elem_head, SVECT2D *grad_phi, SVECT2D *v, SVECT2D *v_wet_dry, double *f, double *f_wet_dry, double djac, double *vars, double *elem_rhs)
 Add the 2D shallow water wet-dry wrapped convection terms to the FE residual. More...
 
void fe_sw2_wd_continuity_temporal_triangle (SVECT *elem_nds, double *elem_head, SVECT2D *grad_phi, SVECT2D *v, SVECT2D *v_wet_dry, double *f, double *f_wet_dry, double djac, double *vars, double *rhs)
 Routine for wet-dry integrating the SW 2D continuity temporal term on a triangle. More...
 
void fe_sw2_wd_pressure_triangle (SVECT *elem_nds, double *elem_head, SVECT2D *grad_phi, SVECT2D *v, SVECT2D *v_wet_dry, double *f, double *f_wet_dry, double djac, double *vars, double *rhs)
 Add the 2D shallow water wet-dry wrapped pressure terms to the FE residual. More...
 
void fe_sw2_wd_bodyForce_triangle (SVECT *elem_nds, double *elem_head, SVECT2D *grad_phi, SVECT2D *v, SVECT2D *v_wet_dry, double *f, double *f_wet_dry, double djac, double *vars, double *rhs)
 Add the 2D shallow water wet-dry wrapped body-force terms to the FE residual. More...
 
void fe_sw2_wd_boundaryPressure_triangle (SVECT *elem_nds, double *elem_head, SVECT2D *grad_phi, SVECT2D *v, SVECT2D *v_wet_dry, double *f, double *f_wet_dry, double djac, double *vars, double *elem_rhs)
 Add the 2D shallow water wet-dry wrapped boundary pressure terms to the FE residual. More...
 
void fe_sw2_wd_densityPressure_triangle (SVECT *elem_nds, double *elem_head, SVECT2D *grad_phi, SVECT2D *v, SVECT2D *v_wet_dry, double *f, double *f_wet_dry, double djac, double *vars, double *rhs)
 Add the 2D shallow water wet-dry wrapped density pressure terms to the FE residual. More...
 
void fe_sw2_wd_densityBodyForce_triangle (SVECT *elem_nds, double *elem_head, SVECT2D *grad_phi, SVECT2D *v, SVECT2D *v_wet_dry, double *f, double *f_wet_dry, double djac, double *vars, double *rhs)
 Add the 2D shallow water wet-dry wrapped density body-force terms to the FE residual. More...
 
void fe_sw2_wd_densityBoundaryPressure_triangle (SVECT *elem_nds, double *elem_head, SVECT2D *grad_phi, SVECT2D *v, SVECT2D *v_wet_dry, double *f, double *f_wet_dry, double djac, double *vars, double *rhs)
 Add the 2D shallow water wet-dry wrapped density boundary pressure terms to the FE residual. More...
 
void fe_sw2_wd_integrate_triangle_f (SVECT *elem_nds, double *elem_head, SVECT2D *grad_phi, SVECT2D *v, SVECT2D *v_wet_dry, double *f, double *f_wet_dry, double djac, double *vars, double *rhs)
 Wet/Dry routine for calculating the wet-dry integral of shallow water H, u and v: $  \int_{0}^{1} \int_{0}^{1-\widehat{x}} \big( c \, f(\widehat{x},\widehat{y})\big) d\widehat{y}\,d\widehat{x} $. More...
 
void fe_sw2_wd_gls_convection_triangle (SVECT *elem_nds, double *elem_head, SVECT2D *grad_phi, SVECT2D *v, SVECT2D *v_wet_dry, double *f, double *f_wet_dry, double djac, double *vars, double *rhs)
 Add the 2D shallow water wet-dry wrapped *nonconservative convection terms to the FE residual. More...
 

Detailed Description

This file collects the 2D shallow water wet/dry integrations. All function arguements must be consistent with fe_sw2_wet_dry_wrapper.

Function Documentation

◆ fe_sw2_wd_average()

void fe_sw2_wd_average ( SVECT elem_nds,
double *  depth,
SVECT2D v_wd,
double *  f_wd,
double  djac,
double *  f_wd_avg,
SVECT2D v_wd_avg 
)
inline

Wet/Dry routine for calculating the wet-dry integral of shallow water a generic function, f, and/or vector, v: $  \int_{0}^{1} \int_{0}^{1-\widehat{x}} \big( c \, f(\widehat{x},\widehat{y})\big) d\widehat{y}\,d\widehat{x} $.

Author
Charlie Berger, Ph.D.
Gary Brown
Gaurav Savant, Ph.D.
Corey Trahan, Ph.D.
Date
October, 2017
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsnot used
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phinot used
[in]vnot used
[in]v_wet_drywet-dry velocities (averaged here)
[in]fnot used
[in]f_wet_drythe scalar function to be averaged (averaged here)
[in]djacthe 2d element area
[in]dtnot used
[in]ca constant
Note
CJT :: must have same call arguements as all generic wet-dry wrapped functions
CJT :: djac is used here because later, in the wet-dry wrapper, it is divided by the wet area (djac)

◆ fe_sw2_wd_bodyForce_triangle()

void fe_sw2_wd_bodyForce_triangle ( SVECT elem_nds,
double *  elem_head,
SVECT2D grad_phi,
SVECT2D v,
SVECT2D v_wet_dry,
double *  f,
double *  f_wet_dry,
double  djac,
double *  vars,
double *  rhs 
)
inline

Add the 2D shallow water wet-dry wrapped body-force terms to the FE residual.

Author
Charlie Berger, Ph.D.
Gaurav Savant, Ph.D.
Gary Brown
Corey Trahan, Ph.D.
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsnot used
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phinot used
[in]vthe fully wet bathymetry gradient
[in]v_wet_drynot used
[in]fnot used
[in]f_wet_drynot used
[in]djacthe 2d element area
[in]dtnot used
[in]ca constant

◆ fe_sw2_wd_boundaryPressure_triangle()

void fe_sw2_wd_boundaryPressure_triangle ( SVECT elem_nds,
double *  elem_head,
SVECT2D grad_phi,
SVECT2D v,
SVECT2D v_wet_dry,
double *  f,
double *  f_wet_dry,
double  djac,
double *  vars,
double *  elem_rhs 
)
inline

Add the 2D shallow water wet-dry wrapped boundary pressure terms to the FE residual.

Author
Charlie Berger, Ph.D.
Gaurav Savant, Ph.D.
Gary Brown
Corey Trahan, Ph.D.
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsthe wet-dry nodal positions
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phinot used
[in]vnot used
[in]v_wet_drynot used
[in]fnot used
[in]f_wet_drynot used
[in]djacthe 2d element area
[in]dtnot used
[in]ca constant

◆ fe_sw2_wd_continuity_temporal_triangle()

void fe_sw2_wd_continuity_temporal_triangle ( SVECT elem_nds,
double *  elem_head,
SVECT2D grad_phi,
SVECT2D v,
SVECT2D v_wet_dry,
double *  f,
double *  f_wet_dry,
double  djac,
double *  vars,
double *  rhs 
)
inline

Routine for wet-dry integrating the SW 2D continuity temporal term on a triangle.

Author
Corey Trahan, Ph.D.
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsnot used
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phinot used
[in]vnot used
[in]v_wet_drynot used
[in]fnot used
[in]f_wet_drynot used
[in]djacthe 2d element area
[in]dtnot used
[in]cthe second order time-derivative weight

\begin{eqnarray*} \residDA{i}{}{c} &=& dt * \alpha * \bodyTime{\,2d}{e}{\phidd{i}}{\depth{h}}  \end{eqnarray*}

◆ fe_sw2_wd_convection_triangle()

void fe_sw2_wd_convection_triangle ( SVECT elem_nds,
double *  elem_head,
SVECT2D grad_phi,
SVECT2D v,
SVECT2D v_wet_dry,
double *  f,
double *  f_wet_dry,
double  djac,
double *  vars,
double *  elem_rhs 
)
inline

Add the 2D shallow water wet-dry wrapped convection terms to the FE residual.

Author
Charlie Berger, Ph.D.
Gaurav Savant, Ph.D.
Gary Brown
Corey Trahan, Ph.D.
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsnot used
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phithe elemental shape function gradients in configuration space
[in]vfully wet velocites
[in]v_wet_drythe wet-dry velocities
[in]fnot used
[in]f_wet_drynot used
[in]djacthe 2d element area
[in]dtnot used
[in]ca constant

Solves the following weak, wet/dry discrete body terms of the 2D shallow water equation:

\begin{eqnarray*}
 \residDA{i}{}{c}   &=& -  \bodyConv{\,2d}{e}{\phidd{i}}{(\velb{h} \, \depth{h})} \\
 \residDA{i}{}{mx}  &=& -  \bodyConv{\,2d}{e}{\phidd{i}}{(\velb{h} \, \ub{h}\depth{h})} \\
 \residDA{i}{}{my}  &=& -  \bodyConv{\,2d}{e}{\phidd{i}}{(\velb{h} \, \vb{h}\depth{h})}
\end{eqnarray*}

◆ fe_sw2_wd_densityBodyForce_triangle()

void fe_sw2_wd_densityBodyForce_triangle ( SVECT elem_nds,
double *  elem_head,
SVECT2D grad_phi,
SVECT2D v,
SVECT2D v_wet_dry,
double *  f,
double *  f_wet_dry,
double  djac,
double *  vars,
double *  rhs 
)
inline

Add the 2D shallow water wet-dry wrapped density body-force terms to the FE residual.

Author
Charlie Berger, Ph.D.
Gaurav Savant, Ph.D.
Gary Brown
Corey Trahan, Ph.D.
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsnot used
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phinot used
[in]vthe fully wet bathymetry gradient
[in]v_wet_drynot used
[in]ffully we density
[in]f_wet_drynot used
[in]djacthe 2d element area
[in]dtnot used
[in]ca constant

◆ fe_sw2_wd_densityBoundaryPressure_triangle()

void fe_sw2_wd_densityBoundaryPressure_triangle ( SVECT elem_nds,
double *  elem_head,
SVECT2D grad_phi,
SVECT2D v,
SVECT2D v_wet_dry,
double *  f,
double *  f_wet_dry,
double  djac,
double *  vars,
double *  rhs 
)
inline

Add the 2D shallow water wet-dry wrapped density boundary pressure terms to the FE residual.

Author
Charlie Berger, Ph.D.
Gaurav Savant, Ph.D.
Gary Brown
Corey Trahan, Ph.D.
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsthe wet-dry nodal positions
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phinot used
[in]vnot used
[in]v_wet_drynot used
[in]ffully wet density
[in]f_wet_drynot used
[in]djacthe 2d element area
[in]dtnot used
[in]ca constant

◆ fe_sw2_wd_densityPressure_triangle()

void fe_sw2_wd_densityPressure_triangle ( SVECT elem_nds,
double *  elem_head,
SVECT2D grad_phi,
SVECT2D v,
SVECT2D v_wet_dry,
double *  f,
double *  f_wet_dry,
double  djac,
double *  vars,
double *  rhs 
)
inline

Add the 2D shallow water wet-dry wrapped density pressure terms to the FE residual.

Author
Charlie Berger, Ph.D.
Gaurav Savant, Ph.D.
Gary Brown
Corey Trahan, Ph.D.
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsnot used
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phithe elemental shape function gradients in configuration space
[in]vnot used
[in]v_wet_drynot used
[in]ffully wet density
[in]f_wet_drynot used
[in]djacthe 2d element area
[in]dtnot used
[in]ca constant

◆ fe_sw2_wd_gls_convection_triangle()

void fe_sw2_wd_gls_convection_triangle ( SVECT elem_nds,
double *  elem_head,
SVECT2D grad_phi,
SVECT2D v,
SVECT2D v_wet_dry,
double *  f,
double *  f_wet_dry,
double  djac,
double *  vars,
double *  rhs 
)
inline

Add the 2D shallow water wet-dry wrapped *nonconservative convection terms to the FE residual.

Author
Charlie Berger, Ph.D.
Gaurav Savant, Ph.D.
Gary Brown
Corey Trahan, Ph.D.
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsnot used
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phithe elemental shape function gradients in configuration space
[in]vnot used
[in]v_wet_drywet-dry velocities
[in]fnot used
[in]f_wet_drywet-dry velocities
[in]djacthe 2d element area
[in]dttime-step
[in]ca constant

Solves the following weak, non-conservative wet/dry discrete equation:

\begin{eqnarray*}
 \residDA{0}{}{c}   &=& \intg{\overline{u} \deriv{H}{x} + \overline{H} \deriv{u}{x} + \overline{v} \deriv{H}{y} + \overline{H} \deriv{v}{y} }{2d}{e}  \\
 \residDA{0}{}{mx}  &=& \intg{\overline{u} \deriv{u}{x} + \overline{v} \deriv{u}{x}}{2d}{e} \\
 \residDA{0}{}{my}  &=& \intg{\overline{u} \deriv{v}{x} + \overline{v} \deriv{v}{x}}{2d}{e}
\end{eqnarray*}

◆ fe_sw2_wd_integrate_triangle_f()

void fe_sw2_wd_integrate_triangle_f ( SVECT elem_nds,
double *  elem_head,
SVECT2D grad_phi,
SVECT2D v,
SVECT2D v_wet_dry,
double *  f,
double *  f_wet_dry,
double  djac,
double *  vars,
double *  rhs 
)
inline

Wet/Dry routine for calculating the wet-dry integral of shallow water H, u and v: $  \int_{0}^{1} \int_{0}^{1-\widehat{x}} \big( c \, f(\widehat{x},\widehat{y})\big) d\widehat{y}\,d\widehat{x} $.

Author
Charlie Berger, Ph.D.
Gary Brown
Gaurav Savant, Ph.D.
Corey Trahan, Ph.D.
Date
October, 2017
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsnot used
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phinot used
[in]vnot used
[in]v_wet_drywet-dry velocities (integrated here)
[in]fnot used
[in]f_wet_drythe scalar function (integrated here)
[in]djacthe 2d element area
[in]dtnot used
[in]ca constant
Note
CJT :: must have same call arguements as all generic wet-dry wrapped functions
CJT :: djac is used here because later, in the wet-dry wrapper, it is divided by the wet area (djac)

◆ fe_sw2_wd_pressure_triangle()

void fe_sw2_wd_pressure_triangle ( SVECT elem_nds,
double *  elem_head,
SVECT2D grad_phi,
SVECT2D v,
SVECT2D v_wet_dry,
double *  f,
double *  f_wet_dry,
double  djac,
double *  vars,
double *  rhs 
)
inline

Add the 2D shallow water wet-dry wrapped pressure terms to the FE residual.

Author
Charlie Berger, Ph.D.
Gaurav Savant, Ph.D.
Gary Brown
Corey Trahan, Ph.D.
Bug:
none
Warning
none
Parameters
[in,out]rhsthe 2D elemental residual array contribution with wet/dry inclusion
[in]elem_ndsnot used
[in]elem_headthe 2d element nodal wet-dry depths
[in]grad_phithe elemental shape function gradients in configuration space
[in]vnot used
[in]v_wet_drynot used
[in]fnot used
[in]f_wet_drynot used
[in]djacthe 2d element area
[in]dtnot used
[in]ca constant