diff --git a/include/actions/ChemicalReactionsBase.h b/include/actions/ChemicalReactionsBase.h index bdf73ca..6c665e3 100644 --- a/include/actions/ChemicalReactionsBase.h +++ b/include/actions/ChemicalReactionsBase.h @@ -92,7 +92,7 @@ class ChemicalReactionsBase : public Action unsigned int _num_constant_reactions; bool _mole_factor; - Real N_A; + Real N_A; Real _rate_factor; std::string _interpolation_type; diff --git a/include/materials/ADEEDFRateConstantTownsend.h b/include/materials/ADEEDFRateConstantTownsend.h index 46c21e3..f99f0ec 100644 --- a/include/materials/ADEEDFRateConstantTownsend.h +++ b/include/materials/ADEEDFRateConstantTownsend.h @@ -25,7 +25,7 @@ class ADEEDFRateConstantTownsend : public ADMaterial virtual void computeQpProperties(); SplineInterpolation _coefficient_interpolation; - + std::string _coefficient_format; ADMaterialProperty & _townsend_coefficient; const MaterialProperty & _massIncident; diff --git a/problems/e5_plot.py b/problems/e5_plot.py index 0b93cd2..2d57de3 100644 --- a/problems/e5_plot.py +++ b/problems/e5_plot.py @@ -20,8 +20,8 @@ data = np.genfromtxt(file, dtype=float, delimiter=',', skip_header=1) data2 = np.genfromtxt(file2, dtype=float, delimiter=',', skip_header=1) data3 = np.genfromtxt(file3, dtype=float, delimiter=',', skip_header=1) -names =['Ar','Ar+','Production2','Production0','Production3','e'] -names2 =['Ar','Ar+','e','Ar+ and e Production rate','Ar+ + e Recombination rate','test 1-Body Production rate'] +names =['Ar','Ar+','Production2','Production0','Production3','e'] +names2 =['Ar','Ar+','e','Ar+ and e Production rate','Ar+ + e Recombination rate','test 1-Body Production rate'] names3 =['N','N+','N2','N2+','N2A','N2B','N2C','N2a1','N3+','N4+','Te','Teff','e','rate0','rate1','rate10','rate11','rate12','rate13','rate14','rate15','rate16','rate17','rate18','rate19','rate2','rate20','rate21','rate22','rate23','rate24','rate25','rate26','rate27','rate28','rate29','rate3','rate30','rate31','rate32','rate33','rate4','rate5','rate6','rate7','rate8','rate9'] print(data3) diff --git a/problems/e5_track.i b/problems/e5_track.i index a1d8c9a..a61ed71 100644 --- a/problems/e5_track.i +++ b/problems/e5_track.i @@ -49,7 +49,7 @@ sampling_variable = 'reduced_field' track_rates = true # Add reactions here - reactions = 'e + Ar -> e + e + Ar+ : EEDF + reactions = 'e + Ar -> e + e + Ar+ : EEDF e + Ar+ + Ar -> Ar + Ar : 1e-25 Ar+ -> Ar+ : 1e-14 ' diff --git a/problems/first_order_example/lieberman_ex1.i b/problems/first_order_example/lieberman_ex1.i index 240b69a..e302079 100644 --- a/problems/first_order_example/lieberman_ex1.i +++ b/problems/first_order_example/lieberman_ex1.i @@ -1,9 +1,9 @@ # This input file describes a simple system of two first-order reactions # -# Based on the example shown in the textbook: +# Based on the example shown in the textbook: # -# Lieberman, Michael A. and Lichtenberg, Allan J. "Principles of Plasma -# Discharges and Materials Processing." Second Edition. John Wiley & Sons, Inc. +# Lieberman, Michael A. and Lichtenberg, Allan J. "Principles of Plasma +# Discharges and Materials Processing." Second Edition. John Wiley & Sons, Inc. # (2005) # # Chapter 9, Section 2, "First-Order Consecutive Reactions) @@ -12,7 +12,7 @@ [Mesh] # 'Dummy' mesh - a mesh is always needed to run MOOSE, but # scalar variables do not exist on a mesh. - # When you're doing a 0D problem you just need to give MOOSE + # When you're doing a 0D problem you just need to give MOOSE # a single element to work with. type = GeneratedMesh dim = 1 @@ -104,8 +104,8 @@ [] # This next one is optional, but highly recommended. - # Without this, scalar variables are printed on the terminal as the - # simulation runs. + # Without this, scalar variables are printed on the terminal as the + # simulation runs. # It's best to keep this on to prevent things from being cluttered. [console] type = Console diff --git a/problems/first_order_example/lieberman_ex1_comp.py b/problems/first_order_example/lieberman_ex1_comp.py index 5862ed1..d2844f3 100644 --- a/problems/first_order_example/lieberman_ex1_comp.py +++ b/problems/first_order_example/lieberman_ex1_comp.py @@ -19,7 +19,7 @@ def exact_solution(time, n0, KA, KB): Equations 9.2.5 (nA), 9.2.6 (nB), 9.2.8 (nC) ''' nA = n0 * np.exp(-KA * time) - + nB = n0 * KA / (KB - KA) * (np.exp(-KA * time) - np.exp(-KB * time)) nC = n0 * (1. + 1./(KA - KB) * (KB * np.exp(-KA * time) - KA * np.exp(-KB * time))) diff --git a/scripts/fixup_headers.py b/scripts/fixup_headers.py index 30f4ed4..bb8bf7d 100644 --- a/scripts/fixup_headers.py +++ b/scripts/fixup_headers.py @@ -176,4 +176,4 @@ def checkAndUpdatePython(filename): parser.add_option("-f", "--force", action="store_true", dest="force", default=False) (global_options, args) = parser.parse_args() - fixupHeader() \ No newline at end of file + fixupHeader() diff --git a/src/actions/AddGeneralReactions.C b/src/actions/AddGeneralReactions.C index 7a7667f..7edd949 100644 --- a/src/actions/AddGeneralReactions.C +++ b/src/actions/AddGeneralReactions.C @@ -288,7 +288,7 @@ AddGeneralReactions::act() // if (_energy_change[i] == true) // { // Gas temperature is almost in place, but not finished yet. - // std::cout << "WARNING: energy dependence is not yet implemented." << std::endl; + // mooseError("Energy dependence is not yet implemented."); // } } } @@ -346,7 +346,6 @@ AddGeneralReactions::act() reactant_kernel_name += "Log"; } } - // std::cout << energy_kernel_name << ", " << _energy_change[i] << std::endl; // if (_energy_change[i] && _rate_type[i] == "EEDF") // { @@ -557,8 +556,6 @@ AddGeneralReactions::act() InputParameters params = _factory.getValidParams(reactant_kernel_name); params.set("variable") = _species[j]; params.set("coefficient") = _species_count[i][j]; - // std::cout << getParam>("block")[0] << ", " << - // _species_count[i][j] << std::endl; mooseError("TESTING"); params.set("reaction") = _reaction[i]; if (find_other || find_aux) { @@ -670,8 +667,6 @@ AddGeneralReactions::act() // If a species is not tracked, it is treated as a background gas. for (unsigned int k = 0; k < _reactants[i].size(); ++k) { - // std::cout << _reaction[i] << ": \n" << " " << _reactants[i][k] << ", " << - // include_species[k] << std::endl; if (include_species[k]) { params.set>(other_variables[k]) = {_reactants[i][k]}; diff --git a/src/actions/AddZapdosReactions.C b/src/actions/AddZapdosReactions.C index 96c72b3..c0deb3b 100644 --- a/src/actions/AddZapdosReactions.C +++ b/src/actions/AddZapdosReactions.C @@ -299,7 +299,7 @@ AddZapdosReactions::act() // First all EEDF-based reactions are added. for (unsigned int i = 0; i < _num_eedf_reactions; ++i) { - std::cout << _ad_prepend + "ReactionRateEEDF" + _townsend_append + _log_append << std::endl; + mooseInfo(_ad_prepend, "ReactionRateEEDF", _townsend_append, _log_append); if (_coefficient_format == "townsend") addAuxRate(_ad_prepend + "ReactionRateEEDF" + _townsend_append + _log_append, _eedf_reaction_number[i], diff --git a/src/actions/ChemicalReactions.C b/src/actions/ChemicalReactions.C index ec16f4e..e1d4f56 100644 --- a/src/actions/ChemicalReactions.C +++ b/src/actions/ChemicalReactions.C @@ -235,7 +235,7 @@ ChemicalReactions::ChemicalReactions(const InputParameters & params) ////////// // if (_rate_equation_string[i].find("Tgas") != std::string::npos) // { - // std::cout << "found!" << std::endl; + // mooseInfo("found!"); // } ////////// @@ -245,7 +245,7 @@ ChemicalReactions::ChemicalReactions(const InputParameters & params) // std::string token; // while (std::getline(iss >> std::ws, token,'/')) // { - // std::cout << token << std::endl; + // mooseInfo(token); // } } else @@ -528,11 +528,7 @@ ChemicalReactions::act() if (gas_tracking) { - // mooseError("Functionality for tracking neutral gas densities and temperatures is under - // development."); - std::cout - << "WARNING: Functionality for tracking neutral gas densities is still under development." - << std::endl; + mooseError("Functionality for tracking neutral gas densities is still under development."); } else if (_current_task == "add_function" && _scalar_problem == false) @@ -741,8 +737,7 @@ ChemicalReactions::act() } else if (_rate_type[i] == "Equation") { - std::cout << "WARNING: CRANE cannot yet handle equation-based equations." << std::endl; - // This should be a mooseError...but I'm using it for testing purposes. + mooseError("CRANE cannot yet handle equation-based equations."); } else if (_superelastic_reaction[i] == true) { @@ -788,7 +783,7 @@ ChemicalReactions::act() if (_energy_change == true) { // Gas temperature is almost in place, but not finished yet. - std::cout << "WARNING: energy dependence is not yet implemented." << std::endl; + mooseError("Energy dependence is not yet implemented."); } } } @@ -801,7 +796,6 @@ ChemicalReactions::act() std::vector rxn_coeff = getParam>("reaction_coefficient"); for (unsigned int i = 0; i < _num_reactions; ++i) { - // std::cout << rxn_coeff[i] << std::endl; if (_reactants[i].size() == 1) { product_kernel_name = "Product1BodyScalar"; @@ -881,8 +875,6 @@ ChemicalReactions::act() if (_species_count[i][j] > 0) { - // std::cout << _species_count[i][j] << std::endl; - // std::cout << InputParameters params = _factory.getValidParams(product_kernel_name); params.set("variable") = _species[j]; // params.set("n_gas") = 3.219e24; diff --git a/src/actions/ChemicalReactionsBase.C b/src/actions/ChemicalReactionsBase.C index 0dc2151..71fb30c 100644 --- a/src/actions/ChemicalReactionsBase.C +++ b/src/actions/ChemicalReactionsBase.C @@ -357,7 +357,7 @@ ChemicalReactionsBase::ChemicalReactionsBase(const InputParameters & params) ////////// // if (_rate_equation_string[i].find("Tgas") != std::string::npos) // { - // std::cout << "found!" << std::endl; + // mooseInfo("found!"); // } ////////// @@ -367,7 +367,7 @@ ChemicalReactionsBase::ChemicalReactionsBase(const InputParameters & params) // std::string token; // while (std::getline(iss >> std::ws, token,'/')) // { - // std::cout << token << std::endl; + // mooseInfo(token); // } } else @@ -388,7 +388,7 @@ ChemicalReactionsBase::ChemicalReactionsBase(const InputParameters & params) } catch (const std::out_of_range &) { - std::cerr << "Argument out of range for a double\n"; + mooseError("Argument out of range for a double\n"); throw; } // _rate_coefficient[i] = std::stod(rate_coefficient_string[i]); @@ -730,15 +730,6 @@ ChemicalReactionsBase::ChemicalReactionsBase(const InputParameters & params) } _num_reactions += superelastic_reactions; - // for (unsigned int i=0; i<_num_reactions; ++i) - // { - // std::cout << _reaction[i] << std::endl; - // for (unsigned int j=0; j<_species.size(); ++j) - // { - // std::cout << _species[j] << ", " << _species_count[i][j] << std::endl; - // } - // } - // mooseError("TEST"); _reaction_coefficient_name.resize(_num_reactions); // Find the unique species across all reaction pathways // Note that this also accounts for species that are not tracked in case @@ -910,11 +901,16 @@ ChemicalReactionsBase::ChemicalReactionsBase(const InputParameters & params) } if (unbalanced) { - std::cout << "WARNING: The following equations are unbalanced." << std::endl; + std:string error_str; for (unsigned int i = 0; i < faulty_reaction.size(); ++i) - std::cout << " " << faulty_reaction[i] << std::endl; + { + error_str.append(" "); + error_str.append(faulty_reaction[i]); + error_str.append("\n"); + } - mooseError("Fix unbalanced reactions or particle conservation will not be enforced."); + mooseError("The following equations are unbalanced:\n", error_str, + "Fix unbalanced reactions or particle conservation will not be enforced."); } } diff --git a/src/auxkernels/BolsigValueScalar.C b/src/auxkernels/BolsigValueScalar.C index 60c8410..39410eb 100644 --- a/src/auxkernels/BolsigValueScalar.C +++ b/src/auxkernels/BolsigValueScalar.C @@ -35,9 +35,6 @@ BolsigValueScalar::BolsigValueScalar(const InputParameters & parameters) Real BolsigValueScalar::computeValue() { - // std::cout << _data.test(0) << std::endl; - // return 0.0; - if (_data_type == "diffusivity") { mooseError("No diffusivity function yet! Whoops!"); diff --git a/src/auxkernels/EEDFRateCoefficientScalar.C b/src/auxkernels/EEDFRateCoefficientScalar.C index 7ba634c..0c09dd0 100644 --- a/src/auxkernels/EEDFRateCoefficientScalar.C +++ b/src/auxkernels/EEDFRateCoefficientScalar.C @@ -35,8 +35,6 @@ EEDFRateCoefficientScalar::EEDFRateCoefficientScalar(const InputParameters & par Real EEDFRateCoefficientScalar::computeValue() { - // std::cout << _data.test(0) << std::endl; - // return 0.0; Real val; if (_sample_value) { @@ -49,7 +47,6 @@ EEDFRateCoefficientScalar::computeValue() { return val; } - // return _data.coefficient_sample(_reaction_number, _sampler_var[0]/1e-21); } else { diff --git a/src/auxkernels/ParsedScalarRateCoefficient.C b/src/auxkernels/ParsedScalarRateCoefficient.C index 4b96c0f..17cffc7 100644 --- a/src/auxkernels/ParsedScalarRateCoefficient.C +++ b/src/auxkernels/ParsedScalarRateCoefficient.C @@ -69,7 +69,6 @@ ParsedScalarRateCoefficient::ParsedScalarRateCoefficient(const InputParameters & // { // Real extra_value = _data.electron_temperature(7.7e-20); // _constant_names.push_back(getParam>("file_value")[0]); - // std::cout << _reduced_field[_i] << std::endl; // if (isCoupledScalar("reduced_field")) // _constant_expressions.push_back(std::to_string(_data.electron_temperature(_reduced_field[_i]))); // else diff --git a/src/auxkernels/VariableSum.C b/src/auxkernels/VariableSum.C index 9dc6567..d1ce0da 100644 --- a/src/auxkernels/VariableSum.C +++ b/src/auxkernels/VariableSum.C @@ -33,9 +33,6 @@ VariableSum::computeValue() Real variable_sum = 0; for (unsigned int i = 0; i < _nargs; ++i) { - // variables += (i == 0 ? "" : ",") + getScalarVar("args", i)->name(); - // _args[i] = &coupledScalarValue("args", i); - // std::cout << (*_args[i])[_i] << std::endl; variable_sum += coupledScalarValue("args", i)[_i]; } return variable_sum; diff --git a/src/auxkernels/VariableSumLog.C b/src/auxkernels/VariableSumLog.C index f9c39bd..a99bfcb 100644 --- a/src/auxkernels/VariableSumLog.C +++ b/src/auxkernels/VariableSumLog.C @@ -33,9 +33,6 @@ VariableSumLog::computeValue() Real variable_sum = 0; for (unsigned int i = 0; i < _nargs; ++i) { - // variables += (i == 0 ? "" : ",") + getScalarVar("args", i)->name(); - // _args[i] = &coupledScalarValue("args", i); - // std::cout << (*_args[i])[_i] << std::endl; variable_sum += std::exp(coupledScalarValue("args", i)[_i]); } return std::log(variable_sum); diff --git a/src/kernels/ReactionSecondOrder.C b/src/kernels/ReactionSecondOrder.C index 3c6c2df..00d8d45 100644 --- a/src/kernels/ReactionSecondOrder.C +++ b/src/kernels/ReactionSecondOrder.C @@ -235,8 +235,6 @@ ReactionSecondOrder::computeQpOffDiagJacobian(unsigned int jvar) } else { - // std::cout << getParam("reaction") << ": " << _v_eq_u << ", " << _w_eq_u << - // std::endl; mooseError("ReactionSecondOrder, computeQpOffDiagJacobian: this is not yet implemented for the " "current case."); }*/ diff --git a/src/materials/SuperelasticReactionRate.C b/src/materials/SuperelasticReactionRate.C index 694bdf7..05a46ac 100644 --- a/src/materials/SuperelasticReactionRate.C +++ b/src/materials/SuperelasticReactionRate.C @@ -95,5 +95,4 @@ SuperelasticReactionRate::computeQpProperties() (delta_a[4]/20.0)*std::pow(_Tgas[_qp], 4.0) - delta_a[5]*std::pow(_Tgas[_qp], -1.0) + delta_a[6]); _reaction_rate[_qp] = _reversible_rate[_qp] / _equilibrium_constant; - // std::cout << _reversible_rate[_qp] << std::endl; } diff --git a/src/userobjects/BoltzmannSolverScalar.C b/src/userobjects/BoltzmannSolverScalar.C index 4442bab..f92827c 100644 --- a/src/userobjects/BoltzmannSolverScalar.C +++ b/src/userobjects/BoltzmannSolverScalar.C @@ -196,7 +196,6 @@ BoltzmannSolverScalar::BoltzmannSolverScalar(const InputParameters & parameters) line_counter++; if (line.find(current_reaction) != std::string::npos) { - // std::cout << line_counter << std::endl; // If a line number is found, we know that we can simply skip two lines // to get to the rate coefficient (Bolsig+ output files are very uniformly structured.) _reaction_line[i] = line_counter + 2; @@ -214,8 +213,6 @@ BoltzmannSolverScalar::BoltzmannSolverScalar(const InputParameters & parameters) line_counter++; if (line.find("Mobility *N") != std::string::npos) { - // std::cout << line << std::endl; - // mooseError("EXIT"); _mobility_line = line_counter + 1; break; } @@ -302,7 +299,6 @@ BoltzmannSolverScalar::initialize() // Here we can write the input file based on input parameters // Required input: gas composition fractions, gas temperature - // std::cout << std::to_string((*_args[1])[0]) << std::endl; // To rewrite file, we can use a bash command (using system()): // sed -e "34s/.*/0.23 0.77 \/ Gas composition fraction/" -i '' temp_in.dat // line # ^ [ ] <- replacement string @@ -313,13 +309,11 @@ BoltzmannSolverScalar::initialize() { std::string edit_command; edit_command = "sed -e \"34s/.*/"; - // std::cout << coupledScalarValue("mole_fractions", 0) << std::endl; // For each variable we add both the value (converted to a string) and a following space // character. for (unsigned int i = 0; i < _nargs; ++i) { _fractions_string[i] << std::setprecision(10) << (*_args[i])[0]; - // std::cout << _fractions_string[i].str() << std::endl; edit_command = edit_command + _fractions_string[i].str() + " "; _fractions_string[i].str(""); @@ -349,7 +343,6 @@ BoltzmannSolverScalar::initialize() edit_command = "sed -e \"14s/.*/" + _field_string.str() + " \\/ Reduced field (Td)/\" -i \'\' " + _file_name; _field_string.str(""); - // std::cout << edit_command << std::endl; command = edit_command.c_str(); err = system(command); if (err < 0) @@ -384,11 +377,11 @@ BoltzmannSolverScalar::execute() _timestep_number = 1; const char * command = _bolsig_run.c_str(); - std::cout << "\nRunning BOLSIG+..." << std::endl; + mooseInfo("Running BOLSIG+..."); auto err = system(command); if (err < 0) mooseError("failed command:", _bolsig_run); - std::cout << "DONE" << std::endl; + mooseInfo("DONE running BOLSIG+"); std::fstream file(_output_file_name); if (_output_table) @@ -456,8 +449,6 @@ BoltzmannSolverScalar::execute() // file >> _x_val >> _rate_coefficient; // Now we will fit everything into data tables (automatically...difficult.) // Not sure how to do this easily. Ugh. - - // std::cout << "Tabulating rate coefficients..." << std::endl; } } diff --git a/src/userobjects/RateCoefficientProvider.C b/src/userobjects/RateCoefficientProvider.C index 046c557..480e47a 100644 --- a/src/userobjects/RateCoefficientProvider.C +++ b/src/userobjects/RateCoefficientProvider.C @@ -111,7 +111,6 @@ RateCoefficientProvider::reaction_coefficient() const reaction_rate = reaction_rate * 1e6; - // std::cout << reaction_rate << std::endl; // _reaction_rate[_qp] = _reaction_rate[_qp] * 6.022e23; // convert from [dens]/s to // [dens]/mol/s _d_k_d_en[_qp] = // _coefficient_interpolation.sampleDerivative(_reduced_field[_qp]); @@ -181,8 +180,6 @@ RateCoefficientProvider::electron_temperature(const Real E_N) const void RateCoefficientProvider::initialize() { - // std::cout << "TESTING INITIALIZATION ROUTINE IN RATECOEFFICIENTPROVIDER USEROBJECT" << - // std::endl; } void diff --git a/tutorials/TwoReactionArgon/TwoReactionArgon_plot.py b/tutorials/TwoReactionArgon/TwoReactionArgon_plot.py index c2aa1fc..1f7b626 100644 --- a/tutorials/TwoReactionArgon/TwoReactionArgon_plot.py +++ b/tutorials/TwoReactionArgon/TwoReactionArgon_plot.py @@ -1,5 +1,5 @@ # import numpy for reading .txt file -import numpy as np +import numpy as np # import matplotlib for visualization import matplotlib.pyplot as plt @@ -24,7 +24,7 @@ n_e = data[:,3] # cm^-3 # select ionization rate coefficient -k_ion = data[:,4] # cm^3 s^-1 +k_ion = data[:,4] # cm^3 s^-1 # select recombination rate coefficient k_rec = data[:,5] # cm^6 s^-1 @@ -51,4 +51,4 @@ def rise(t): plt.legend() plt.grid(linestyle='--',alpha=0.9) plt.draw() -plt.savefig("TwoReactionArgon_density.png",dpi=600) \ No newline at end of file +plt.savefig("TwoReactionArgon_density.png",dpi=600) diff --git a/tutorials/TwoReactionArgon/data/RateCoeffReader.py b/tutorials/TwoReactionArgon/data/RateCoeffReader.py index ac1995f..9469297 100644 --- a/tutorials/TwoReactionArgon/data/RateCoeffReader.py +++ b/tutorials/TwoReactionArgon/data/RateCoeffReader.py @@ -7,10 +7,10 @@ # delete first line that contains non-acceptable string information data = data[1:,:] -# select reduced electric field column +# select reduced electric field column RedField = data[:,0] # Td -# select ionization rate coefficient +# select ionization rate coefficient kIon = data[:,3] # m^3/s # convert to cm3/s kIon = kIon*1e6 # cm^3/s