OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
IB_f00 Class Reference

#include <laser.h>

Collaboration diagram for IB_f00:

Public Member Functions

 IB_f00 (valarray< double > &fslope, double pmax)
 
valarray< double > & Getslope (const valarray< double > &fin, const double vos, const double Zval)
 

Private Attributes

valarray< double > & fh
 
valarray< double > vr
 
valarray< double > U4
 
valarray< double > U4m1
 
valarray< double > U2
 
valarray< double > U2m1
 
valarray< double > Inv_Uav6
 
valarray< double > gn
 
valarray< double > Qn
 
valarray< double > Pn
 
double c_kpre
 
double Qn_coeff
 
double vw_coeff_cube
 
double Inv_Uav6_nm1
 
double Pnm1
 
Formulary formulas
 

Detailed Description

Definition at line 20 of file laser.h.

Constructor & Destructor Documentation

◆ IB_f00()

IB_f00::IB_f00 ( valarray< double > &  fslope,
double  pmax 
)

Definition at line 50 of file laser.cpp.

References Inv_Uav6, Inv_Uav6_nm1, Input::List(), Pn, Pnm1, Qn, Qn_coeff, U2, U2m1, U4, U4m1, vr, and vw_coeff_cube.

54  : fh(fslope),
55 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 // Velocity
57 // vr(Algorithms::MakeAxis(pmax/(2.0*fslope.size()-1.0),pmax,fslope.size())),
58  vr(Algorithms::MakeCAxis(0.0,pmax,fslope.size())),
59 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60 // Constants for Integrals
61  U4(0.0, fslope.size()),
62  U4m1(0.0, fslope.size()),
63  U2(0.0, fslope.size()),
64  U2m1(0.0, fslope.size()),
65 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66  Inv_Uav6(0.0, fslope.size()),
67  gn(0.0, fslope.size()),
68  Qn(0.0, fslope.size()),
69  Pn(0.0, fslope.size())
70 {
71 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
72 
73  //classical electron radius
74  double re(2.8179402894e-13);
75  double kp(sqrt(4.0*M_PI*(Input::List().density_np)*re));
76  double omega_0(3.0e+10*2.0*M_PI/(1.0e-4*Input::List().lambda_0));
77  double omega_p(5.64 * 1.0e+4*sqrt(Input::List().density_np));
78 
79 
80  vw_coeff_cube = omega_p/omega_0 * kp*re;
81  Qn_coeff = kp*re/6.0;
82 
83 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84  // Determine vr
85  for (size_t i(0); i < vr.size(); ++i) {
86  vr[i] = vr[i] / (sqrt(1.0+vr[i]*vr[i]));
87  }
88 
89 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90  // Determine U4, U4m1, U2, U2m1, U1, U1m1
91  for (size_t i(1); i < U4.size(); ++i) {
92  U4[i] = 0.5 * pow(vr[i],4) * (vr[i]-vr[i-1]);
93  U4m1[i] = 0.5 * pow(vr[i-1],4) * (vr[i]-vr[i-1]);
94  U2[i] = 0.5 * vr[i]*vr[i] * (vr[i]-vr[i-1]);
95  U2m1[i] = 0.5 * vr[i-1]*vr[i-1] * (vr[i]-vr[i-1]);
96  }
97 
98  // Determine <vr>
99  Inv_Uav6_nm1 = pow( 2.0/vr[0], 6);
100  for (size_t i(0); i < vr.size(); ++i) {
101  Inv_Uav6[i] = pow( 2.0/(vr[i+1]+vr[i]), 6);
102  }
103 
104  // Determine Qn
105  Qn[0] = 1.0 / ((vr[0]*vr[0]*vr[1])/2.0);
106  for (size_t i(1); i < Qn.size()-1; ++i) {
107  Qn[i] = 1.0 / (vr[i]*vr[i]*(vr[i+1]-vr[i-1])/2.0);
108  }
109  // Determine Pn
110  Pnm1 = 2.0/(vr[0]*vr[0]);
111  for (size_t i(0); i < Pn.size()-1; ++i) {
112  Pn[i] = 1.0 / ((vr[i+1]-vr[i])/2.0*(vr[i+1]+vr[i]));
113  }
114 
115 }
valarray< double > Pn
Definition: laser.h:33
double Qn_coeff
Definition: laser.h:39
double vw_coeff_cube
Definition: laser.h:39
valarray< double > Inv_Uav6
Definition: laser.h:33
valarray< double > gn
Definition: laser.h:33
valarray< double > U2
Definition: laser.h:32
double Inv_Uav6_nm1
Definition: laser.h:40
valarray< double > vr
Definition: laser.h:29
valarray< double > U4m1
Definition: laser.h:32
valarray< double > U2m1
Definition: laser.h:32
valarray< double > U4
Definition: laser.h:32
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
double Pnm1
Definition: laser.h:40
valarray< double > & fh
Definition: laser.h:26
valarray< double > Qn
Definition: laser.h:33
Here is the call graph for this function:

