24 const std::string& gas2 =
"",
const double f2 = 0.,
25 const std::string& gas3 =
"",
const double f3 = 0.,
26 const std::string& gas4 =
"",
const double f4 = 0.,
27 const std::string& gas5 =
"",
const double f5 = 0.,
28 const std::string& gas6 =
"",
const double f6 = 0.);
31 std::string& gas2,
double& f2,
32 std::string& gas3,
double& f3,
33 std::string& gas4,
double& f4,
34 std::string& gas5,
double& f5,
35 std::string& gas6,
double& f6)
const;
38 bool LoadGasFile(
const std::string& filename,
const bool quiet =
false);
42 bool MergeGasFile(
const std::string& filename,
const bool replaceOld);
66 double& r,
double& lambda);
74 bool LoadIonMobility(
const std::string& filename,
const bool quiet =
false);
77 const bool quiet =
false);
89 double& energy)
const;
92 double& energy)
const;
95 const size_t ie,
const size_t ib,
96 const size_t ia,
double& f)
const;
99 const size_t ie,
const size_t ib,
100 const size_t ia,
double& f)
const;
102 bool IsGas()
const override {
return true; }
104 void GetComponent(
const unsigned int i, std::string& label,
119 const std::string& high) {
123 const std::string& high) {
158 const unsigned int i)
override;
164 std::array<std::string, m_nMaxGases>
m_gas;
187 std::vector<std::vector<std::vector<double> > >
m_eAlp0;
190 std::vector<std::vector<std::vector<std::vector<double> > > >
m_excRates;
191 std::vector<std::vector<std::vector<std::vector<double> > > >
m_ionRates;
210 std::pair<unsigned int, unsigned int>
m_extrExc = {0, 1};
211 std::pair<unsigned int, unsigned int>
m_extrIon = {0, 1};
215 bool LoadMobility(
const std::string& filename,
const bool quiet,
216 const bool negative);
217 bool ReadHeader(std::ifstream& gasfile,
int& version,
218 std::bitset<20>& gasok,
bool& is3d,
219 std::vector<double>& mixture,
220 std::vector<double>& efields, std::vector<double>& bfields,
221 std::vector<double>& angles, std::vector<ExcLevel>& excLevels,
222 std::vector<IonLevel>& ionLevels);
224 std::array<unsigned int, 13>& extrapH,
225 std::array<unsigned int, 13>& extrapL,
226 std::array<unsigned int, 13>& interp,
227 unsigned int& thrAlp,
unsigned int& thrAtt,
228 unsigned int& thrDis,
229 double& ionDiffL,
double& ionDiffT,
230 double& pgas,
double& tgas);
231 void ReadRecord3D(std::ifstream& gasfile,
double& ve,
double& vb,
double& vx,
232 double& dl,
double& dt,
double& alpha,
double& alpha0,
233 double& eta,
double& mu,
double& lor,
234 double& dis, std::array<double, 6>& dif,
235 std::vector<double>& rexc, std::vector<double>& rion);
236 void ReadRecord1D(std::ifstream& gasfile,
double& ve,
double& vb,
double& vx,
237 double& dl,
double& dt,
double& alpha,
double& alpha0,
238 double& eta,
double& mu,
double& lor,
239 double& dis, std::array<double, 6>& dif,
240 std::vector<double>& rexc, std::vector<double>& rion);
241 void InsertE(
const int ie,
const int ne,
const int nb,
const int na);
242 void InsertB(
const int ib,
const int ne,
const int nb,
const int na);
243 void InsertA(
const int ia,
const int ne,
const int nb,
const int na);
244 void ZeroRowE(
const int ie,
const int nb,
const int na);
245 void ZeroRowB(
const int ib,
const int ne,
const int na);
246 void ZeroRowA(
const int ia,
const int ne,
const int nb);
247 bool GetMixture(
const std::vector<double>& mixture,
const int version,
248 std::vector<std::string>& gasnames,
249 std::vector<double>& percentages)
const;
250 void GetGasBits(std::bitset<20>& gasok)
const;
252 static bool GetGasInfo(
const std::string& gasname,
253 double& a,
double& z,
double& w,
double& f);
254 static std::string
GetGasName(
const int gasnumber,
const int version);
255 static std::string
GetGasName(std::string input);
257 static const std::vector<std::string>
GetAliases(
const std::string& gas);
double GetMassDensity() const override
Get the mass density [g/cm3].
double GetNumberDensity() const override
Get the number density [cm-3].
void SetExtrapolationMethodExcitationRates(const std::string &low, const std::string &high)
void ReadRecord3D(std::ifstream &gasfile, double &ve, double &vb, double &vx, double &dl, double &dt, double &alpha, double &alpha0, double &eta, double &mu, double &lor, double &dis, std::array< double, 6 > &dif, std::vector< double > &rexc, std::vector< double > &rion)
bool LoadGasFile(const std::string &filename, const bool quiet=false)
Read table of gas properties (transport parameters) from file.
bool AdjustTownsendCoefficient()
double ScaleElectricField(const double e) const override
bool GetElectronIonisationRate(const size_t level, const size_t ie, const size_t ib, const size_t ia, double &f) const
Get an entry in the table of ionisation rates.
void GetIonisationLevel(const size_t level, std::string &label, double &energy) const
Return the identifier and threshold of an ionisation level.
std::pair< unsigned int, unsigned int > m_extrIon
bool GetPenningTransfer(const std::string &gasname, double &r, double &lambda)
void SetInterpolationMethodExcitationRates(const unsigned int intrp)
void SetAtomicNumber(const double z) override
Set the effective atomic number.
bool LoadNegativeIonMobility(const std::string &filename, const bool quiet=false)
Read a table of negative ion mobilities vs. electric field from file.
double ScaleDiffusion(const double d) const override
virtual bool EnablePenningTransfer()
static constexpr unsigned int m_nMaxGases
std::vector< std::vector< std::vector< std::vector< double > > > > m_excRates
void InsertB(const int ib, const int ne, const int nb, const int na)
size_t GetNumberOfExcitationLevels() const
Return the number of excitation levels in the table.
double m_lambdaPenningGlobal
void SetExtrapolationMethodIonisationRates(const std::string &low, const std::string &high)
std::vector< IonLevel > m_ionLevels
std::array< double, m_nMaxGases > m_rPenningGas
void GetComposition(std::string &gas1, double &f1, std::string &gas2, double &f2, std::string &gas3, double &f3, std::string &gas4, double &f4, std::string &gas5, double &f5, std::string &gas6, double &f6) const
Retrieve the gas mixture.
double GetAtomicNumber() const override
Get the effective atomic number.
std::array< double, m_nMaxGases > m_atNum
static void PrintGases()
Print a list of all available gases.
void GetGasBits(std::bitset< 20 > &gasok) const
static const std::vector< std::string > GetAliases(const std::string &gas)
std::vector< std::vector< std::vector< std::vector< double > > > > m_ionRates
void ZeroRowA(const int ia, const int ne, const int nb)
void ResetTables() override
Reset all tables of transport parameters.
bool LoadMobility(const std::string &filename, const bool quiet, const bool negative)
std::vector< ExcLevel > m_excLevels
void ZeroRowB(const int ib, const int ne, const int na)
bool GetElectronExcitationRate(const size_t level, const size_t ie, const size_t ib, const size_t ia, double &f) const
Get an entry in the table of excitation rates.
double ScaleDiffusionTensor(const double d) const override
void ReadFooter(std::ifstream &gasfile, std::array< unsigned int, 13 > &extrapH, std::array< unsigned int, 13 > &extrapL, std::array< unsigned int, 13 > &interp, unsigned int &thrAlp, unsigned int &thrAtt, unsigned int &thrDis, double &ionDiffL, double &ionDiffT, double &pgas, double &tgas)
double m_temperatureTable
bool LoadIonMobility(const std::string &filename, const bool quiet=false)
Read a table of (positive) ion mobilities vs. electric field from file.
static int GetGasNumberGasFile(const std::string &input)
virtual void PrintGas()
Print information about the present gas mixture and available data.
void ReadRecord1D(std::ifstream &gasfile, double &ve, double &vb, double &vx, double &dl, double &dt, double &alpha, double &alpha0, double &eta, double &mu, double &lor, double &dis, std::array< double, 6 > &dif, std::vector< double > &rexc, std::vector< double > &rion)
static bool GetGasInfo(const std::string &gasname, double &a, double &z, double &w, double &f)
std::array< double, m_nMaxGases > m_atWeight
double ScaleTownsend(const double alpha) const override
static std::string GetGasName(const int gasnumber, const int version)
void GetComponent(const unsigned int i, std::string &label, double &f) override
Get the name and fraction of a given component.
double UnScaleElectricField(const double e) const override
bool WriteGasFile(const std::string &filename)
Save the present table of gas properties (transport parameters) to a file.
void SetInterpolationMethodIonisationRates(const unsigned int intrp)
bool GetMixture(const std::vector< double > &mixture, const int version, std::vector< std::string > &gasnames, std::vector< double > &percentages) const
std::array< double, m_nMaxGases > m_lambdaPenningGas
std::pair< unsigned int, unsigned int > m_extrExc
bool GetPhotoAbsorptionCrossSection(const double e, double &sigma, const unsigned int i) override
bool MergeGasFile(const std::string &filename, const bool replaceOld)
Read table of gas properties from and merge with the existing dataset.
virtual void DisablePenningTransfer()
Switch the simulation of Penning transfers off globally.
double GetAtomicWeight() const override
Get the effective atomic weight.
void SetNumberDensity(const double n) override
Set the number density [cm-3].
bool SetComposition(const std::string &gas1, const double f1=1., const std::string &gas2="", const double f2=0., const std::string &gas3="", const double f3=0., const std::string &gas4="", const double f4=0., const std::string &gas5="", const double f5=0., const std::string &gas6="", const double f6=0.)
Set the gas mixture.
void ZeroRowE(const int ie, const int nb, const int na)
double ScaleLorentzAngle(const double lor) const override
bool IsGas() const override
Is this medium a gas?
double ScaleAttachment(const double eta) const override
void SetMassDensity(const double rho) override
Set the mass density [g/cm3].
virtual ~MediumGas()
Destructor.
std::vector< std::vector< std::vector< double > > > m_eAlp0
void GetExcitationLevel(const size_t level, std::string &label, double &energy) const
Return the identifier and energy of an excitation level.
void InsertA(const int ia, const int ne, const int nb, const int na)
void InsertE(const int ie, const int ne, const int nb, const int na)
std::array< std::string, m_nMaxGases > m_gas
bool ReadHeader(std::ifstream &gasfile, int &version, std::bitset< 20 > &gasok, bool &is3d, std::vector< double > &mixture, std::vector< double > &efields, std::vector< double > &bfields, std::vector< double > &angles, std::vector< ExcLevel > &excLevels, std::vector< IonLevel > &ionLevels)
void SetAtomicWeight(const double a) override
Set the effective atomic weight.
size_t GetNumberOfIonisationLevels() const
Return the number of ionisation levels in the table.
std::array< double, m_nMaxGases > m_fraction
void SetExtrapolationMethod(const std::string &low, const std::string &high, std::pair< unsigned int, unsigned int > &extr, const std::string &fcn)