Nektar++
Loading...
Searching...
No Matches
BndCondPressureOutflowCFEOp.hpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: BndCondPressureOutflowCFEOp.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: Pressure outflow boundary condition base class.
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#pragma once
36
38
39#include <SolverCore/BndCond/BndCondUpdateOp.hpp>
40
41namespace Nektar
42{
43
44/**
45 * @brief Subsonic pressure outflow, as a boundary state.
46 *
47 * Resolves the equation of state from the session, in the same way as the
48 * volume flux operators, because the condition needs both a sound speed - to
49 * decide whether the outflow is subsonic - and the internal energy that goes
50 * with a prescribed pressure.
51 *
52 * @see BndCondPressureOutflowCFEOpImpl for the condition itself.
53 */
54template <typename TData>
55class BndCondPressureOutflowCFEOp : public SolverCore::BndCondUpdateOp<TData>
56{
57public:
58 static std::shared_ptr<BndCondPressureOutflowCFEOp<TData>> Create(
59 const MultiRegions::ExpListSharedPtr &expansionList,
60 const std::vector<std::string> &components,
61 const std::string &execStr = "")
62 {
63 std::string EoSName;
64
65 if (expansionList->GetSession()->DefinesEquationOfState())
66 {
68 expansionList->GetSession()->GetEquationOfState().type);
69 }
70 else
71 {
73 "No EquationOfState section defined in session file");
74 }
75
76 // The key carries the equation of state, as the volume flux operators
77 // do, so the lookup cannot go through Operator::Create<TOperator>(),
78 // which builds the key from the class name alone.
79 const std::string execStr0 =
81 expansionList->GetSession())
82 : execStr;
83
84 const std::string requestedKey = name + EoSName + execStr0;
85
87 MultiRegions::GetOperatorFactory<TData>();
88
89 if (!factory.ModuleExists(requestedKey))
90 {
91 std::stringstream msg;
92 msg << "No such operator: " << requestedKey << std::endl;
93 factory.PrintAvailableClasses(msg);
94 NEKERROR(ErrorUtil::efatal, msg.str());
95 }
96
97 return std::static_pointer_cast<BndCondPressureOutflowCFEOp<TData>>(
98 factory.CreateInstance(requestedKey, expansionList, components));
99 }
100
101 static inline const std::string name = "BndCondPressureOutflowCFE";
102
103protected:
105 const MultiRegions::ExpListSharedPtr &expansionList,
106 const std::vector<std::string> &components)
107 : SolverCore::BndCondUpdateOp<TData>(expansionList, components)
108 {
109 }
110
111 ~BndCondPressureOutflowCFEOp() override = default;
112};
113
114} // namespace Nektar
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Subsonic pressure outflow, as a boundary state.
BndCondPressureOutflowCFEOp(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
~BndCondPressureOutflowCFEOp() override=default
static std::shared_ptr< BndCondPressureOutflowCFEOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
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)