OpenLB 1.8.1
Loading...
Searching...
No Matches
phaseFieldInletOutlet2D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2024 Tim Bingert, Luiz Eduardo Czelusniak
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//This file contains all inlet and outlet boundary conditions of phase field models
25//This boundary only contains free floating functions
26
27#ifndef PHASE_FIELD_INLET_OUTLET_2D_H
28#define PHASE_FIELD_INLET_OUTLET_2D_H
29
30#include "setBoundary.h"
32#include "zouHeDynamics.h"
35
36namespace olb {
37
38namespace boundary {
39
40template <concepts::BaseType T, concepts::LatticeDescriptor DESCRIPTOR, typename MixinDynamics>
41requires (DESCRIPTOR::d == 2)
43
44using value_t = T;
45using descriptor_t = DESCRIPTOR;
46
50
71
72std::optional<PostProcessorPromise<T,DESCRIPTOR>> getPostProcessor(DiscreteNormalType type,
74 switch (type) {
77
78 default:
79 return std::nullopt;
80 }
81}
82
83};
84
85template <concepts::BaseType T, concepts::LatticeDescriptor DESCRIPTOR, typename MixinDynamics>
86requires (DESCRIPTOR::d == 2)
88
89using value_t = T;
90using descriptor_t = DESCRIPTOR;
91
95
96std::optional<DynamicsPromise<T,DESCRIPTOR>> getDynamics(DiscreteNormalType type,
98 switch (type) {
102 >::construct(n);
103
106
110 >::construct(n);
111
112 default:
113 return std::nullopt;
114 }
115}
116
117std::optional<PostProcessorPromise<T,DESCRIPTOR>> getPostProcessor(DiscreteNormalType type,
119 switch (type) {
120
123
124 default:
125 return std::nullopt;
126 }
127}
128
129};
130
131template <concepts::BaseType T, concepts::LatticeDescriptor DESCRIPTOR, typename MixinDynamics>
132requires (DESCRIPTOR::d == 2)
134
135using value_t = T;
136using descriptor_t = DESCRIPTOR;
137
139 return 1;
140}
141
142std::optional<DynamicsPromise<T,DESCRIPTOR>> getDynamics(DiscreteNormalType type,
144 switch (type) {
148 >::construct(n);
149
152
156 >::construct(n);
157
158 default:
159 return std::nullopt;
160 }
161}
162
163std::optional<PostProcessorPromise<T,DESCRIPTOR>> getPostProcessor(DiscreteNormalType type,
165 switch (type) {
168
169 default:
170 return std::nullopt;
171 }
172}
173
174};
175
176
177// needs to be reworked when there are flexible stages for new bc style
178template <concepts::BaseType T, concepts::LatticeDescriptor DESCRIPTOR, typename MixinDynamics>
179requires (DESCRIPTOR::d == 2)
181
182using value_t = T;
183using descriptor_t = DESCRIPTOR;
184
186 return 1;
187}
188
189std::optional<DynamicsPromise<T,DESCRIPTOR>> getDynamics(DiscreteNormalType type,
191 switch (type) {
195 >::construct(n);
196
198 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
199 return std::nullopt;
200
202 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
203 return std::nullopt;
204
205 default:
206 return std::nullopt;
207 }
208}
209
214
215};
216
217template <concepts::BaseType T, concepts::LatticeDescriptor DESCRIPTOR, typename MixinDynamics>
218requires (DESCRIPTOR::d == 2)
219struct FreeEnergyVelocity<T,DESCRIPTOR,MixinDynamics> {
220
221using value_t = T;
222using descriptor_t = DESCRIPTOR;
223
225 return 1;
226}
227
228std::optional<DynamicsPromise<T,DESCRIPTOR>> getDynamics(DiscreteNormalType type,
230 switch (type) {
234 >::construct(n);
235
237 return std::nullopt;
238
240 return std::nullopt;
241
242 default:
243 return std::nullopt;
244 }
245}
246
247std::optional<PostProcessorPromise<T,DESCRIPTOR>> getPostProcessor(DiscreteNormalType type,
249 switch (type) {
252
254 return std::nullopt;
255
257 return std::nullopt;
258
259 default:
260 return std::nullopt;
261 }
262}
263
264};
265
266template <concepts::BaseType T, concepts::LatticeDescriptor DESCRIPTOR, typename MixinDynamics>
267requires (DESCRIPTOR::d == 2)
268struct FreeEnergyPressure<T,DESCRIPTOR,MixinDynamics> {
269
270using value_t = T;
271using descriptor_t = DESCRIPTOR;
272
274 return 1;
275}
276
277std::optional<DynamicsPromise<T,DESCRIPTOR>> getDynamics(DiscreteNormalType type,
279 switch (type) {
283 >::construct(n);
284
286 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
287 return std::nullopt;
288
290 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
291 return std::nullopt;
292
293 default:
294 return std::nullopt;
295 }
296}
297
298std::optional<PostProcessorPromise<T,DESCRIPTOR>> getPostProcessor(DiscreteNormalType type,
300 switch (type) {
303
305 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
306 return std::nullopt;
307
309 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
310 return std::nullopt;
311
312 default:
313 return std::nullopt;
314 }
315}
316
317};
318
319template <concepts::BaseType T, concepts::LatticeDescriptor DESCRIPTOR, typename MixinDynamics>
320requires (DESCRIPTOR::d == 2)
321struct FreeEnergyPressureConvective<T,DESCRIPTOR,MixinDynamics> {
322
323using value_t = T;
324using descriptor_t = DESCRIPTOR;
325
327 return 1;
328}
329
330std::optional<DynamicsPromise<T,DESCRIPTOR>> getDynamics(DiscreteNormalType type,
332 switch (type) {
336 >::construct(n);
337
339 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
340 return std::nullopt;
341
343 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
344 return std::nullopt;
345
346 default:
347 return std::nullopt;
348 }
349}
350
351std::optional<PostProcessorPromise<T,DESCRIPTOR>> getPostProcessor(DiscreteNormalType type,
353 switch (type) {
356
358 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
360
362 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
364
365 default:
366 return std::nullopt;
367 }
368}
369
370};
371
372template <concepts::BaseType T, concepts::LatticeDescriptor DESCRIPTOR>
373requires (DESCRIPTOR::d == 2)
374struct FreeEnergyOrderParameter<T,DESCRIPTOR> {
375
376using value_t = T;
377using descriptor_t = DESCRIPTOR;
378
380 return 1;
381}
382
383std::optional<DynamicsPromise<T,DESCRIPTOR>> getDynamics(DiscreteNormalType type,
385 switch (type) {
388 ::construct(n);
389
391 return std::nullopt;
392
394 return std::nullopt;
395
396 default:
397 return std::nullopt;
398 }
399}
400
401std::optional<PostProcessorPromise<T,DESCRIPTOR>> getPostProcessor(DiscreteNormalType type,
403 switch (type) {
406
408 return std::nullopt;
409
411 return std::nullopt;
412
413 default:
414 return std::nullopt;
415 }
416}
417
418};
419
420template <concepts::BaseType T, concepts::LatticeDescriptor DESCRIPTOR>
421requires (DESCRIPTOR::d == 2)
422struct FreeEnergyOrderParameterConvective<T,DESCRIPTOR> {
423
424using value_t = T;
425using descriptor_t = DESCRIPTOR;
426
428 return 1;
429}
430
431std::optional<DynamicsPromise<T,DESCRIPTOR>> getDynamics(DiscreteNormalType type,
433 switch (type) {
436 ::construct(n);
437
439 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
440 return std::nullopt;
441
443 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
444 return std::nullopt;
445
446 default:
447 return std::nullopt;
448 }
449}
450
451std::optional<PostProcessorPromise<T,DESCRIPTOR>> getPostProcessor(DiscreteNormalType type,
453 switch (type) {
456
458 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
459 return std::nullopt;
460
462 throw std::runtime_error("No valid discrete normal found. This BC is not suited for curved walls.");
463 return std::nullopt;
464
465 default:
466 return std::nullopt;
467 }
468}
469
470};
471
472}
473
474}
475
476#endif
Regularized BGK collision followed by any other Dynamics.
Definition dynamics.h:395
Implementation of Dirichlet boundary condition for the order parameter.
Plain old scalar vector.
In this file the dynamic calls for the free energy model is implemented.
PostProcessorPromise< T, DESCRIPTOR > promisePostProcessorForNormal(Vector< int, 2 > n)
Top level namespace for all of OpenLB.
DiscreteNormalType
Type associated with a discrete normal vector.
@ ExternalCorner
Normal detected as flat plane.
@ InternalCorner
Normal detected as external corner.
std::int64_t CellDistance
Type for in-memory distance of block-local cell indices.
Implementation of convective boundary condition for the order parameter.
std::optional< DynamicsPromise< T, DESCRIPTOR > > getDynamics(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< PostProcessorPromise< T, DESCRIPTOR > > getPostProcessor(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< PostProcessorPromise< T, DESCRIPTOR > > getPostProcessor(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< DynamicsPromise< T, DESCRIPTOR > > getDynamics(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< DynamicsPromise< T, DESCRIPTOR > > getDynamics(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< PostProcessorPromise< T, DESCRIPTOR > > getPostProcessor(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< DynamicsPromise< T, DESCRIPTOR > > getDynamics(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< PostProcessorPromise< T, DESCRIPTOR > > getPostProcessor(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< PostProcessorPromise< T, DESCRIPTOR > > getPostProcessor(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< DynamicsPromise< T, DESCRIPTOR > > getDynamics(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< DynamicsPromise< T, DESCRIPTOR > > getDynamics(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< PostProcessorPromise< T, DESCRIPTOR > > getPostProcessor(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< PostProcessorPromise< T, DESCRIPTOR > > getPostProcessor(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< DynamicsPromise< T, DESCRIPTOR > > getDynamics(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< PostProcessorPromise< T, DESCRIPTOR > > getPostProcessor(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< DynamicsPromise< T, DESCRIPTOR > > getDynamics(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< PostProcessorPromise< T, DESCRIPTOR > > getPostProcessor(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
std::optional< DynamicsPromise< T, DESCRIPTOR > > getDynamics(DiscreteNormalType type, DiscreteNormal< DESCRIPTOR > n)
Identity type to pass non-constructible types as value.
Definition meta.h:79