Member Function Documentation

◆ Getslope()

valarray< double > & IB_f00::Getslope ( const valarray< double > &  fin,
const double  vos,
const double  Zval 
)

Weng et. al. PRE 80 056406 2009

Implementation untested

Definition at line 119 of file laser.cpp.

References fh, formulas, gn, Inv_Uav6, Inv_Uav6_nm1, Formulary::LOGei(), Pn, Pnm1, Qn, Qn_coeff, U2, U2m1, U4, U4m1, vr, vw_coeff_cube, and Formulary::Zeta.

Referenced by RK4_IB::F().

119  {
120 //-------------------------------------------------------------------
121 
122 //-------------------------------------------------------------------
123  double ZLn_ei;
124  double I4, I2;
125  double vw_cube, qn_c;
126  // double p0overp1_sq(Input::List().pr(0)/ Input::List().pr(1));
127  double p0overp1_sq(vr[1]/ vr[0]);
128  p0overp1_sq *= p0overp1_sq;
129  /*debug*/ // cout << p0overp1_sq<<"\n";
130 
131 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
132  double f00((fin[0]-fin[1]*p0overp1_sq)/(1.0-p0overp1_sq));
133 
134  double b0(0.0);
135  double nueff(0.0);
136  double xsi(0.0);
137  /*debug*/ // cout << "(p0/p1)^2 =" << p0overp1_sq << ", f[1] = " << fin[1] << ", f[0] = " << fin[0]<< ", f[-1] = " << f00 <<"\n";
138  /*debug*/ // cout << "P[-1] = " << Pnm1 << ", Inv_U_av-1 = " << Inv_Uav6_nm1 << "\n";
139 
140 
141 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142 // Evaluate the integrals in a standard manner
143  I4 = 0;
144  for (int n(1); n < U4.size(); ++n) {
145  I4 += U4[n]*fin[n]+U4m1[n]*fin[n-1];
146  }
147 
148  I2 = 0;
149  for (int n(1); n < U2.size(); ++n) {
150  I2 += U2[n]*fin[n]+U2m1[n]*fin[n-1];
151  }
152 
153  ZLn_ei = (formulas.Zeta*Zval)*formulas.LOGei(4.0*M_PI*I2,I4/3.0/I2,formulas.Zeta*Zval);
154  vw_cube = vw_coeff_cube * ZLn_ei * 4.0*M_PI*I2;
155 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156  xsi = 3.84+(142.59-65.48*vos/sqrt(I2))/(27.3*vos/sqrt(I2)+vos*vos/I2);
157  for (size_t i(0); i < gn.size(); ++i) { //last location initialized with "1"
158 
159 
160 
161 
162  gn[i] = Inv_Uav6[i]*vw_cube*vw_cube;
163  gn[i] = 1.0/(1.0+gn[i]);
164 
165 
166 
167  /*debug*/ // cout << "g["<< vr[i]<<"] = " << gn[i]<< "\n";
168  // // // // // // // // // // // // // // // // // // // //
169  // // // // // // // // // // // // // // // // // // // //
174  // b0 = (vos*vos+5.0*vr[i]*vr[i])/5.0*vr[i]*vr[i];
175  // nueff = 1.0/pow((vr[i+1]*vr[i])/2.0+vos*vos/xsi,3.0);
176  // gn[i] = 1.0 - b0*nueff*vw_cube/(1.0+b0*b0*nueff*vw_cube);
177 
178  //
179  //
180  //
181  //
182  }
183 
184  /*debug*/// cout << "vos = "<< vos << ", n/np = " << 4.0*M_PI*I2<< ", ZLOG = " << ZLn_ei <<", vw = "<< pow(vw_cube,1.0/3.0) << "\n";
185 
186  qn_c = Qn_coeff*vos*vos*ZLn_ei*4.0*M_PI*I2; // where 4.0*M_PI*I2 is ne/np
187 
188  fh[0] = qn_c * Qn[0] * ( Pn[0] * gn[0] * (fin[1]-fin[0])
189  - Pnm1 /(1.0 + Inv_Uav6_nm1*vw_cube*vw_cube) * (fin[0]-f00));
190  /*debug*/ // cout << "fh["<< vr[0]<<"] = " << fh[0]<< "\n";
191  for (size_t i(1); i < fh.size()-1; ++i) {
192  fh[i] = qn_c * Qn[i] * ( Pn[i] * gn[i] * (fin[i+1]-fin[i])
193  - Pn[i-1] * gn[i-1] * (fin[i]-fin[i-1]));
194  /*debug*/ // cout << "fh["<< vr[i]<<"] = " << fh[i]<< "\n";
195  }
196  return fh;
197 }
valarray< double > Pn
Definition: laser.h:33
double Qn_coeff
Definition: laser.h:39
double Zeta
Definition: formulary.h:104
double vw_coeff_cube
Definition: laser.h:39
valarray< double > Inv_Uav6
Definition: laser.h:33
double LOGei(double ne, double Te, double Z)
Definition: formulary.cpp:249
valarray< double > gn
Definition: laser.h:33
valarray< double > U2
Definition: laser.h:32
double Inv_Uav6_nm1
Definition: laser.h:40
valarray< double > vr
Definition: laser.h:29
valarray< double > U4m1
Definition: laser.h:32
valarray< double > U2m1
Definition: laser.h:32
Formulary formulas
Definition: laser.h:42
valarray< double > U4
Definition: laser.h:32
double Pnm1
Definition: laser.h:40
valarray< double > & fh
Definition: laser.h:26
valarray< double > Qn
Definition: laser.h:33
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ c_kpre

