OpenLB 1.7
Loading...
Searching...
No Matches
magneticParticle3D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2016 Thomas Henn, Mathias J. Krause, Davide Dapelo
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 MAGNETIC_PARTICLE_3D_H
25#define MAGNETIC_PARTICLE_3D_H
26
27#include <set>
28#include <vector>
29#include <list>
30#include <deque>
31#include <string>
32#include <iostream>
34
35namespace olb {
36
37
39
40/*
41 * Particles for magnetic force
42 */
43template<typename T>
45private:
46 std::vector<T> _dMoment;
47 std::vector<T> _aVel;
48 std::vector<T> _torque;
49 T _magnetisation;
50 // _sActivity values range from 1 to 3
51 // Gives information about the position of the particle in the simulation area
52 // One collision model:
53 // 1: Particle is not deposited
54 // 2: Not in use
55 // 3: Particle is deposited on mag. wire.
56 // Multiple collision models:
57 // 1: Particle is in sufficiently large distance to the inhom. mag. field of the wire
58 // Particle collisions are managed by a collision model function
59 // 2: Particle is within the inhom. mag. field of the wire
60 // Particle collisions are managed by a mechanic contact force
61 // The sActivity change (1 --> 2) is done in explicitEuler()
62 // 3: Particle is deposited on mag. wire.
63 // Particle collisions are managed by a mechanic contact force
64 int _sActivity;
65 // Assigns an agglomerate to the particle
66 typename std::deque<std::list<MagneticParticle3D<T>*>>::iterator _aggloItr;
67 // Assigns the particle position in an Agglomerate to a Particle
68 // typename std::list<MagneticParticle3D<T>*>::iterator _aggloItrPos;
69
70public:
72 MagneticParticle3D(std::vector<T> pos, T mas = 1., T rad = 1., int id = 0);
73 MagneticParticle3D(std::vector<T> pos, std::vector<T> vel, T mas = 1., T rad = 1., int id = 0, T masAdd = 1.);
75 MagneticParticle3D(std::vector<T> pos, std::vector<T> vel, T mas, T rad, int id,
76 std::vector<T> dMoment, std::vector<T> aVel, std::vector<T> torque, T magnetisation);
77 MagneticParticle3D(std::vector<T> pos, std::vector<T> vel, T mas, T rad, int id,
78 std::vector<T> dMoment, std::vector<T> aVel, std::vector<T> torque, T magnetisation, int sActivity);
79 static const int serialPartSize = 28;
80 void serialize(T serial[]);
81 void unserialize(T*);
82 // Set torque zero
83 inline void resetTorque();
84 // Set and get orientation of magnetic dipolemoment
85 inline void setMoment(std::vector<T> moment);
86 inline std::vector<T>& getMoment();
87 inline const std::vector<T>& getMoment() const;
88 // Set and get angular velocity
89 inline void setAVel(std::vector<T> aVel);
90 inline std::vector<T>& getAVel();
91 inline const std::vector<T>& getAVel() const;
92 // Set and get torque
93 inline void setTorque(std::vector<T> torque);
94 inline std::vector<T>& getTorque();
95 inline const std::vector<T>& getTorque() const;
96 // Set and get magnetisation
97 inline void setMagnetisation(T magnetisation);
98 inline T& getMagnetisation();
99 inline const T& getMagnetisation() const;
100 // Set and get sActivity
101 inline void setSActivity(int sActivity);
102 inline int& getSActivity();
103 // Set and get aggloItr
104 inline void setAggloItr(typename std::deque<std::list<MagneticParticle3D<T>*>>::iterator aggloItr);
105 inline typename std::deque<std::list<MagneticParticle3D<T>*>>::iterator& getAggloItr();
106};
107
109template<typename T>
111public:
113 inline void simulate(T dT, bool scale = false);
114 inline void simulateWithTwoWayCoupling_Mathias ( T dT,
117 int material, int subSteps = 1, bool scale = false );
118 inline void simulateWithTwoWayCoupling_Davide ( T dT,
121 int material, int subSteps = 1, bool scale = false );
122// multiple collision models
123 inline void simulate(T dT, std::set<int> sActivityOfParticle, bool scale = false);
124
125private:
127
128};
129
130
131}
132#endif
133
Abstact base class for BaseBackCouplingModel.
Abstact base class for all the forward-coupling models Its raison d'etre consists of not being temple...
std::vector< T > & getTorque()
void setSActivity(int sActivity)
void setTorque(std::vector< T > torque)
std::deque< std::list< MagneticParticle3D< T > * > >::iterator & getAggloItr()
void setMagnetisation(T magnetisation)
std::vector< T > & getAVel()
std::vector< T > & getMoment()
void setAggloItr(typename std::deque< std::list< MagneticParticle3D< T > * > >::iterator aggloItr)
void setMoment(std::vector< T > moment)
void setAVel(std::vector< T > aVel)
static const int serialPartSize
MagneticParticle3D(std::vector< T > pos, T mas=1., T rad=1., int id=0)
void simulateWithTwoWayCoupling_Mathias(T dT, ForwardCouplingModel< T, PARTICLETYPE > &forwardCoupling, BackCouplingModel< T, PARTICLETYPE > &backCoupling, int material, int subSteps=1, bool scale=false)
SimulateParticles(ParticleSystem3D< T, PARTICLETYPE > *ps)
void simulateWithTwoWayCoupling_Davide(T dT, ForwardCouplingModel< T, PARTICLETYPE > &forwardCoupling, BackCouplingModel< T, PARTICLETYPE > &backCoupling, int material, int subSteps=1, bool scale=false)
void simulate(T dT, bool scale=false)
Top level namespace for all of OpenLB.