forked from chess-uiuc/Theseus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNSOperator.hpp
More file actions
77 lines (69 loc) · 3.4 KB
/
Copy pathNSOperator.hpp
File metadata and controls
77 lines (69 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Copyright (c) 2025-2026 Board of Trustees of the University of Illinois
//
// This file is part of Theseus.
//
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include "RHSOperator.hpp"
namespace Theseus
{
template<typename PhysicsT>
class NSOperator : public Theseus::RHSOperator<PhysicsT>
{
public:
using Physics = PhysicsT;
using Base = Theseus::RHSOperator<Physics>;
using OperatorCache = typename Base::OperatorCache;
using DeviceCache = typename Base::DeviceCache;
using Gas = typename Base::Gas;
using InviscidFlux = typename Base::InviscidFlux;
protected:
using Base::operator_cache;
using Base::device_cache;
using Base::max_char_speed;
private:
std::vector<std::shared_ptr<mfem::ParGridFunction> > grad_u;
public:
NSOperator(std::shared_ptr<mfem::ParFiniteElementSpace> vfes_,
std::shared_ptr<mfem::ParFiniteElementSpace> fes0_,
std::shared_ptr<mfem::ParMesh> pmesh_,
std::shared_ptr<mfem::ParGridFunction> eta_,
std::shared_ptr<mfem::ParGridFunction> alpha_,
std::vector<std::shared_ptr<mfem::ParGridFunction> > &grad_u_,
std::shared_ptr<Prandtl::PerssonPeraireIndicator> indicator_,
std::shared_ptr<const Gas> gasModel_,
const std::string &gasModelName_,
const std::string &numFluxName_,
std::shared_ptr<mfem::ParGridFunction> r_gf_ = nullptr,
const mfem::real_t alpha_max=0.5, const mfem::real_t alpha_min=0.001)
: RHSOperator<Physics>(vfes_, fes0_, pmesh_, eta_, alpha_,
indicator_, gasModel_, gasModelName_, numFluxName_,
"NavierStokes", r_gf_, alpha_max, alpha_min),
grad_u(grad_u_)
{}
// Top level RHS routine
mfem::real_t FlowMult(const mfem::Vector &u, mfem::Vector &dudt) const override;
// Gradient Operator Interface (BR1 aux rhs)
void GradOperator(const mfem::Vector &u, std::vector<mfem::Vector *> &grad_u) const;
void GradOperator_Volume(const mfem::Vector &pu, std::vector<mfem::Vector *> &p_grad_u) const;
void GradOperator_InteriorFaces(const mfem::Vector &pu, std::vector<mfem::Vector *> &p_grad_u) const;
void GradOperator_BoundaryFaces(const mfem::Vector &pu, std::vector<mfem::Vector *> &p_grad_u) const;
void ComputeEntropyState(const mfem::Vector &u, mfem::Vector &e) const;
void ComputeGradPrimFromGradEntropy(const mfem::Vector &u,
std::vector<mfem::Vector *> &gradEntropy) const;
// NavierStokes RHS Interface
mfem::real_t MultCNS(const mfem::Vector &u,
const std::vector<mfem::Vector *> &grad_prim,
mfem::Vector &pdudt) const;
mfem::real_t MultCNS_Volume(const mfem::Vector &pu,
const std::vector<mfem::Vector *> &p_grad_prim,
mfem::Vector &pdudt) const;
mfem::real_t MultCNS_InteriorFaces(const mfem::Vector &pu,
const std::vector<mfem::Vector *> &p_grad_prim,
mfem::Vector &pdudt) const;
mfem::real_t MultCNS_BoundaryFaces(const mfem::Vector &pu,
const std::vector<mfem::Vector *> &p_grad_prim,
mfem::Vector &pdudt) const;
};
}
#include "NSOperator_impl.hpp"