Nektar++
VelocityCorrectionSchemeWeakPressure.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: VelocityCorrectionSchemeWeakPressure.cpp
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Velocity Correction Scheme for the Incompressible
32// Navier Stokes equations using Weak Pressure formulation
33///////////////////////////////////////////////////////////////////////////////
34
38
39#include <boost/algorithm/string.hpp>
40
41namespace Nektar
42{
43
46 "VCSWeakPressure", VCSWeakPressure::create);
47
50 "SolverType", "VCSWeakPressure", eVCSWeakPressure);
51
52/**
53 * Constructor. Creates ...
54 *
55 * \param
56 * \param
57 */
61 : UnsteadySystem(pSession, pGraph),
62 VelocityCorrectionScheme(pSession, pGraph)
63{
64}
65
66/**
67 *
68 */
70{
72
73 SolverUtils::AddSummaryItem(s, "Splitting Scheme",
74 "Velocity correction (weak press. form)");
75
76 if (m_extrapolation->GetSubStepName().size())
77 {
78 SolverUtils::AddSummaryItem(s, "Substepping",
79 m_extrapolation->GetSubStepName());
80 }
81
82 std::string dealias = m_homogen_dealiasing ? "Homogeneous1D" : "";
84 {
85 dealias += (dealias == "" ? "" : " + ") + std::string("spectral/hp");
86 }
87 if (dealias != "")
88 {
89 SolverUtils::AddSummaryItem(s, "Dealiasing", dealias);
90 }
91
92 std::string smoothing = m_useSpecVanVisc ? "spectral/hp" : "";
94 {
95 smoothing +=
96 (smoothing == "" ? "" : " + ") + std::string("Homogeneous1D");
97 }
98 if (smoothing != "")
99 {
101 s, "Smoothing",
102 "SVV (" + smoothing + " SVV (cut-off = " +
103 boost::lexical_cast<std::string>(m_sVVCutoffRatio) +
104 ", diff coeff = " +
105 boost::lexical_cast<std::string>(m_sVVDiffCoeff) + ")");
106 }
107
109 {
111 s, "GJP Stab. Impl. ",
112 m_session->GetSolverInfo("GJPStabilisation"));
113 SolverUtils::AddSummaryItem(s, "GJP Stab. JumpScale", m_GJPJumpScale);
114
115 if (boost::iequals(m_session->GetSolverInfo("GJPStabilisation"),
116 "Explicit"))
117 {
119 s, "GJP Normal Velocity",
120 m_session->GetSolverInfo("GJPNormalVelocity"));
121 }
122 }
123}
124
125/**
126 * Weak Forcing term for Poisson solver solver
127 */
129 const Array<OneD, const Array<OneD, NekDouble>> &fields,
131{
132 int ncoeffs = m_pressure->GetNcoeffs();
133
134 m_pressure->IProductWRTDerivBase(fields, Forcing[0]);
135
136 // aii required since time integration scheme normalises against aii
137 Vmath::Smul(ncoeffs, -1.0 / aii_Dt, Forcing[0], 1, Forcing[0], 1);
138}
139
140/**
141 * Solve pressure system
142 */
144{
146 // Setup coefficient for equation
148
149 // Solver Pressure Poisson Equation
150 m_pressure->HelmSolve(Forcing, m_pressure->UpdateCoeffs(), factors,
153 false);
154
155 // Add presure to outflow bc if using convective like BCs
156 m_extrapolation->AddPressureToOutflowBCs(m_kinvis);
157}
158
159} // namespace Nektar
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
NekDouble m_kinvis
Kinematic viscosity.
ExtrapolateSharedPtr m_extrapolation
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
enum HomogeneousType m_HomogeneousType
bool m_homogen_dealiasing
Flag to determine if dealiasing is used for homogeneous simulations.
Defines a forcing term to be explicitly applied.
Definition: Forcing.h:71
Base class for unsteady solvers.
SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s) override
Print a summary of time stepping parameters.
VCSWeakPressure(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print a summary of time stepping parameters.
void v_SolvePressure(const Array< OneD, NekDouble > &Forcing) override
static std::string className
Name of class.
void v_SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
NekDouble m_sVVCutoffRatio
cutt off ratio from which to start decayhing modes
NekDouble m_sVVDiffCoeff
Diffusion coefficient of SVV modes.
bool m_useGJPStabilisation
bool to identify if GJP semi-implicit is active.
bool m_useSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
bool m_useHomo1DSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
static VarFactorsMap NullVarFactorsMap
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:46
EquationSystemFactory & GetEquationSystemFactory()
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition: Misc.cpp:47
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:430
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:376
StdRegions::ConstFactorMap factors
@ eVCSWeakPressure
static Array< OneD, NekDouble > NullNekDouble1DArray
double NekDouble
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.hpp:100