Commit c6af7df5 authored by Heinrich Schindler's avatar Heinrich Schindler
Browse files

Add MediumMagboltz constructor with a list of gases.

parent acca33ca
Pipeline #4020945 passed with stage
in 4 minutes and 26 seconds
......@@ -33,8 +33,7 @@ as well as the angle between \(\mathbf{E}\) and \(\mathbf{B}\)).
In this example, we use a gas mixture of 93\% argon and 7\%
carbon dioxide at a pressure of 3\,atm and room temperature.
\begin{lstlisting}
MediumMagboltz gas;
gas.SetComposition("ar", 93., "co2", 7.);
MediumMagboltz gas("ar", 93., "co2", 7.);
// Set temperature [K] and pressure [Torr].
gas.SetPressure(3 * 760.);
gas.SetTemperature(293.15);
......@@ -308,8 +307,7 @@ sensor.SetArea(-5 * pitch, -5 * pitch, -0.01, 5 * pitch, 5 * pitch, 0.025);
\subsubsection{Gas}
We use a gas mixture of 80\% argon and 20\% CO\(_{2}\).
\begin{lstlisting}
MediumMagboltz gas;
gas.SetComposition("ar", 80., "co2", 20.);
MediumMagboltz gas("ar", 80., "co2", 20.);
// Set temperature [K] and pressure [Torr].
gas.SetTemperature(293.15);
gas.SetPressure(760.);
......
......@@ -377,6 +377,13 @@ gas.SetComposition("ar", 80., "ch4", 20.);
gas.SetTemperature(293.15);
gas.SetPressure(760.);
\end{lstlisting}
The gas composition can also be specified in the constructor of
\texttt{MediumMagboltz}.
\begin{lstlisting}
MediumMagboltz gas("ar", 80., "ch4", 20.);
gas.SetTemperature(293.15);
gas.SetPressure(760.);
\end{lstlisting}
The function
\begin{lstlisting}
......
......@@ -16,8 +16,7 @@ int main(int argc, char * argv[]) {
TApplication app("app", &argc, argv);
// Gas mixture.
MediumMagboltz gas;
gas.SetComposition("Ar", 80., "CO2", 20.);
MediumMagboltz gas("Ar", 80., "CO2", 20.);
// Define the cell layout.
constexpr double gap = 0.1;
......
......@@ -19,8 +19,7 @@ int main(int argc, char * argv[]) {
SetDefaultStyle();
// Setup the gas.
MediumMagboltz gas;
gas.SetComposition("ar");
MediumMagboltz gas("ar");
// Setup the cell layout.
ComponentAnalyticField cmp;
......
......@@ -36,8 +36,7 @@ int main(int argc, char * argv[]) {
constexpr double vHV = -100000;
// Gas mixture.
MediumMagboltz gas;
gas.SetComposition("ne", 85.72, "co2", 9.52, "n2", 4.76);
MediumMagboltz gas("ne", 85.72, "co2", 9.52, "n2", 4.76);
// Define the cell layout.
ComponentAnalyticField cmp;
......
......@@ -169,8 +169,7 @@ int main(int argc, char * argv[]) {
SetDefaultStyle();
// Setup the gas.
MediumMagboltz gas;
gas.SetComposition("ne", 85.72, "co2", 9.52, "n2", 4.76);
MediumMagboltz gas("ne", 85.72, "co2", 9.52, "n2", 4.76);
// Setup the electric field
ComponentAnalyticField cmp;
......
......@@ -15,8 +15,7 @@ int main(int argc, char * argv[]) {
TApplication app("app", &argc, argv);
MediumMagboltz gas;
gas.SetComposition("ar");
MediumMagboltz gas("ar");
ComponentAnalyticField cmp;
// Outer radius [cm].
......
......@@ -20,8 +20,7 @@ int main(int argc, char * argv[]) {
TApplication app("app", &argc, argv);
plottingEngine.SetDefaultStyle();
MediumMagboltz gas;
gas.SetComposition("ne", 90., "co2", 10.);
MediumMagboltz gas("ne", 90., "co2", 10.);
// Define the cell layout.
ComponentAnalyticField cmp;
......
......@@ -15,8 +15,7 @@ int main(int argc, char * argv[]) {
TApplication app("app", &argc, argv);
// Setup the gas.
MediumMagboltz gas;
gas.SetComposition("ne", 85.72, "co2", 9.52, "n2", 4.76);
MediumMagboltz gas("ne", 85.72, "co2", 9.52, "n2", 4.76);
// Describe the cell layout.
ComponentAnalyticField cmp;
......
......@@ -12,8 +12,7 @@ int main(int argc, char * argv[]) {
TApplication app("app", &argc, argv);
MediumMagboltz gas;
gas.SetComposition("ar", 95., "cf4", 3., "ic4h10", 2.);
MediumMagboltz gas("ar", 95., "cf4", 3., "ic4h10", 2.);
// Load the field map.
ComponentAnsys123 fm;
......
......@@ -12,8 +12,7 @@ int main(int argc, char * argv[]) {
TApplication app("app", &argc, argv);
MediumMagboltz gas;
gas.SetComposition("ar");
MediumMagboltz gas("ar");
// Load the main field map.
ComponentAnsys123 fm;
......
......@@ -20,8 +20,7 @@ using namespace Garfield;
int main() {
// Set up the gas.
MediumMagboltz gas;
gas.SetComposition("ar", 45., "co2", 15., "cf4", 40.);
MediumMagboltz gas("ar", 45., "co2", 15., "cf4", 40.);
gas.SetTemperature(293.15);
gas.SetPressure(760.);
gas.SetMaxElectronEnergy(200.);
......
......@@ -34,11 +34,10 @@ int main(int argc, char * argv[]) {
constexpr double yGap = 0.7;
// Make a gas medium.
MediumMagboltz gas;
MediumMagboltz gas("xe");
// Set temperature [K] and pressure [Torr].
gas.SetTemperature(293.15);
gas.SetPressure(760.);
gas.SetComposition("xe", 100.);
// Make a component with analytic electric field.
ComponentAnalyticField comp;
......
......@@ -32,10 +32,9 @@ int main(int argc, char * argv[]) {
TApplication app("app", &argc, argv);
// Make a gas medium.
MediumMagboltz gas;
MediumMagboltz gas("xe");
gas.SetTemperature(293.15);
gas.SetPressure(760.);
gas.SetComposition("xe", 100.);
if (!gas.Initialise()) return 1;
// Make a component with constant drift field.
......
......@@ -36,14 +36,12 @@ int main(int argc, char* argv[]) {
const double axis_y = 5;
const double axis_z = 5;
// Define the medium.
MediumMagboltz gas;
// Set the temperature (K)
// Define the medium (Ar/CO2 70:30).
MediumMagboltz gas("ar", 70., "co2", 30.);
// Set the temperature (K).
gas.SetTemperature(293.15);
// Set the pressure (Torr)
// Set the pressure (Torr).
gas.SetPressure(740.);
// Specify the gas mixture (Ar/CO2 70:30)
gas.SetComposition("ar", 70., "co2", 30.);
// Import an Elmer-created field map.
ComponentElmer2d elm(
......
......@@ -11,8 +11,7 @@ int main(int argc, char * argv[]) {
const double temperature = 293.15;
// Setup the gas.
MediumMagboltz gas;
gas.SetComposition("Ar", 93., "CO2", 7.);
MediumMagboltz gas("Ar", 93., "CO2", 7.);
gas.SetTemperature(temperature);
gas.SetPressure(pressure);
......
......@@ -21,8 +21,7 @@ int main(int argc, char * argv[]) {
fm.PrintRange();
// Setup the gas.
MediumMagboltz gas;
gas.SetComposition("ar", 80., "co2", 20.);
MediumMagboltz gas("ar", 80., "co2", 20.);
// Associate the gas with the corresponding field map material.
fm.SetGas(&gas);
......
......@@ -22,8 +22,7 @@ int main(int argc, char * argv[]) {
TApplication app("app", &argc, argv);
// Setup the gas.
MediumMagboltz gas;
gas.SetComposition("ar", 80., "co2", 20.);
MediumMagboltz gas("ar", 80., "co2", 20.);
gas.SetTemperature(293.15);
gas.SetPressure(760.);
gas.Initialise(true);
......
......@@ -33,8 +33,7 @@ fieldView.GetCanvas().SetLeftMargin(0.16)
fieldView.PlotContour();
# Setup the gas.
gas = ROOT.Garfield.MediumMagboltz()
gas.SetComposition("ar", 80., "co2", 20.)
gas = ROOT.Garfield.MediumMagboltz("ar", 80., "co2", 20.)
gas.SetTemperature(293.15)
gas.SetPressure(760.)
gas.Initialise(True)
......@@ -68,7 +67,7 @@ if plotDrift:
nEvents = 10
for i in range(nEvents):
print i, '/', nEvents
# print i, '/', nEvents
# Randomize the initial position.
x0 = -0.5 * pitch + ROOT.Garfield.RndmUniform() * pitch
y0 = -0.5 * pitch + ROOT.Garfield.RndmUniform() * pitch
......
......@@ -23,8 +23,7 @@ int main(int argc, char * argv[]) {
TApplication app("app", &argc, argv);
// Setup the gas.
MediumMagboltz gas;
gas.SetComposition("ar", 80., "co2", 20.);
MediumMagboltz gas("ar", 80., "co2", 20.);
gas.SetTemperature(293.15);
gas.SetPressure(760.);
gas.Initialise(true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment