https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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"
18#include "MooseError.h"
19#include "MathFVUtils.h"
20
21#include <memory>
22
23namespace Moose
24{
25namespace FV
26{
28 "vanLeer=0 upwind=1 central_difference=2 min_mod=3 sou=4 quick=5 venkatakrishnan=6", "upwind");
29
30template <typename T>
31std::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
49 return std::make_unique<SOULimiter<T>>();
50
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
63limiterType(const InterpMethod interp_method)
64{
65 switch (interp_method)
66 {
70
73
76
79
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
95template std::unique_ptr<Limiter<Real>> Limiter<Real>::build(const LimiterType limiter);
96template std::unique_ptr<Limiter<ADReal>> Limiter<ADReal>::build(const LimiterType limiter);
97}
98}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
static std::unique_ptr< Limiter > build(LimiterType limiter)
Definition Limiter.C:32
LimiterType limiterType(InterpMethod interp_method)
Return the limiter type associated with the supplied interpolation method.
Definition Limiter.C:63
const MooseEnum moose_limiter_type
InterpMethod
This codifies a set of available ways to interpolate with elem+neighbor solution information to calcu...
Definition MathFVUtils.h:39
@ SkewCorrectedAverage
(gc*elem+(1-gc)*neighbor)+gradient*(rf-rf')
@ Average
gc*elem+(1-gc)*neighbor
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...