22 bool IsGas()
const override {
return true; }
26 const std::string& gas2 =
"",
const double f2 = 0.,
27 const std::string& gas3 =
"",
const double f3 = 0.,
28 const std::string& gas4 =
"",
const double f4 = 0.,
29 const std::string& gas5 =
"",
const double f5 = 0.,
30 const std::string& gas6 =
"",
const double f6 = 0.);
32 void GetComposition(std::string& gas1,
double& f1, std::string& gas2,
33 double& f2, std::string& gas3,
double& f3,
34 std::string& gas4,
double& f4, std::string& gas5,
35 double& f5, std::string& gas6,
double& f6);
36 void GetComponent(
const unsigned int i, std::string& label,
53 bool MergeGasFile(
const std::string& filename,
const bool replaceOld);
84 const std::string& high) {
88 const std::string& high) {
123 const unsigned int i)
override;
129 std::array<std::string, m_nMaxGases>
m_gas;
152 std::vector<std::vector<std::vector<double> > >
m_eAlp0;
155 std::vector<std::vector<std::vector<std::vector<double> > > >
m_excRates;
156 std::vector<std::vector<std::vector<std::vector<double> > > >
m_ionRates;
175 std::pair<unsigned int, unsigned int>
m_extrExc = {0, 1};
176 std::pair<unsigned int, unsigned int>
m_extrIon = {0, 1};
180 bool ReadHeader(std::ifstream& gasfile,
int& version,
181 std::bitset<20>& gasok,
bool& is3d,
182 std::vector<double>& mixture,
183 std::vector<double>& efields, std::vector<double>& bfields,
184 std::vector<double>& angles, std::vector<ExcLevel>& excLevels,
185 std::vector<IonLevel>& ionLevels);
187 std::array<unsigned int, 13>& extrapH,
188 std::array<unsigned int, 13>& extrapL,
189 std::array<unsigned int, 13>& interp,
190 unsigned int& thrAlp,
unsigned int& thrAtt,
191 unsigned int& thrDis,
192 double& ionDiffL,
double& ionDiffT,
193 double& pgas,
double& tgas);
194 void ReadRecord3D(std::ifstream& gasfile,
double& ve,
double& vb,
double& vx,
195 double& dl,
double& dt,
double& alpha,
double& alpha0,
196 double& eta,
double& mu,
double& lor,
197 double& dis, std::array<double, 6>& dif,
198 std::vector<double>& rexc, std::vector<double>& rion);
199 void ReadRecord1D(std::ifstream& gasfile,
double& ve,
double& vb,
double& vx,
200 double& dl,
double& dt,
double& alpha,
double& alpha0,
201 double& eta,
double& mu,
double& lor,
202 double& dis, std::array<double, 6>& dif,
203 std::vector<double>& rexc, std::vector<double>& rion);
204 void InsertE(
const int ie,
const int ne,
const int nb,
const int na);
205 void InsertB(
const int ib,
const int ne,
const int nb,
const int na);
206 void InsertA(
const int ia,
const int ne,
const int nb,
const int na);
207 void ZeroRowE(
const int ie,
const int nb,
const int na);
208 void ZeroRowB(
const int ib,
const int ne,
const int na);
209 void ZeroRowA(
const int ia,
const int ne,
const int nb);
210 bool GetMixture(
const std::vector<double>& mixture,
const int version,
211 std::vector<std::string>& gasnames,
212 std::vector<double>& percentages)
const;
213 void GetGasBits(std::bitset<20>& gasok)
const;
215 bool GetGasInfo(
const std::string& gasname,
double& a,
double& z)
const;
216 std::string
GetGasName(
const int gasnumber,
const int version)
const;
217 std::string
GetGasName(std::string input)
const;
Base class for gas media.
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 AdjustTownsendCoefficient()
double ScaleElectricField(const double e) const override
std::pair< unsigned int, unsigned int > m_extrIon
void SetInterpolationMethodExcitationRates(const unsigned int intrp)
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)
Retrieve the gas mixture.
void SetAtomicNumber(const double z) override
Set the effective atomic number.
bool GetGasInfo(const std::string &gasname, double &a, double &z) const
double ScaleDiffusion(const double d) const override
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)
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
bool LoadIonMobility(const std::string &filename)
Read a table of ion mobilities as function of electric field from file.
double GetAtomicNumber() const override
Get the effective atomic number.
std::array< double, m_nMaxGases > m_atNum
void GetGasBits(std::bitset< 20 > &gasok) const
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.
std::vector< ExcLevel > m_excLevels
void ZeroRowB(const int ib, const int ne, const int na)
double ScaleDiffusionTensor(const double d) const override
int GetGasNumberGasFile(const std::string &input) const
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
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)
std::array< double, m_nMaxGases > m_atWeight
double ScaleTownsend(const double alpha) const override
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.
std::string GetGasName(const int gasnumber, const int version) const
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.
virtual bool EnablePenningTransfer(const double r, const double lambda)
std::vector< std::vector< std::vector< double > > > m_eAlp0
void InsertA(const int ia, const int ne, const int nb, const int na)
bool LoadGasFile(const std::string &filename)
Read table of gas properties (transport parameters) from file.
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.
std::array< double, m_nMaxGases > m_fraction
Abstract base class for media.
void SetExtrapolationMethod(const std::string &low, const std::string &high, std::pair< unsigned int, unsigned int > &extr, const std::string &fcn)