NeoN
A framework for CFD software
Loading...
Searching...
No Matches
ddtFluxCorrBoundary.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 - 2026 NeoN authors
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
10
12{
22inline std::vector<SurfaceBoundary<scalar>>
24{
25 std::vector<SurfaceBoundary<scalar>> bcs;
26 const auto& uBCs = u.boundaryConditions();
27
28 bcs.reserve(uBCs.size());
29
30 for (auto patchID = 0u; patchID < uBCs.size(); ++patchID)
31 {
32 const auto attrs = uBCs[patchID].attributes();
33 Dictionary dict;
34
35 if (attrs.fixesValue)
36 {
37 // Zero correction on U fixedValue patches
38 dict.insert("type", std::string("fixedValue"));
39 dict.insert("fixedValue", scalar(0));
40 bcs.emplace_back(mesh, dict, patchID);
41 }
42 else
43 {
44 dict.insert("type", std::string("calculated"));
45 bcs.emplace_back(mesh, dict, patchID);
46 }
47 }
48
49 return bcs;
50}
51
52} // namespace NeoN::finiteVolume::cellCentred
A class representing a dictionary that stores key-value pairs.
void insert(const std::string &key, const std::any &value)
Inserts a key-value pair into the dictionary.
Represents an unstructured mesh in NeoN.
localIdx size() const
Returns the size of the internal field.
Definition domain.hpp:94
Represents a volume field in a finite volume method.
std::vector< VolumeBoundary< ValueType > > boundaryConditions() const
std::vector< SurfaceBoundary< scalar > > createFluxCorrBCsFromU(const UnstructuredMesh &mesh, const VolumeField< Vec3 > &u)
Boundary condition to apply to ddtFluxCorr surfaceScalarField. It sets the flux correction to zero fo...
float scalar
Definition scalar.hpp:17