OpenLB 1.7
Loading...
Searching...
No Matches
particleDescriptors.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2022 Nicolas Hafen, Mathias J. Krause
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 PARTICLE_DESCRIPTORS_H
25#define PARTICLE_DESCRIPTORS_H
26
29
30namespace olb {
31
32namespace descriptors {
33
34//INFO: Initial values can be defined by providing getInitialValue()
35
36//Parent fields ensuring generalized access
37struct ANG_VELOCITY {};
38struct ANG_ACC_STRD {};
39struct ANGLE {};
40struct SINDICATOR {};
41struct TORQUE {};
42struct MOFI {}; //Momentum of inertia
43struct ROT_MATRIX {};
44
45//Common
46struct POSITION : public FIELD_BASE<0, 1, 0> { };
47struct DENSITY : public FIELD_BASE<1, 0, 0> { };
48struct INVALID : public FIELD_BASE<1, 0, 0> { //Storage invalidation, filtered in particleManager
49 template <typename T, typename DESCRIPTOR>
50 static constexpr auto getInitialValue() {
51 return Vector<value_type<T>,DESCRIPTOR::template size<INVALID>()>{false};
52 }
53};
54struct YOUNG_MODULUS : public FIELD_BASE<1, 0, 0> { };
55struct SHEAR_MODULUS : public FIELD_BASE<1, 0, 0> { };
56struct POISSON_RATIO : public FIELD_BASE<1, 0, 0> { };
57struct ADHESION : public FIELD_BASE<2, 0, 0> { };
58struct DYNAMICS_ID : public TYPED_FIELD_BASE<unsigned short, 1, 0, 0> { };
59struct COMPUTE_MOTION : public TYPED_FIELD_BASE<bool, 1, 0, 0> { };
60struct COMPUTE_CONTACT : public TYPED_FIELD_BASE<bool, 1, 0, 0> { };
61//Resolved
62struct ACCELERATION_STRD : public FIELD_BASE<0, 1, 0> { };
63struct SURFACE_ID : public FIELD_BASE<1, 0, 0> { };
64struct COR_OFFSET : public FIELD_BASE<0, 1, 0> { }; //Centre of rotation offset (considering untransformed coordinate system)
65struct IC : public TYPED_FIELD_BASE<int, 1, 0, 0> { };
66struct DETACHING : public TYPED_FIELD_BASE<bool, 1, 0, 0> { };
67struct ELONGATION : public FIELD_BASE<0, 1, 0> { };
68//Subgrid
69struct FORCE_STRD : public FIELD_BASE<0, 1, 0> { };
70struct ACTIVE : public TYPED_FIELD_BASE<bool, 1, 0, 0> { //Disables movement, usually used in dynamics
71 template <typename T, typename DESCRIPTOR>
72 static constexpr auto getInitialValue() {
73 return Vector<value_type<T>,DESCRIPTOR::template size<ACTIVE>()>{true};
74 }
75};
76
77struct ID : public TYPED_FIELD_BASE<size_t, 1, 0, 0> { };
78struct MASS_ADDED : public FIELD_BASE<1, 0, 0> { };
79struct RADIUS : public FIELD_BASE<1, 0, 0> { };
80struct SPECIES : public FIELD_BASE<1, 0, 0> { };
81struct FLUIDVEL : public FIELD_BASE<0, 1, 0> { }; //Prinz 230214
82
83// Contact model
84struct ENLARGEMENT_FOR_CONTACT : public FIELD_BASE<1, 0, 0> { };
85
86//Dimension sensitive fields
87template<unsigned D>
88struct ANG_VELOCITY_XD : public FIELD_BASE<utilities::dimensions::convert<D>::rotation, 0, 0>, public ANG_VELOCITY { };
89template<unsigned D>
90struct ANG_ACC_STRD_XD : public FIELD_BASE<utilities::dimensions::convert<D>::rotation, 0, 0>, public ANG_ACC_STRD { };
91template<unsigned D>
92struct ANGLE_XD : public FIELD_BASE<utilities::dimensions::convert<D>::rotation, 0, 0>, public ANGLE { };
93template<unsigned D>
94struct TORQUE_XD : public FIELD_BASE<utilities::dimensions::convert<D>::rotation, 0, 0>, public TORQUE { };
95template<unsigned D>
96struct MOFI_XD : public FIELD_BASE<utilities::dimensions::convert<D>::rotation, 0, 0>, public MOFI { };
97template<unsigned D>
98struct ROT_MATRIX_XD : public FIELD_BASE<utilities::dimensions::convert<D>::matrix, 0, 0>, public ROT_MATRIX { };
99
100//Indicator
101template<unsigned D>
102struct SINDICATOR_XD : public SINDICATOR, public FIELD_BASE<1> {
103 template <typename T>
105
106 template <typename T>
108
109 template <typename T, typename DESCRIPTOR>
110 static constexpr auto getInitialValue() {
111 return Vector<value_type<T>, DESCRIPTOR::template size<FIELD_BASE<1>>()>{};
112 }
113};
114
115//Counter
116template<typename NAME>
117struct COUNTER : public TYPED_FIELD_BASE<size_t,1,0,0> {};
118
119//Parent descriptors ensuring generalized access
120struct GENERAL {};
121struct MOBILITY {};
122struct SURFACE {};
123struct FORCING {};
125struct DYNBEHAVIOUR {};
131
132//Field wrapping descriptors acting as GROUP
133// -like the field list itself, this list can be extended by custom GROUP descriptors
134// -in order to allow generalized access via getField<GROUP,FIELD> those should always inherit from the parent descriptors
135template<unsigned D>
136struct GENERAL_TMP : public PARTICLE_DESCRIPTOR<D,POSITION>, public GENERAL {};
137
138template<unsigned D>
139struct GENERAL_EXTENDABLE : public PARTICLE_DESCRIPTOR<D,POSITION,INVALID>, public GENERAL {};
140
141template<unsigned D>
142struct MOBILITY_VERLET : public PARTICLE_DESCRIPTOR<D,VELOCITY,ACCELERATION_STRD,ANG_VELOCITY_XD<D>,ANG_ACC_STRD_XD<D>>, public MOBILITY {};
143
144template<unsigned D>
145struct MOBILITY_VERLET_NO_ANGLE : public PARTICLE_DESCRIPTOR<D,VELOCITY,ACCELERATION_STRD>, public MOBILITY {};
146
147template<unsigned D>
148struct MOBILITY_EULER_NO_ANGLE : public PARTICLE_DESCRIPTOR<D,VELOCITY>, public MOBILITY {};
149
150struct DYNBEHAVIOUR_BASIC : public PARTICLE_DESCRIPTOR<1,ACTIVE>, public DYNBEHAVIOUR {};
151
152struct DYNBEHAVIOUR_MULTI_DYN : public PARTICLE_DESCRIPTOR<1,DYNAMICS_ID,COMPUTE_MOTION,COMPUTE_CONTACT>, public DYNBEHAVIOUR {};
153
154struct DYNBEHAVIOUR_DETACHABLE : public PARTICLE_DESCRIPTOR<1,DETACHING,ACTIVE,COUNTER<ACTIVE>,
155 COMPUTE_CONTACT>, public DYNBEHAVIOUR {};
156
157template<unsigned D>
158struct SURFACE_RESOLVED : public PARTICLE_DESCRIPTOR<D,ANGLE_XD<D>,ROT_MATRIX_XD<D>,SINDICATOR_XD<D>>, public SURFACE {};
159
160template<unsigned D>
161struct SURFACE_RESOLVED_COR : public PARTICLE_DESCRIPTOR<D,ANGLE_XD<D>,ROT_MATRIX_XD<D>,SINDICATOR_XD<D>,COR_OFFSET>, public SURFACE {};
162
163template<unsigned D>
164struct SURFACE_RESOLVED_CIRCULAR : public PARTICLE_DESCRIPTOR<D,ANGLE_XD<D>,SINDICATOR_XD<D>>, public SURFACE {};
165
166template<unsigned D>
167struct SURFACE_RESOLVED_PARALLEL : public PARTICLE_DESCRIPTOR<D,ANGLE_XD<D>,ROT_MATRIX_XD<D>,SINDICATOR_XD<D>,SURFACE_ID>, public SURFACE {};
168
169template<unsigned D>
171 : public PARTICLE_DESCRIPTOR<D,ENLARGEMENT_FOR_CONTACT>, public NUMERICPROPERTIES {};
172
173template<unsigned D>
174struct FORCING_RESOLVED : public PARTICLE_DESCRIPTOR<D,FORCE,TORQUE_XD<D>>, public FORCING {};
175
176template<unsigned D>
177struct FORCING_ADHESIVE : public PARTICLE_DESCRIPTOR<D,FORCE,TORQUE_XD<D>,ADHESION>, public FORCING {};
178
179template<unsigned D>
180struct FORCING_SUBGRID : public PARTICLE_DESCRIPTOR<D,FORCE,FORCE_STRD>, public FORCING {};
181
182template<unsigned D>
183struct PHYSPROPERTIES_RESOLVED : public PARTICLE_DESCRIPTOR<D,MASS,MOFI_XD<D>>, public PHYSPROPERTIES {};
184
185template<unsigned D>
186struct PHYSPROPERTIES_RESOLVED_PERMEABLE : public PARTICLE_DESCRIPTOR<D,MASS,MOFI_XD<D>,POROSITY>, public PHYSPROPERTIES {};
187
188template<unsigned D>
189struct PHYSPROPERTIES_SUBGRID : public PARTICLE_DESCRIPTOR<D,MASS,MASS_ADDED,MOFI_XD<D>,RADIUS>, public PHYSPROPERTIES {};
190
191template<unsigned D>
192struct PHYSPROPERTIES_SUBGRID_REACTIVE : public PARTICLE_DESCRIPTOR<D,MASS,MASS_ADDED,MOFI_XD<D>,RADIUS,SPECIES>, public PHYSPROPERTIES {};
193
194template<unsigned D>
195struct MECHPROPERTIES_COLLISION : public PARTICLE_DESCRIPTOR<D,MATERIAL,YOUNG_MODULUS,SHEAR_MODULUS,POISSON_RATIO>, public MECHPROPERTIES {};
196
198
200
201} //namespace descriptors
202
203} //namespace olb
204
205
206#endif
Plain old scalar vector.
Definition vector.h:47
Top level namespace for all of OpenLB.
Abstract declarator of Column-like storage.
Definition column.h:34
static constexpr auto getInitialValue()
Base of a field whose size is defined by [C,U_1,...,U_N]^T * [1,V_1,...V_N].
static constexpr auto getInitialValue()
Base descriptor of a particle system.
static constexpr auto getInitialValue()
typename utilities::dimensions::convert< D >::template surfaceType< T > * value_type
Base of a descriptor field of scalar TYPE with dimensions A*B + B*Q + C.
Converts dimensions by deriving from given cartesian dimension D.