Nektar++
Loading...
Searching...
No Matches
BndCondWallCFEOp.hpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: BndCondWallCFEOp.hpp
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:
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#pragma once
36
38
39#include <SolverCore/BndCond/BndCondUpdateOp.hpp>
40
41namespace Nektar
42{
43
44/**
45 * @brief Viscous wall states for the compressible flow solver.
46 *
47 * Handles the boundary regions tagged `WallViscous` or `WallAdiabatic`. Both
48 * impose no slip, which on a static mesh is the mirrored state
49 *
50 * (rho, -rho u, E)
51 *
52 * taken from the interior trace: density and energy pass through unchanged and
53 * the momentum is reversed, so that the *averaged* wall velocity is zero. The
54 * same state serves the advection and the diffusion flux, which is why it is
55 * written once into the shared boundary storage rather than imposed twice.
56 *
57 * Regions with any other tag are left alone, so a session may mix walls with
58 * ordinary Dirichlet conditions.
59 *
60 * A wall also carries a thermal condition, and which one depends on the tag:
61 * `WallAdiabatic` insulates, imposed as a zero weight on the energy component
62 * of the viscous boundary flux, and `WallViscous` is held at the session
63 * temperature `Twall`, imposed on the exterior state the diffusion averages
64 * against. Neither reaches the boundary storage, because neither may reach the
65 * Riemann solver.
66 *
67 * Resolves the equation of state from the session, as the volume flux
68 * operators do: the isothermal condition needs the internal energy that goes
69 * with a prescribed temperature.
70 */
71template <typename TData>
72class BndCondWallCFEOp : public SolverCore::BndCondUpdateOp<TData>
73{
74
75public:
76 static std::shared_ptr<BndCondWallCFEOp<TData>> Create(
77 const MultiRegions::ExpListSharedPtr &expansionList,
78 const std::vector<std::string> &components,
79 const std::string &execStr = "")
80 {
81 std::string EoSName;
82
83 if (expansionList->GetSession()->DefinesEquationOfState())
84 {
86 expansionList->GetSession()->GetEquationOfState().type);
87 }
88 else
89 {
91 "No EquationOfState section defined in session file");
92 }
93
94 // The key carries the equation of state, as the volume flux operators
95 // do, so the lookup cannot go through Operator::Create<TOperator>(),
96 // which builds the key from the class name alone.
97 const std::string execStr0 =
99 expansionList->GetSession())
100 : execStr;
101
102 const std::string requestedKey = name + EoSName + execStr0;
103
105 MultiRegions::GetOperatorFactory<TData>();
106
107 if (!factory.ModuleExists(requestedKey))
108 {
109 std::stringstream msg;
110 msg << "No such operator: " << requestedKey << std::endl;
111 factory.PrintAvailableClasses(msg);
112 NEKERROR(ErrorUtil::efatal, msg.str());
113 }
114
115 return std::static_pointer_cast<BndCondWallCFEOp<TData>>(
116 factory.CreateInstance(requestedKey, expansionList, components));
117 }
118
119 static inline const std::string name = "BndCondWallCFE";
120
121protected:
123 const std::vector<std::string> &components)
124 : SolverCore::BndCondUpdateOp<TData>(expansionList, components)
125 {
126 }
127
128 ~BndCondWallCFEOp() override = default;
129};
130
131} // namespace Nektar
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Viscous wall states for the compressible flow solver.
static std::shared_ptr< BndCondWallCFEOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
BndCondWallCFEOp(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
~BndCondWallCFEOp() override=default
static const std::string name
bool ModuleExists(tKey idKey)
Checks if a particular module is available.
tBasePtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
void PrintAvailableClasses(std::ostream &pOut=std::cout)
Prints the available classes to stdout.
Common base class of the operator family interfaces: holds the expansion list, component names and da...
Definition Operator.hpp:100
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::string ToUpperCopy(std::string str)