VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
BuoyancyProvider.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 BUOYANCY_PROVIDER_H
36#define BUOYANCY_PROVIDER_H
37
38#include <utility>
39#include <vector>
40
41#include <basics/DataTypes.h>
43
44#include <logger/Logger.h>
45
48
49namespace vf::gpu {
50
51class GridProvider;
52class CudaMemoryManager;
53
55{
56
57public:
58 BuoyancyProviderConstantValue(std::shared_ptr<Parameter> parameter, std::shared_ptr<CudaMemoryManager> cudaMemoryManager)
59 : PreCollisionInteractor(std::move(parameter), std::move(cudaMemoryManager))
60 {
61 VF_LOG_INFO("Using BuoyancyProviderConstantValue");
62
63 if (!para->getBuoyancyEnabled())
64 throw std::runtime_error("BuoyancyProvider: buoyancy needs to be enabled in Parameter!");
65 }
66 ~BuoyancyProviderConstantValue() override = default;
67
68 void init() override {};
69 void interact(int level, uint ) override;
70 void getTaggedFluidNodes(GridProvider* ) override {};
71};
72
74{
75public:
76 BuoyancyProviderPlanarAverage(std::shared_ptr<Parameter> parameter, std::shared_ptr<CudaMemoryManager> cudaMemoryManager)
77 : PreCollisionInteractor(std::move(parameter), std::move(cudaMemoryManager))
78 {
79 VF_LOG_INFO("Using BuoyancyProviderPlanarAverage with buoyancy factor {}", para->getBuoyancyFactor());
80 if (!para->getBuoyancyEnabled())
81 throw std::runtime_error("BuoyancyProvider: buoyancy needs to be enabled in Parameter!");
82 }
83
85
86 void init() override;
87 void interact(int level, uint ) override;
88 void getTaggedFluidNodes(GridProvider* ) override {};
89
99
110
112 {
113 return profileParameters[level];
114 }
116 {
117 return reductionParameters[level];
118 }
119
120private:
121 uint numberOfInitialReferenceValues;
122 int streamIndex;
123 std::vector<ProfileParameters> profileParameters;
124 std::vector<ReductionParameters> reductionParameters;
125};
126
127}
128
129#endif
#define VF_LOG_INFO(...)
Definition Logger.h:50
~BuoyancyProviderConstantValue() override=default
BuoyancyProviderConstantValue(std::shared_ptr< Parameter > parameter, std::shared_ptr< CudaMemoryManager > cudaMemoryManager)
void interact(int level, uint) override
void getTaggedFluidNodes(GridProvider *) override
ReductionParameters & getReductionParameter(int level)
BuoyancyProviderPlanarAverage(std::shared_ptr< Parameter > parameter, std::shared_ptr< CudaMemoryManager > cudaMemoryManager)
void getTaggedFluidNodes(GridProvider *) override
void interact(int level, uint) override
ProfileParameters & getProfileParameter(int level)
SPtr< CudaMemoryManager > cudaMemoryManager
std::shared_ptr< T > SPtr
float real
Definition DataTypes.h:42
unsigned int uint
Definition DataTypes.h:47