double IB_f00::c_kpre
private

Definition at line 39 of file laser.h.

◆ fh

valarray<double>& IB_f00::fh
private

Definition at line 26 of file laser.h.

Referenced by Getslope().

◆ formulas

Formulary IB_f00::formulas
private

Definition at line 42 of file laser.h.

Referenced by Getslope().

◆ gn

valarray<double> IB_f00::gn
private

Definition at line 33 of file laser.h.

Referenced by Getslope().

◆ Inv_Uav6

valarray<double> IB_f00::Inv_Uav6
private

Definition at line 33 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ Inv_Uav6_nm1

double IB_f00::Inv_Uav6_nm1
private

Definition at line 40 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ Pn

valarray<double> IB_f00::Pn
private

Definition at line 33 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ Pnm1

double IB_f00::Pnm1
private

Definition at line 40 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ Qn

valarray<double> IB_f00::Qn
private

Definition at line 33 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ Qn_coeff

double IB_f00::Qn_coeff
private

Definition at line 39 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ U2

valarray<double> IB_f00::U2
private

Definition at line 32 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ U2m1

valarray<double> IB_f00::U2m1
private

Definition at line 32 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ U4

valarray<double> IB_f00::U4
private

Definition at line 32 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ U4m1

valarray<double> IB_f00::U4m1
private

Definition at line 32 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ vr

valarray<double> IB_f00::vr
private

Definition at line 29 of file laser.h.

Referenced by Getslope(), and IB_f00().

◆ vw_coeff_cube

double IB_f00::vw_coeff_cube
private

Definition at line 39 of file laser.h.

Referenced by Getslope(), and IB_f00().


The documentation for this class was generated from the following files: