Nektar++
Loading...
Searching...
No Matches
solvers
IncNavierStokesSolver
EquationSystems
SubSteppingExtrapolateWeakPressure.cpp
Go to the documentation of this file.
1
///////////////////////////////////////////////////////////////////////////////
2
//
3
// File: SubSteppingExtrapolateWeakPressure.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: Abstract base class for SubSteppingExtrapolate with Weak
32
// Pressure VCS
33
// mainly redefines SubStepSetPressureBCs
34
///////////////////////////////////////////////////////////////////////////////
35
36
#include <
IncNavierStokesSolver/EquationSystems/SubSteppingExtrapolateWeakPressure.h
>
37
38
namespace
Nektar
39
{
40
/**
41
* Registers the class with the Factory.
42
*/
43
std::string
SubSteppingExtrapolateWeakPressure::className
=
44
GetExtrapolateFactory
().
RegisterCreatorFunction
(
45
"SubSteppingWeakPressure"
,
SubSteppingExtrapolateWeakPressure::create
,
46
"SubSteppingWeakPressure"
);
47
48
SubSteppingExtrapolateWeakPressure::SubSteppingExtrapolateWeakPressure
(
49
const
LibUtilities::SessionReaderSharedPtr
pSession,
50
Array<OneD, MultiRegions::ExpListSharedPtr>
pFields,
51
MultiRegions::ExpListSharedPtr
pPressure,
const
Array<OneD, int>
pVel,
52
const
SolverUtils::AdvectionSharedPtr
advObject)
53
:
SubSteppingExtrapolate
(pSession, pFields, pPressure, pVel, advObject)
54
{
55
}
56
57
void
SubSteppingExtrapolateWeakPressure::v_SubStepSetPressureBCs
(
58
const
Array
<
OneD
,
const
Array<OneD, NekDouble>
> &inarray,
59
[[maybe_unused]]
const
NekDouble
Aii_Dt,
NekDouble
kinvis)
60
{
61
Array<OneD, Array<OneD, NekDouble>
> nullvelfields;
62
63
m_pressureCalls
++;
64
65
// Calculate non-linear and viscous BCs at current level and
66
// put in m_pressureHBCs[0]
67
CalcNeumannPressureBCs
(inarray, nullvelfields, kinvis);
68
69
// Extrapolate to m_pressureHBCs to n+1
70
ExtrapolateArray
(
m_pressureHBCs
);
71
72
// Add (phi,gamma0 u^{n+1}/Dt) term to m_presureHBC
73
AddVelBC
();
74
75
// Copy m_pressureHBCs to m_PbndExp
76
CopyPressureHBCsToPbndExp
();
77
78
// Evaluate High order outflow conditiosn if required.
79
CalcOutflowBCs
(inarray, kinvis);
80
}
81
82
// In weak pressure formulation we also require \int q u.n ds on outflow
83
// boundary
84
void
SubSteppingExtrapolateWeakPressure::v_AddNormVelOnOBC
(
85
const
int
cnt,
const
int
nreg,
Array
<
OneD
,
Array<OneD, NekDouble>
> &u)
86
{
87
if
(!
m_houtflow
.get())
// no outflow on partition so just return
88
{
89
return
;
90
}
91
92
int
nbcoeffs =
m_PBndExp
[nreg]->GetNcoeffs();
93
// int nqb = m_PBndExp[nreg]->GetTotPoints();
94
95
Array<OneD, NekDouble>
IProdVnTmp(nbcoeffs);
96
97
Array<OneD, Array<OneD, NekDouble>
> ubnd(
m_curl_dim
);
98
99
for
(
int
i = 0; i <
m_curl_dim
; ++i)
100
{
101
EvaluateBDFArray
(
m_houtflow
->m_outflowVelBnd[cnt][i]);
102
103
ubnd[i] =
m_houtflow
->m_outflowVelBnd[cnt][i][
m_intSteps
- 1];
104
105
// point input u to the first part of the array for later uee.
106
u[i] =
m_houtflow
->m_outflowVelBnd[cnt][i][0];
107
}
108
109
m_PBndExp
[nreg]->NormVectorIProductWRTBase(ubnd, IProdVnTmp);
110
111
Vmath::Svtvp
(nbcoeffs, -1.0 /
m_timestep
, IProdVnTmp, 1,
112
m_PBndExp
[nreg]->UpdateCoeffs(), 1,
113
m_PBndExp
[nreg]->UpdateCoeffs(), 1);
114
}
115
116
}
// namespace Nektar
SubSteppingExtrapolateWeakPressure.h
Nektar::Array
Definition
BasicUtils/SharedArray.hpp:57
Nektar::Extrapolate::m_pressureHBCs
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition
Extrapolate.h:277
Nektar::Extrapolate::m_curl_dim
int m_curl_dim
Curl-curl dimensionality.
Definition
Extrapolate.h:247
Nektar::Extrapolate::CopyPressureHBCsToPbndExp
void CopyPressureHBCsToPbndExp(void)
Definition
Extrapolate.cpp:1058
Nektar::Extrapolate::EvaluateBDFArray
void EvaluateBDFArray(Array< OneD, Array< OneD, NekDouble > > &array)
Definition
Extrapolate.cpp:1003
Nektar::Extrapolate::m_intSteps
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition
Extrapolate.h:271
Nektar::Extrapolate::CalcNeumannPressureBCs
void CalcNeumannPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)
Definition
Extrapolate.h:132
Nektar::Extrapolate::m_houtflow
HighOrderOutflowSharedPtr m_houtflow
Definition
Extrapolate.h:291
Nektar::Extrapolate::m_timestep
NekDouble m_timestep
Definition
Extrapolate.h:273
Nektar::Extrapolate::m_PBndExp
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition
Extrapolate.h:256
Nektar::Extrapolate::ExtrapolateArray
void ExtrapolateArray(Array< OneD, Array< OneD, NekDouble > > &array)
Definition
Extrapolate.cpp:972
Nektar::Extrapolate::AddVelBC
void AddVelBC(void)
Definition
Extrapolate.cpp:93
Nektar::Extrapolate::m_pressureCalls
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition
Extrapolate.h:262
Nektar::Extrapolate::CalcOutflowBCs
void CalcOutflowBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, NekDouble kinvis)
Definition
Extrapolate.cpp:202
Nektar::LibUtilities::NekFactory::RegisterCreatorFunction
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition
BasicUtils/NekFactory.hpp:196
Nektar::SubSteppingExtrapolate
Definition
SubSteppingExtrapolate.h:58
Nektar::SubSteppingExtrapolateWeakPressure::v_SubStepSetPressureBCs
void v_SubStepSetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, NekDouble Aii_Dt, NekDouble kinvis) override
Definition
SubSteppingExtrapolateWeakPressure.cpp:57
Nektar::SubSteppingExtrapolateWeakPressure::create
static ExtrapolateSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, MultiRegions::ExpListSharedPtr &pPressure, const Array< OneD, int > &pVel, const SolverUtils::AdvectionSharedPtr &advObject)
Creates an instance of this class.
Definition
SubSteppingExtrapolateWeakPressure.h:57
Nektar::SubSteppingExtrapolateWeakPressure::v_AddNormVelOnOBC
void v_AddNormVelOnOBC(const int nbcoeffs, const int nreg, Array< OneD, Array< OneD, NekDouble > > &u) override
Definition
SubSteppingExtrapolateWeakPressure.cpp:84
Nektar::SubSteppingExtrapolateWeakPressure::className
static std::string className
Name of class.
Definition
SubSteppingExtrapolateWeakPressure.h:73
Nektar::SubSteppingExtrapolateWeakPressure::SubSteppingExtrapolateWeakPressure
SubSteppingExtrapolateWeakPressure(const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, MultiRegions::ExpListSharedPtr pPressure, const Array< OneD, int > pVel, const SolverUtils::AdvectionSharedPtr advObject)
Definition
SubSteppingExtrapolateWeakPressure.cpp:48
Nektar::LibUtilities::SessionReaderSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition
SessionReader.h:119
Nektar::MultiRegions::ExpListSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
Definition
LocTraceToTraceMap.h:56
Nektar::SolverUtils::AdvectionSharedPtr
std::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
Definition
Advection.h:54
Nektar
Definition
CoupledSolver.h:2
Nektar::GetExtrapolateFactory
ExtrapolateFactory & GetExtrapolateFactory()
Definition
Extrapolate.cpp:47
Nektar::NekDouble
double NekDouble
Definition
NektarUnivTypeDefs.hpp:43
Vmath::Svtvp
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
Definition
Vmath.hpp:396
Nektar::OneD
Definition
NektarUnivTypeDefs.hpp:54
Generated on Sun Nov 9 2025 20:17:01 for Nektar++ by
1.9.8