NeoN
A framework for CFD software
Loading...
Searching...
No Matches
sourceTerm.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2023 - 2026 NeoN authors
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
9#include "NeoN/core/input.hpp"
10#include "NeoN/dsl/operator.hpp"
13
15{
16
17
18template<typename ValueType>
19class SourceTerm : public dsl::OperatorMixin<VolumeField<ValueType>>
20{
21
22public:
23
24 using VectorValueType = ValueType;
25
26 // Sp: source += scaling * coefficients * field (implicit or explicit).
27 // With suSp = true this is instead the sign-aware SuSp split: the
28 // positive part of the coefficient is treated implicitly (added to the
29 // diagonal) and the negative part explicitly (added to the rhs using the
30 // current field), so a coefficient of either sign keeps the matrix diagonally
31 // dominant. Used by the kOmegaSST cross-diffusion / dilatation terms.
33 dsl::Operator::Type termType,
34 const VolumeField<scalar>& coefficients,
35 const VolumeField<ValueType>& field,
36 bool suSp = false
37 );
38
39 // Su: source += scaling * coefficients (explicit only)
41
43
45
47
48 void read(const Input&) {}
49
50 std::string getName() const { return "sourceTerm"; }
51
52
53 Dictionary getConfig() const { return {}; }
54
55private:
56
57 // Non-null for Sp mode. Null for Su mode (field_ from mixin IS the coefficient).
58 const VolumeField<scalar>* spCoeff_;
59
60 // When true (and spCoeff_ non-null) the implicit assembly uses the SuSp sign split.
61 bool suSp_;
62};
63
64
65} // namespace NeoN::finiteVolume::cellCentred
A class representing a dictionary that stores key-value pairs.
A class to contain the data and executors for a field and define some basic operations.
Definition vector.hpp:27
void explicitOperation(Vector< ValueType > &source) const
void implicitOperation(la::LinearSystem< ValueType > &ls) const
SourceTerm(dsl::Operator::Type termType, const VolumeField< scalar > &coefficients, const VolumeField< ValueType > &field, bool suSp=false)
SourceTerm(dsl::Operator::Type termType, VolumeField< ValueType > &coefficients)
Represents a volume field in a finite volume method.
A class representing a linear system of equations.
std::variant< Dictionary, TokenList > Input
Definition input.hpp:15