StabilizationUtils: some cosmetics
This commit is contained in:
parent
5be5c5fb1b
commit
40508f0e12
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace StabilizationUtils {
|
||||
|
||||
double getElementSize(const std::vector<Vec3>& XC, int nsd)
|
||||
double getElementSize (const std::vector<Vec3>& XC, int nsd)
|
||||
{
|
||||
double h;
|
||||
if (nsd == 2) {
|
||||
|
@ -38,7 +38,8 @@ double getElementSize(const std::vector<Vec3>& XC, int nsd)
|
|||
}
|
||||
|
||||
|
||||
double getTauPt(double dt, double mu, const Vector& U, const Matrix& G, const double Ct, const double Cl)
|
||||
double getTauPt (double dt, double mu, const Vector& U,
|
||||
const Matrix& G, const double Ct, const double Cl)
|
||||
{
|
||||
double Gnorm2 = 0.0;
|
||||
for (size_t i = 1;i <= G.rows();i++)
|
||||
|
@ -49,7 +50,9 @@ double getTauPt(double dt, double mu, const Vector& U, const Matrix& G, const do
|
|||
}
|
||||
|
||||
|
||||
bool getTauNSPt(double dt, double mu, const Vector& U, const Matrix& G, double & tauM, double& tauC, const double Ct, const double Cl)
|
||||
bool getTauNSPt (double dt, double mu, const Vector& U,
|
||||
const Matrix& G, double &tauM, double& tauC,
|
||||
const double Ct, const double Cl)
|
||||
{
|
||||
tauM = getTauPt(dt,mu,U,G,Ct,Cl);
|
||||
|
||||
|
@ -63,7 +66,9 @@ bool getTauNSPt(double dt, double mu, const Vector& U, const Matrix& G, double &
|
|||
}
|
||||
|
||||
|
||||
bool getTauNSALEPt(double dt, double mu, const Vector& U, const Matrix& G, double & tauM, double& tauC, const double Ct, const double Cl)
|
||||
bool getTauNSALEPt (double dt, double mu, const Vector& U,
|
||||
const Matrix& G, double & tauM, double& tauC,
|
||||
const double Ct, const double Cl)
|
||||
{
|
||||
tauM = getTauPt(dt,mu,U,G,Ct,Cl);
|
||||
|
||||
|
@ -73,7 +78,8 @@ bool getTauNSALEPt(double dt, double mu, const Vector& U, const Matrix& G, doubl
|
|||
}
|
||||
|
||||
|
||||
bool getTauPtJac(const Vector& U, const Matrix& G, const double tauM, Vector& tauMjac)
|
||||
bool getTauPtJac (const Vector& U, const Matrix& G,
|
||||
const double tauM, Vector& tauMjac)
|
||||
{
|
||||
tauMjac = -pow(tauM,3)*G*U;
|
||||
|
||||
|
@ -81,7 +87,9 @@ bool getTauPtJac(const Vector& U, const Matrix& G, const double tauM, Vector& ta
|
|||
}
|
||||
|
||||
|
||||
bool getTauNSPtJac(const Vector& U, const Matrix& G, const double tauM, const double& tauC, Vector& tauMjac, Vector& tauCjac)
|
||||
bool getTauNSPtJac (const Vector& U, const Matrix& G,
|
||||
const double tauM, const double& tauC,
|
||||
Vector& tauMjac, Vector& tauCjac)
|
||||
{
|
||||
if (!getTauPtJac(U, G, tauM, tauMjac))
|
||||
return false;
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
#include "MatVec.h"
|
||||
|
||||
namespace StabilizationUtils {
|
||||
//! \brief Returns characteristic element size
|
||||
//! \brief Returns characteristic element size.
|
||||
//! \param XC The element corner coordinates
|
||||
//! \param nsd Number of spatial dimensions
|
||||
//! \details The size is taken as the shortest edge length
|
||||
double getElementSize(const std::vector<Vec3>& XC, int nsd);
|
||||
|
||||
//! \brief Returns stabilization parameters for convecction-diffusion equation
|
||||
//! \brief Returns stabilization parameters for convection-diffusion equation.
|
||||
//! \param[in] dt The timestep size
|
||||
//! \param[in] mu Diffusion/viscosity parameter
|
||||
//! \param[in] U Velocity vector
|
||||
|
@ -33,9 +33,9 @@ namespace StabilizationUtils {
|
|||
//! \param[in] Cl VMS parameter
|
||||
//! \details Stabilization parameter in integration point
|
||||
double getTauPt(double dt, double mu, const Vector& U, const Matrix& G,
|
||||
const double Ct=2.0, const double Cl=36.0);
|
||||
const double Ct = 2.0, const double Cl = 36.0);
|
||||
|
||||
//! \brief Computes stabilization parameters for Navier-Stokes equations
|
||||
//! \brief Computes stabilization parameters for Navier-Stokes equations.
|
||||
//! \param[in] dt The timestep size
|
||||
//! \param[in] mu Diffusion/viscosity parameter
|
||||
//! \param[in] U Velocity vector
|
||||
|
@ -46,29 +46,31 @@ namespace StabilizationUtils {
|
|||
//! \param[in] Cl VMS parameter
|
||||
//! \details Stabilization parameters in integration point
|
||||
bool getTauNSPt(double dt, double mu, const Vector& U, const Matrix& G,
|
||||
double& tauM, double& tauC, const double Ct=2.0, const double Cl=36.0);
|
||||
double& tauM, double& tauC,
|
||||
const double Ct = 2.0, const double Cl = 36.0);
|
||||
|
||||
//! \brief Computes stabilization parameters for Navier-Stokes equations
|
||||
//! \brief Computes stabilization parameters for Navier-Stokes equations.
|
||||
//! \param[in] dt The timestep size
|
||||
//! \param[in] mu Diffusion/viscosity parameter
|
||||
//! \param[in] U Velocity vector
|
||||
//! \param[in] G The G matrix
|
||||
//! \param[in] U Velocity vector
|
||||
//! \param[in] G The G matrix
|
||||
//! \param[out] tauM Stabilization parameter for momentum
|
||||
//! \param[out] tauC Stabilization parameter for continuity
|
||||
//! \param[in] Ct VMS parameter
|
||||
//! \param[in] Cl VMS parameter
|
||||
//! \details Stabilization parameters in integration point
|
||||
bool getTauNSALEPt(double dt, double mu, const Vector& U, const Matrix& G,
|
||||
double& tauM, double& tauC, const double Ct=2.0, const double Cl=36.0);
|
||||
double& tauM, double& tauC,
|
||||
const double Ct = 2.0, const double Cl = 36.0);
|
||||
|
||||
//! \brief Computes variation of stability parameters with respect to velocity
|
||||
//! \brief Computes variation of stability parameters with respect to velocity.
|
||||
//! \param[in] U Velocity vector
|
||||
//! \param[in] G The G matrix
|
||||
//! \param[in] tauM Stabilization parameter for momentum
|
||||
//! \param[out] tauMjac Variation of tauM with respect to U
|
||||
bool getTauPtJac(const Vector& U, const Matrix& G, const double tauM, Vector& tauMjac);
|
||||
|
||||
//! \brief Computes variation of stability parameters with respect to velocity
|
||||
//! \brief Computes variation of stability parameters with respect to velocity.
|
||||
//! \param[in] U Velocity vector
|
||||
//! \param[in] G The G matrix
|
||||
//! \param[in] tauM Stabilization parameter for momentum
|
||||
|
@ -76,7 +78,7 @@ namespace StabilizationUtils {
|
|||
//! \param[out] tauMjac Variation of tauM with respect to U
|
||||
//! \param[out] tauCjac Variation of tauC with respect to U
|
||||
bool getTauNSPtJac(const Vector& U, const Matrix& G, const double tauM,
|
||||
const double& tauC, Vector& tauMjac, Vector& tauCjac);
|
||||
const double& tauC, Vector& tauMjac, Vector& tauCjac);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user