ryujin 2.1.1 revision 7ab52d499a3934b3ba6afcabe5103994024860b0
flux_burgers.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2023 by the ryujin authors
4//
5
6#pragma once
7
8#include "flux.h"
9
10namespace ryujin
11{
12 namespace FluxLibrary
13 {
19 class Burgers : public Flux
20 {
21 public:
22 Burgers(const std::string &subsection)
23 : Flux("burgers", subsection)
24 {
25 flux_formula_ = "f(u)={0.5u^2}";
26 }
27
28
29 double value(const double state,
30 const unsigned int /*direction*/) const override
31 {
32 return 0.5 * state * state;
33 }
34
35
36 double gradient(const double state,
37 const unsigned int /*direction*/) const override
38 {
39 return state;
40 }
41 };
42 } // namespace FluxLibrary
43} // namespace ryujin
double gradient(const double state, const unsigned int) const override
Definition: flux_burgers.h:36
double value(const double state, const unsigned int) const override
Definition: flux_burgers.h:29
Burgers(const std::string &subsection)
Definition: flux_burgers.h:22
std::string flux_formula_
Definition: flux.h:87