OpenLB 1.7
Loading...
Searching...
No Matches
freeEnergyPostProcessor3D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2018 Sam Avis, Robin Trunk
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef FREE_ENERGY_POST_PROCESSOR_3D_H
25#define FREE_ENERGY_POST_PROCESSOR_3D_H
26
27#include "core/blockStructure.h"
28#include "core/postProcessing.h"
29
30/* \file
31 * PostProcessor classes organising the coupling between the lattices for the free energy
32 * model. The PostProcessor for the calculation of the chemical potential needs to be
33 * applied first, as the force relies on its results.
34 */
35
36namespace olb {
37
40template<typename T, typename DESCRIPTOR>
42public:
48 FreeEnergyChemicalPotentialCoupling3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
49 T alpha_, T kappa1_, T kappa2_, T kappa3_,
50 std::vector<BlockStructureD<3>*> partners_);
56 FreeEnergyChemicalPotentialCoupling3D(T alpha_, T kappa1_, T kappa2_, T kappa3_,
57 std::vector<BlockStructureD<3>*> partners_);
58 int extent() const override
59 {
60 return 1;
61 }
62 int extent(int whichDirection) const override
63 {
64 return 1;
65 }
66 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
68 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
69private:
70 using RHO_CACHE = descriptors::FIELD_BASE<3, 0, 0>;
71
72 int x0, x1, y0, y1, z0, z1;
73 T alpha, kappa1, kappa2, kappa3;
74 std::vector<BlockStructureD<3>*> partners;
75};
76
80template<typename T, typename DESCRIPTOR>
81class FreeEnergyForceCoupling3D : public LocalPostProcessor3D<T,DESCRIPTOR> {
82public:
83 FreeEnergyForceCoupling3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
84 std::vector<BlockStructureD<3>*> partners_);
85 FreeEnergyForceCoupling3D(std::vector<BlockStructureD<3>*> partners_);
86 int extent() const override
87 {
88 return 1;
89 }
90 int extent(int whichDirection) const override
91 {
92 return 1;
93 }
94 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
96 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
97private:
98 int x0, x1, y0, y1, z0, z1;
99 std::vector<BlockStructureD<3>*> partners;
100};
101
105template<typename T, typename DESCRIPTOR>
107public:
109 FreeEnergyInletOutletCoupling3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
110 std::vector<BlockStructureD<3>*> partners_);
113 int extent() const override
114 {
115 return 0;
116 }
117 int extent(int whichDirection) const override
118 {
119 return 0;
120 }
121 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
123 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
124private:
125 int x0, x1, y0, y1, z0, z1;
126 std::vector<BlockStructureD<3>*> partners;
127};
128
132template<typename T, typename DESCRIPTOR>
134public:
137 FreeEnergyDensityOutletCoupling3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
138 T rho_, std::vector<BlockStructureD<3>*> partners_);
141 FreeEnergyDensityOutletCoupling3D(T rho_, std::vector<BlockStructureD<3>*> partners_);
142 int extent() const override
143 {
144 return 0;
145 }
146 int extent(int whichDirection) const override
147 {
148 return 0;
149 }
150 void process(BlockLattice<T,DESCRIPTOR>& blockLattice) override;
152 int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override;
153private:
154 int x0, x1, y0, y1, z0, z1;
155 T rho;
156 std::vector<BlockStructureD<3>*> partners;
157};
158
159
161template<typename T, typename DESCRIPTOR>
163public:
168 FreeEnergyChemicalPotentialGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
169 T alpha_, T kappa1_, T kappa2_);
174 FreeEnergyChemicalPotentialGenerator3D(T alpha_, T kappa1_, T kappa2_);
180 FreeEnergyChemicalPotentialGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_,
181 T alpha_, T kappa1_, T kappa2_, T kappa3_);
187 FreeEnergyChemicalPotentialGenerator3D(T alpha_, T kappa1_, T kappa2_, T kappa3_);
188 PostProcessor3D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<3>*> partners) const override;
190private:
191 T alpha, kappa1, kappa2, kappa3;
192};
193
195template<typename T, typename DESCRIPTOR>
197public:
198 FreeEnergyForceGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_);
200 PostProcessor3D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<3>*> partners) const override;
202};
203
205template<typename T, typename DESCRIPTOR>
207public:
208 FreeEnergyInletOutletGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_);
211 PostProcessor3D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<3>*> partners) const override;
213};
214
216template<typename T, typename DESCRIPTOR>
218public:
220 FreeEnergyDensityOutletGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T rho_);
224 PostProcessor3D<T,DESCRIPTOR>* generate(std::vector<BlockStructureD<3>*> partners) const override;
226private:
227 T rho;
228};
229
230}
231
232#endif
Platform-abstracted block lattice for external access and inter-block interaction.
Base of a regular block.
This class calculates the chemical potential and stores it in the external field of the respective la...
FreeEnergyChemicalPotentialCoupling3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T alpha_, T kappa1_, T kappa2_, T kappa3_, std::vector< BlockStructureD< 3 > * > partners_)
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
int extent() const override
Extent of application area (0 for purely local operations)
Generator class for the PostProcessors calculating the chemical potential.
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
LatticeCouplingGenerator3D< T, DESCRIPTOR > * clone() const override
FreeEnergyChemicalPotentialGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T alpha_, T kappa1_, T kappa2_)
Two component free energy model.
PostProcessor for setting a constant density outlet.
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
FreeEnergyDensityOutletCoupling3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T rho_, std::vector< BlockStructureD< 3 > * > partners_)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
int extent() const override
Extent of application area (0 for purely local operations)
Generator class for the PostProcessors assigning the density boundary condition at the outlet.
LatticeCouplingGenerator3D< T, DESCRIPTOR > * clone() const override
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
FreeEnergyDensityOutletGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, T rho_)
PostProcessor calculating the interfacial force in the free energy model.
FreeEnergyForceCoupling3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, std::vector< BlockStructureD< 3 > * > partners_)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
int extent() const override
Extent of application area (0 for purely local operations)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
Generator class for the PostProcessors calculating the interfacial force.
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
LatticeCouplingGenerator3D< T, DESCRIPTOR > * clone() const override
PostProcessor for assigning the velocity at inlet and outlets to lattice two and three.
int extent() const override
Extent of application area (0 for purely local operations)
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
FreeEnergyInletOutletCoupling3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, std::vector< BlockStructureD< 3 > * > partners_)
Generator class for the PostProcessors assigning the velocity at the outlet to lattice two and three.
LatticeCouplingGenerator3D< T, DESCRIPTOR > * clone() const override
PostProcessor3D< T, DESCRIPTOR > * generate(std::vector< BlockStructureD< 3 > * > partners) const override
Top level namespace for all of OpenLB.
Interface for post-processing steps – header file.
Base of a field whose size is defined by [C,U_1,...,U_N]^T * [1,V_1,...V_N].