https://mooseframework.inl.gov
Limiter.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "MooseEnum.h"
11 #include "VanLeerLimiter.h"
12 #include "UpwindLimiter.h"
14 #include "MinModLimiter.h"
15 #include "SOULimiter.h"
16 #include "QUICKLimiter.h"
17 #include "VenkatakrishnanLimiter.h"
18 #include "MooseError.h"
19 #include "MathFVUtils.h"
20 
21 #include <memory>
22 
23 namespace Moose
24 {
25 namespace FV
26 {
28  "vanLeer=0 upwind=1 central_difference=2 min_mod=3 sou=4 quick=5 venkatakrishnan=6", "upwind");
29 
30 template <typename T>
31 std::unique_ptr<Limiter<T>>
33 {
34  switch (limiter)
35  {
37  return std::make_unique<VanLeerLimiter<T>>();
38 
40  return std::make_unique<UpwindLimiter<T>>();
41 
43  return std::make_unique<CentralDifferenceLimiter<T>>();
44 
46  return std::make_unique<MinModLimiter<T>>();
47 
48  case LimiterType::SOU:
49  return std::make_unique<SOULimiter<T>>();
50 
51  case LimiterType::QUICK:
52  return std::make_unique<QUICKLimiter<T>>();
53 
55  return std::make_unique<VenkatakrishnanLimiter<T>>();
56 
57  default:
58  mooseError("Unrecognized limiter type ", unsigned(limiter));
59  }
60 }
61 
63 limiterType(const InterpMethod interp_method)
64 {
65  switch (interp_method)
66  {
70 
72  return LimiterType::Upwind;
73 
75  return LimiterType::VanLeer;
76 
78  return LimiterType::MinMod;
79 
80  case InterpMethod::SOU:
81  return LimiterType::SOU;
82 
84  return LimiterType::QUICK;
85 
88 
89  default:
90  mooseError("Unrecognized interpolation method type.");
91  }
92 }
93 
94 // instantiations we care about
95 template std::unique_ptr<Limiter<Real>> Limiter<Real>::build(const LimiterType limiter);
96 template std::unique_ptr<Limiter<ADReal>> Limiter<ADReal>::build(const LimiterType limiter);
97 }
98 }
gc*elem+(1-gc)*neighbor
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
LimiterType limiterType(InterpMethod interp_method)
Return the limiter type associated with the supplied interpolation method.
Definition: Limiter.C:63
const MooseEnum moose_limiter_type
LimiterType
Definition: Limiter.h:26
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
(gc*elem+(1-gc)*neighbor)+gradient*(rf-rf&#39;)
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
InterpMethod
This codifies a set of available ways to interpolate with elem+neighbor solution information to calcu...
Definition: MathFVUtils.h:35
static std::unique_ptr< Limiter > build(LimiterType limiter)
Definition: Limiter.C:32