VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
PressureBC.h
Go to the documentation of this file.
1//=======================================================================================
2// ____ ____ __ ______ __________ __ __ __ __
3// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
4// \ \ | | | | | |_) | | | | | | | / \ | |
5// \ \ | | | | | _ / | | | | | | / /\ \ | |
6// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
7// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
8// \ \ | | ________________________________________________________________
9// \ \ | | | ______________________________________________________________|
10// \ \| | | | __ __ __ __ ______ _______
11// \ | | |_____ | | | | | | | | | _ \ / _____)
12// \ | | _____| | | | | | | | | | | \ \ \_______
13// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
14// \ _____| |__| |________| \_______/ |__| |______/ (_______/
15//
16// This file is part of VirtualFluids. VirtualFluids is free software: you can
17// redistribute it and/or modify it under the terms of the GNU General Public
18// License as published by the Free Software Foundation, either version 3 of
19// the License, or (at your option) any later version.
20//
21// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
22// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24// for more details.
25//
26// SPDX-License-Identifier: GPL-3.0-or-later
27// SPDX-FileCopyrightText: Copyright © VirtualFluids Project contributors, see AUTHORS.md in root folder
28//
33//=======================================================================================
34
35#ifndef PressureBC_H
36#define PressureBC_H
37
38#include <iostream>
39#include <sstream>
40#include <string>
41#include <vector>
42
43//#include "basics/utilities/UbMath.h"
45
46#include "BC.h"
47#include "BCFunction.h"
48
49class PressureBC : public BC
50{
51public:
52 // constructors
53 PressureBC() { this->init(); }
54 PressureBC(const real &dens, const real &startTime = 0.0, const real &endTime = BCFunction::INFCONST);
56 PressureBC(const std::vector<BCFunction> &densBCs);
57 PressureBC(const mu::Parser &function, const real &startTime = 0.0,
58 const real &endTime = BCFunction::INFCONST);
59
60 //------------- implements D3Q27BoundaryConditionAdapter ----- start
61 std::string toString();
62
63 void init(const D3Q27Interactor *const &interactor, const real &time = 0) override;
64 void update(const D3Q27Interactor *const &interactor, const real &time = 0) override;
65
67 const real &worldX2, const real &worldX3, const real &q, const int &fdirection,
68 const real &time = 0) override;
69 void adaptBC(const D3Q27Interactor &interactor, SPtr<BoundaryConditions> bc, const real &worldX1,
70 const real &worldX2, const real &worldX3, const real &time = 0) override;
71
72 real getDensity(const real &x1, const real &x2, const real &x3, const real &timeStep);
73
74 //------------- implements D3Q27BoundaryConditionAdapter ----- end
75
76protected:
77 void init();
78
79 // time dependency wird automatisch ueber D3Q27BCFunction Intervalle ermittelt!
80 void setTimeDependent() { (this->type |= TIMEDEPENDENT); }
81 void unsetTimeDependent() { (this->type &= ~TIMEDEPENDENT); }
82
83 void clear() { densBCs.clear(); }
84 void setNodeDensity(const D3Q27Interactor &interactor, SPtr<BoundaryConditions> bc, const real &worldX1,
85 const real &worldX2, const real &worldX3, const real &timestep);
86
87private:
88 mu::value_type x1, x2, x3; // brauch man nicht serialisieren!
89 mu::value_type timeStep; // brauch man nicht serialisieren!
90
91 mu::Parser *tmpDensityFunction; // brauch man nicht serialisieren!
92
93 std::vector<BCFunction> densBCs;
94
95private:
96};
97
98#endif
99
A class implements function parcer for boundary conditions.
Definition BCFunction.h:45
Abstract class of baundary conditions adapter.
Definition BC.h:48
static const char TIMEDEPENDENT
Definition BC.h:86
char type
Definition BC.h:82
A specialized class for grid generation.
void unsetTimeDependent()
Definition PressureBC.h:81
void setTimeDependent()
Definition PressureBC.h:80
void clear()
Definition PressureBC.h:83
std::shared_ptr< T > SPtr
float real
Definition DataTypes.h:42
void update(const D3Q27Interactor *const &interactor, const real &time=0) override
void adaptBC(const D3Q27Interactor &interactor, SPtr< BoundaryConditions > bc, const real &worldX1, const real &worldX2, const real &worldX3, const real &time=0) override
void adaptBCForDirection(const D3Q27Interactor &interactor, SPtr< BoundaryConditions > bc, const real &worldX1, const real &worldX2, const real &worldX3, const real &q, const int &fdirection, const real &time=0) override
static const real INFCONST
Definition BCFunction.h:48
void init()
void setNodeDensity(const D3Q27Interactor &interactor, SPtr< BoundaryConditions > bc, const real &worldX1, const real &worldX2, const real &worldX3, const real &timestep)
std::string toString()
real getDensity(const real &x1, const real &x2, const real &x3, const real &timeStep)