StabilizationUtils: some cosmetics
This commit is contained in:
parent
5be5c5fb1b
commit
40508f0e12
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace StabilizationUtils {
|
namespace StabilizationUtils {
|
||||||
|
|
||||||
double getElementSize(const std::vector<Vec3>& XC, int nsd)
|
double getElementSize (const std::vector<Vec3>& XC, int nsd)
|
||||||
{
|
{
|
||||||
double h;
|
double h;
|
||||||
if (nsd == 2) {
|
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;
|
double Gnorm2 = 0.0;
|
||||||
for (size_t i = 1;i <= G.rows();i++)
|
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);
|
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);
|
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;
|
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))
|
if (!getTauPtJac(U, G, tauM, tauMjac))
|
||||||
return false;
|
return false;
|
||||||
|
@ -18,13 +18,13 @@
|
|||||||
#include "MatVec.h"
|
#include "MatVec.h"
|
||||||
|
|
||||||
namespace StabilizationUtils {
|
namespace StabilizationUtils {
|
||||||
//! \brief Returns characteristic element size
|
//! \brief Returns characteristic element size.
|
||||||
//! \param XC The element corner coordinates
|
//! \param XC The element corner coordinates
|
||||||
//! \param nsd Number of spatial dimensions
|
//! \param nsd Number of spatial dimensions
|
||||||
//! \details The size is taken as the shortest edge length
|
//! \details The size is taken as the shortest edge length
|
||||||
double getElementSize(const std::vector<Vec3>& XC, int nsd);
|
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] dt The timestep size
|
||||||
//! \param[in] mu Diffusion/viscosity parameter
|
//! \param[in] mu Diffusion/viscosity parameter
|
||||||
//! \param[in] U Velocity vector
|
//! \param[in] U Velocity vector
|
||||||
@ -33,9 +33,9 @@ namespace StabilizationUtils {
|
|||||||
//! \param[in] Cl VMS parameter
|
//! \param[in] Cl VMS parameter
|
||||||
//! \details Stabilization parameter in integration point
|
//! \details Stabilization parameter in integration point
|
||||||
double getTauPt(double dt, double mu, const Vector& U, const Matrix& G,
|
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] dt The timestep size
|
||||||
//! \param[in] mu Diffusion/viscosity parameter
|
//! \param[in] mu Diffusion/viscosity parameter
|
||||||
//! \param[in] U Velocity vector
|
//! \param[in] U Velocity vector
|
||||||
@ -46,9 +46,10 @@ namespace StabilizationUtils {
|
|||||||
//! \param[in] Cl VMS parameter
|
//! \param[in] Cl VMS parameter
|
||||||
//! \details Stabilization parameters in integration point
|
//! \details Stabilization parameters in integration point
|
||||||
bool getTauNSPt(double dt, double mu, const Vector& U, const Matrix& G,
|
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] dt The timestep size
|
||||||
//! \param[in] mu Diffusion/viscosity parameter
|
//! \param[in] mu Diffusion/viscosity parameter
|
||||||
//! \param[in] U Velocity vector
|
//! \param[in] U Velocity vector
|
||||||
@ -59,16 +60,17 @@ namespace StabilizationUtils {
|
|||||||
//! \param[in] Cl VMS parameter
|
//! \param[in] Cl VMS parameter
|
||||||
//! \details Stabilization parameters in integration point
|
//! \details Stabilization parameters in integration point
|
||||||
bool getTauNSALEPt(double dt, double mu, const Vector& U, const Matrix& G,
|
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] U Velocity vector
|
||||||
//! \param[in] G The G matrix
|
//! \param[in] G The G matrix
|
||||||
//! \param[in] tauM Stabilization parameter for momentum
|
//! \param[in] tauM Stabilization parameter for momentum
|
||||||
//! \param[out] tauMjac Variation of tauM with respect to U
|
//! \param[out] tauMjac Variation of tauM with respect to U
|
||||||
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);
|
||||||
|
|
||||||
//! \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] U Velocity vector
|
||||||
//! \param[in] G The G matrix
|
//! \param[in] G The G matrix
|
||||||
//! \param[in] tauM Stabilization parameter for momentum
|
//! \param[in] tauM Stabilization parameter for momentum
|
||||||
|
Loading…
Reference in New Issue
Block a user