OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
interspeciescollisions.h
Go to the documentation of this file.
1 
13 #ifndef DECLARATION_INTERSPECIES_FP_H
14 #define DECLARATION_INTERSPECIES_FP_H
15 
16 
20 //-------------------------------------------------------------------
31 //--------------------------------------------------------------
32  public:
34  interspecies_f00_explicit_step(const DistFunc1D& DF1, const DistFunc1D& DF2, const double& deltat);//, int tout_start) //DistFunc1D& DFin,
35 
36  valarray<double> takestep(const valarray<double>& f1in, const valarray<double>& f2in);
37 
38 
39  private:
40  // Variables
41 
42  // SHarmonic1D& f1, f2;
43  valarray<double> fslope;
44 
45  double dt;
47  void calculateintegrals(const valarray<double>& f1in, const valarray<double>& f2in);
48  // vector<double> f1;
49  void remapintegrals();
50 
51  double m1, m2, z1, z2, n1, n2, T1, T2, Gamma12, kpre;
52 
53  valarray<double> pgrid_s1, pgrid_s2;
54  valarray<double> df0;
55  valarray<double> U4, U4m1, U2, U2m1, U1, U1m1, U3, Qn, Pn;
56 
58  valarray<double> J1_s2, I2_s2, I4_s2;
59 
61  valarray<double> J1_s1, I2_s1, I4_s1;
62 
63  int Nbc;
64  int szx;
65 
66  };
67 //--------------------------------------------------------------
68 // Functor to be used in the Runge-Kutta methods
69  class interspecies_f00_RKfunctor : public Algorithms::AbstFunctor<valarray<double>> {
70 //--------------------------------------------------------------
71  public:
72 // Constructor
73  interspecies_f00_RKfunctor(const DistFunc1D& DF1,const DistFunc1D& DF2,const double& smalldt);
75 
76 // Collect all the operators and apply on Yin
77  void operator()(const valarray<double>& fin1, valarray<double>& fslope);
78  void operator()(const valarray<double>& fin1, const valarray<double>& fin2, valarray<double>& fslope);
79  void operator()(const valarray<double>& fin1, valarray<double>& fslope, size_t dir);
80 
81  private:
82  // Variables
84 
85  };
86 //--------------------------------------------------------------
87 
91 //-------------------------------------------------------------------
102 //--------------------------------------------------------------
103  public:
105  interspecies_f00_explicit_collisions(const DistFunc1D& DF1,const DistFunc1D& DF2, const double& deltat);//, int tout_start) //DistFunc1D& DFin,
106 
110  void rkloop(SHarmonic1D& SH1, const SHarmonic1D& SH2);
111 
112  private:
113  // Variables
115  valarray<double> fin1,fin2;
117 
118 
119  size_t num_h;
120  double h;
121 
122  int Nbc;
123  int szx;
124 
125  };
126 //-------------------------------------------------------------------
127 
131 //--------------------------------------------------------------
140 //--------------------------------------------------------------
142 //-------------------------------------------------------------------
143  private:
144 
145 // Define the powers of the velocity
146  valarray<double> vr;
147 
148 // Parameters
149  valarray<double> U4, U4m1, U2, U2m1, U1, U1m1;
150 
151 // Define the integrals
152  valarray<double> J1m, I0, I2;
153 
154 // Define the derivatives of f0
155  valarray<double> df0, ddf0;
156 
157 // Variables for the matrix A, such that A*x = b
158  valarray<double> Scattering_Term;
161 
162 // Constant
163  double I0_density, I2_temperature;
164  double _ZLOGei, _LOGee, kpre, Dt;
166 
167  public:
168 // Constructors/Destructors
169  interspecies_flm_implicit_step(double pmax, size_t nump);
170 
171 // Calculate the coefficients
172  void reset_coeff(const valarray<double>& f00, const double Delta_t);
173 
174 // Explicit Advance
175  void advance(valarray<complex<double> >& fin, const int el);
176  };
177 //-------------------------------------------------------------------
183 //-------------------------------------------------------------------
194  public:
196  interspecies_flm_implicit_collisions(const DistFunc1D &DFin, const double& deltat);
197 
199  void advancef1(DistFunc1D& DF);
200 
202  void advanceflm(DistFunc1D& DF);
203 
204  private:
205  // State1D& Y;
206  double Dt;
207 
208  int Nbc;
209  int szx;
210 
211  size_t l0;
212  size_t m0;
213 
214  valarray<complex<double> > fc;
215  valarray<double> f00;
216 
219 
220  };
221 //--------------------------------------------------------------
224 //-------------------------------------------------------------------
232 //--------------------------------------------------------------
233  public:
235  interspecies_collisions(const State1D& Yin, const size_t& sind, const double& deltat);
236 
237  void advancef00(State1D& Y, const size_t& sind);
238  // void advancef1(State1D& Y, const size_t sin);
239  // void advanceflm(State1D& Y, const size_t sin);
240 
241  private:
242  // Variables
243  vector<interspecies_f00_explicit_collisions> interspecies_f00_collisions;
244  // vector<implicit_flm_interspecies> flm_collisions;
245 
246  // double t, tout;
247  // int Nbc; ///< Number of boundary cells in each direction
248  // int szx; ///< Total cells including boundary cells in x-direction
249 
250 
251  };
252 
253 
254 #endif
valarray< complex< double > > fc
Dummy array.
The top-level container for interspecies collisions over all species on l=0.
int szx
Total cells including boundary cells in x-direction.
valarray< double > J1_s1
The integrals.
interspecies_f00_explicit_step collide
void remapintegrals()
Remap Distribution to momentum grid of colliding particles.
valarray< double > J1_s2
The integrals.
interspecies_flm_implicit_step implicit_step
The object that is responsible for performing the algebra required for the integrals.
The top-level container for collisions on l=0.
int szx
Total cells including boundary cells in x-direction.
int Nbc
Number of boundary cells in each direction.
Algorithms::RK4< valarray< double > > RK4
void calculateintegrals(const valarray< double > &f1in, const valarray< double > &f2in)
Remap Distribution to momentum grid of colliding particles.
A 1D Spherical Harmonic.
Definition: state.h:57
int Nbc
Number of boundary cells in each direction.
Definition: state.h:577
vector< interspecies_f00_explicit_collisions > interspecies_f00_collisions
int Nbc
Number of boundary cells in each direction.
valarray< double > f00
Array for isotropic component distribution function. Needed for calculating coefficients.
valarray< double > takestep(const valarray< double > &f1in, const valarray< double > &f2in)
Collisions between species 1 and 2 in 0,0 harmonic.
int szx
Total cells including boundary cells in x-direction.
interspecies_f00_explicit_step(const DistFunc1D &DF1, const DistFunc1D &DF2, const double &deltat)
Constructors/Destructors.
The 1D distribution function is the container for all SHarmonic1D per species.
Definition: state.h:376