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
41using namespace std;
42
43namespace Nektar
44{
47 "VCSWeakPressure", VCSWeakPressure::create);
48
51 "SolverType", "VCSWeakPressure", eVCSWeakPressure);
52
53/**
54 * Constructor. Creates ...
55 *
56 * \param
57 * \param
58 */
62 : UnsteadySystem(pSession, pGraph),
63 VelocityCorrectionScheme(pSession, pGraph)
64{
65}
66
67/**
68 * Destructor
69 */
71{
72}
73
74/**
75 *
76 */
78{
80
81 SolverUtils::AddSummaryItem(s, "Splitting Scheme",
82 "Velocity correction (weak press. form)");
83
84 if (m_extrapolation->GetSubStepName().size())
85 {
86 SolverUtils::AddSummaryItem(s, "Substepping",
87 m_extrapolation->GetSubStepName());
88 }
89
90 string dealias = m_homogen_dealiasing ? "Homogeneous1D" : "";
92 {
93 dealias += (dealias == "" ? "" : " + ") + string("spectral/hp");
94 }
95 if (dealias != "")
96 {
97 SolverUtils::AddSummaryItem(s, "Dealiasing", dealias);
98 }
99
100 string smoothing = m_useSpecVanVisc ? "spectral/hp" : "";
102 {
103 smoothing += (smoothing == "" ? "" : " + ") + string("Homogeneous1D");
104 }
105 if (smoothing != "")
106 {
108 s, "Smoothing",
109 "SVV (" + smoothing + " SVV (cut-off = " +
110 boost::lexical_cast<string>(m_sVVCutoffRatio) +
111 ", diff coeff = " +
112 boost::lexical_cast<string>(m_sVVDiffCoeff) + ")");
113 }
114
116 {
118 s, "GJP Stab. Impl. ",
119 m_session->GetSolverInfo("GJPStabilisation"));
120 SolverUtils::AddSummaryItem(s, "GJP Stab. JumpScale", m_GJPJumpScale);
121
122 if (boost::iequals(m_session->GetSolverInfo("GJPStabilisation"),
123 "Explicit"))
124 {
126 s, "GJP Normal Velocity",
127 m_session->GetSolverInfo("GJPNormalVelocity"));
128 }
129 }
130}
131
132/**
133 * Weak Forcing term for Poisson solver solver
134 */
136 const Array<OneD, const Array<OneD, NekDouble>> &fields,
138{
139 int ncoeffs = m_pressure->GetNcoeffs();
140
141 m_pressure->IProductWRTDerivBase(fields, Forcing[0]);
142
143 // aii required since time integration scheme normalises against aii
144 Vmath::Smul(ncoeffs, -1.0 / aii_Dt, Forcing[0], 1, Forcing[0], 1);
145}
146
147/**
148 * Solve pressure system
149 */
151{
153 // Setup coefficient for equation
155
156 // Solver Pressure Poisson Equation
157 m_pressure->HelmSolve(Forcing, m_pressure->UpdateCoeffs(), factors,
160 false);
161
162 // Add presure to outflow bc if using convective like BCs
163 m_extrapolation->AddPressureToOutflowBCs(m_kinvis);
164}
165
166} // 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
STL namespace.