Skip to content

Commit

Permalink
Updating for Clang formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
keniley1 committed Jun 7, 2019
1 parent 61779ea commit 0b9c77f
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 92 deletions.
4 changes: 2 additions & 2 deletions include/kernels/ElectronEnergyTermElasticTownsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class ElectronEnergyTermElasticTownsend : public Kernel
virtual Real computeQpOffDiagJacobian(unsigned int jvar);

Real _r_units;
std::string _reaction_coeff_name;
std::string _reaction_coeff_name;
const MaterialProperty<Real> & _diffem;
const MaterialProperty<Real> & _muem;
const MaterialProperty<Real> & _alpha;
const MaterialProperty<Real> & _d_iz_d_actual_mean_en;
const MaterialProperty<Real> & _d_muem_d_actual_mean_en;
const MaterialProperty<Real> & _d_diffem_d_actual_mean_en;
//const MaterialProperty<Real> & _massem;
// const MaterialProperty<Real> & _massem;
const MaterialProperty<Real> & _massGas;
const MaterialProperty<Real> & _d_el_d_actual_mean_en;

Expand Down
1 change: 0 additions & 1 deletion include/kernels/ElectronImpactReactionReactant.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class ElectronImpactReactionReactant : public Kernel
unsigned int _mean_en_id;
unsigned int _potential_id;
unsigned int _em_id;

};

#endif /* ELECTRONIMPACTREACTIONREACTANT_H */
1 change: 0 additions & 1 deletion include/kernels/ElectronReactantSecondOrderLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,5 @@ class ElectronReactantSecondOrderLog : public Kernel
const MaterialProperty<Real> & _n_gas;
Real _stoichiometric_coeff;
bool _v_eq_electron;

};
#endif // ELECTRONREACTANTSECONDORDERLOG_H
2 changes: 1 addition & 1 deletion include/materials/EEDFRateConstantTownsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class EEDFRateConstantTownsend : public Material
MaterialProperty<unsigned int> & _d_alpha_d_var_id;
MaterialProperty<bool> & _target_coupled;
bool _is_target_aux;
// const MaterialProperty<Real> & _n_gas;
// const MaterialProperty<Real> & _n_gas;
const MaterialProperty<Real> & _massIncident;
const MaterialProperty<Real> & _massTarget;

Expand Down
4 changes: 2 additions & 2 deletions src/actions/AddZapdosReactions.C
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ AddZapdosReactions::act()
InputParameters params = _factory.getValidParams(reactant_kernel_name);
params.set<NonlinearVariableName>("variable") = _species[j];
params.set<Real>("coefficient") = _species_count[i][j];
// std::cout << getParam<std::vector<SubdomainName>>("block")[0] << ", " << _species_count[i][j] << std::endl;
// mooseError("TESTING");
// std::cout << getParam<std::vector<SubdomainName>>("block")[0] << ", " <<
// _species_count[i][j] << std::endl; mooseError("TESTING");
params.set<std::string>("reaction") = _reaction[i];
if (find_other || find_aux)
{
Expand Down
11 changes: 6 additions & 5 deletions src/kernels/ElectronEnergyTermElasticTownsend.C
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,18 @@ validParams<ElectronEnergyTermElasticTownsend>()
return params;
}

ElectronEnergyTermElasticTownsend::ElectronEnergyTermElasticTownsend(const InputParameters & parameters)
ElectronEnergyTermElasticTownsend::ElectronEnergyTermElasticTownsend(
const InputParameters & parameters)
: Kernel(parameters),
_r_units(1. / getParam<Real>("position_units")),
_diffem(getMaterialProperty<Real>("diffem")),
_muem(getMaterialProperty<Real>("muem")),
_alpha(getMaterialProperty<Real>("alpha_"+getParam<std::string>("reaction"))),
_alpha(getMaterialProperty<Real>("alpha_" + getParam<std::string>("reaction"))),
_d_iz_d_actual_mean_en(getMaterialProperty<Real>("d_iz_d_actual_mean_en")),
_d_muem_d_actual_mean_en(getMaterialProperty<Real>("d_muem_d_actual_mean_en")),
_d_diffem_d_actual_mean_en(getMaterialProperty<Real>("d_diffem_d_actual_mean_en")),
// _massem(getMaterialProperty<Real>("mass" + (*getVar("electron_species",0)).name())),
_massGas(getMaterialProperty<Real>("mass" + (*getVar("target_species",0)).name())),
// _massem(getMaterialProperty<Real>("mass" + (*getVar("electron_species",0)).name())),
_massGas(getMaterialProperty<Real>("mass" + (*getVar("target_species", 0)).name())),
_d_el_d_actual_mean_en(getMaterialProperty<Real>("d_el_d_actual_mean_en")),
_grad_potential(coupledGradient("potential")),
_em(coupledValue("electron_species")),
Expand All @@ -58,7 +59,7 @@ ElectronEnergyTermElasticTownsend::computeQpResidual()
.norm();
Real Eel = -3.0 * _massem / _massGas[_qp] * 2.0 / 3 * std::exp(_u[_qp] - _em[_qp]);
Real el_term = _alpha[_qp] * electron_flux_mag * Eel;

return -_test[_i][_qp] * el_term;
}

Expand Down
18 changes: 10 additions & 8 deletions src/kernels/ElectronEnergyTermTownsend.C
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ validParams<ElectronEnergyTermTownsend>()
return params;
}

ElectronEnergyTermTownsend::ElectronEnergyTermTownsend(
const InputParameters & parameters)
ElectronEnergyTermTownsend::ElectronEnergyTermTownsend(const InputParameters & parameters)
: Kernel(parameters),
_r_units(1. / getParam<Real>("position_units")),
_elastic(getParam<bool>("elastic_collision")),
_threshold_energy(getParam<Real>("threshold_energy")),
_elastic_energy(getMaterialProperty<Real>("energy_elastic_"+getParam<std::string>("reaction"))),
_elastic_energy(
getMaterialProperty<Real>("energy_elastic_" + getParam<std::string>("reaction"))),
_diffem(getMaterialProperty<Real>("diffem")),
_muem(getMaterialProperty<Real>("muem")),
_alpha(getMaterialProperty<Real>("alpha_"+getParam<std::string>("reaction"))),
_alpha(getMaterialProperty<Real>("alpha_" + getParam<std::string>("reaction"))),
// _d_iz_d_actual_mean_en(getMaterialProperty<Real>("d_alpha_d_en_em + Ar = em + em + Arp")),
_d_iz_d_actual_mean_en(getMaterialProperty<Real>("d_alpha_d_en_"+getParam<std::string>("reaction"))),
_d_iz_d_actual_mean_en(
getMaterialProperty<Real>("d_alpha_d_en_" + getParam<std::string>("reaction"))),
_d_muem_d_actual_mean_en(getMaterialProperty<Real>("d_muem_d_actual_mean_en")),
_d_diffem_d_actual_mean_en(getMaterialProperty<Real>("d_diffem_d_actual_mean_en")),
_grad_potential(isCoupled("potential") ? coupledGradient("potential") : _grad_zero),
Expand All @@ -37,11 +38,12 @@ ElectronEnergyTermTownsend::ElectronEnergyTermTownsend(
_em_id(coupled("em"))
{
if (!_elastic && !isParamValid("threshold_energy"))
mooseError("ElectronEnergyTermTownsend: Elastic collision set to false, but no threshold energy for this reaction is provided!");
mooseError("ElectronEnergyTermTownsend: Elastic collision set to false, but no threshold "
"energy for this reaction is provided!");
// else if (_elastic)
// _energy_change = _elastic_energy[_qp];
// _energy_change = _elastic_energy[_qp];
// else
_energy_change = _threshold_energy;
_energy_change = _threshold_energy;
}

ElectronEnergyTermTownsend::~ElectronEnergyTermTownsend() {}
Expand Down
17 changes: 8 additions & 9 deletions src/kernels/ElectronImpactReactionProduct.C
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ validParams<ElectronImpactReactionProduct>()
params.addRequiredParam<Real>("position_units", "Units of position.");
params.addRequiredParam<std::string>("reaction", "Stores the full reaction equation.");
params.addRequiredParam<std::string>("reaction_coefficient_name",
"Stores the name of the reaction rate/townsend coefficient, unique to each individual reaction.");
"Stores the name of the reaction rate/townsend coefficient, "
"unique to each individual reaction.");
return params;
}

Expand All @@ -31,7 +32,7 @@ ElectronImpactReactionProduct::ElectronImpactReactionProduct(const InputParamete
// _alpha(getMaterialProperty<Real>("alpha_iz")),
_alpha(getMaterialProperty<Real>(_reaction_coeff_name)),
// _d_iz_d_actual_mean_en(getMaterialProperty<Real>("d_iz_d_actual_mean_en")),
_d_iz_d_actual_mean_en(getMaterialProperty<Real>("d_alpha_d_en_"+_reaction_name)),
_d_iz_d_actual_mean_en(getMaterialProperty<Real>("d_alpha_d_en_" + _reaction_name)),
_d_muem_d_actual_mean_en(getMaterialProperty<Real>("d_muem_d_actual_mean_en")),
_d_diffem_d_actual_mean_en(getMaterialProperty<Real>("d_diffem_d_actual_mean_en")),
_mean_en(coupledValue("mean_en")),
Expand Down Expand Up @@ -64,8 +65,8 @@ ElectronImpactReactionProduct::computeQpResidual()
// Real iz_term = _alpha_iz[_qp] * electron_flux_mag;
// Real iz_term = alpha * electron_flux_mag;

// return -_test[_i][_qp] * iz_term;
return -_test[_i][_qp] * _alpha[_qp] * electron_flux_mag;
// return -_test[_i][_qp] * iz_term;
return -_test[_i][_qp] * _alpha[_qp] * electron_flux_mag;
}

Real
Expand Down Expand Up @@ -93,8 +94,7 @@ ElectronImpactReactionProduct::computeQpJacobian()
Real d_electron_flux_mag_d_em = electron_flux * d_electron_flux_d_em /
(electron_flux_mag + std::numeric_limits<double>::epsilon());

Real d_iz_term_d_em =
(electron_flux_mag * d_iz_d_em + _alpha[_qp] * d_electron_flux_mag_d_em);
Real d_iz_term_d_em = (electron_flux_mag * d_iz_d_em + _alpha[_qp] * d_electron_flux_mag_d_em);

return -_test[_i][_qp] * d_iz_term_d_em;
}
Expand Down Expand Up @@ -144,14 +144,14 @@ ElectronImpactReactionProduct::computeQpOffDiagJacobian(unsigned int jvar)
// Real d_iz_term_d_potential = (_alpha_iz[_qp] * d_electron_flux_mag_d_potential);
// Real d_iz_term_d_mean_en =
// (electron_flux_mag * d_iz_d_mean_en + _alpha_iz[_qp] * d_electron_flux_mag_d_mean_en);
// Real d_iz_term_d_em = (electron_flux_mag * d_iz_d_em + _alpha_iz[_qp] * d_electron_flux_mag_d_em);
// Real d_iz_term_d_em = (electron_flux_mag * d_iz_d_em + _alpha_iz[_qp] *
// d_electron_flux_mag_d_em);

Real d_iz_term_d_potential = (_alpha[_qp] * d_electron_flux_mag_d_potential);
Real d_iz_term_d_mean_en =
(electron_flux_mag * d_iz_d_mean_en + _alpha[_qp] * d_electron_flux_mag_d_mean_en);
Real d_iz_term_d_em = (electron_flux_mag * d_iz_d_em + _alpha[_qp] * d_electron_flux_mag_d_em);


if (jvar == _potential_id)
return -_test[_i][_qp] * d_iz_term_d_potential;

Expand All @@ -175,5 +175,4 @@ ElectronImpactReactionProduct::computeQpOffDiagJacobian(unsigned int jvar)
//
// else
// return 0.0;

}
12 changes: 6 additions & 6 deletions src/kernels/ElectronImpactReactionReactant.C
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ validParams<ElectronImpactReactionReactant>()
params.addRequiredCoupledVar("em", "The electron density.");
params.addRequiredParam<Real>("position_units", "Units of position.");
params.addRequiredParam<std::string>("reaction", "Stores the full reaction equation.");
params.addRequiredParam<std::string>("reaction_coefficient_name",
"Stores the name of the reaction rate, unique to each individual reaction.");
params.addRequiredParam<std::string>(
"reaction_coefficient_name",
"Stores the name of the reaction rate, unique to each individual reaction.");
return params;
}

Expand All @@ -33,7 +34,7 @@ ElectronImpactReactionReactant::ElectronImpactReactionReactant(const InputParame
// _alpha(getMaterialProperty<Real>("alpha_dex")),
_alpha(getMaterialProperty<Real>(_reaction_coeff_name)),
// _d_iz_d_actual_mean_en(getMaterialProperty<Real>("d_iz_d_actual_mean_en")),
_d_iz_d_actual_mean_en(getMaterialProperty<Real>("d_alpha_d_en_"+_reaction_name)),
_d_iz_d_actual_mean_en(getMaterialProperty<Real>("d_alpha_d_en_" + _reaction_name)),
_d_muem_d_actual_mean_en(getMaterialProperty<Real>("d_muem_d_actual_mean_en")),
_d_diffem_d_actual_mean_en(getMaterialProperty<Real>("d_diffem_d_actual_mean_en")),
_mean_en(coupledValue("mean_en")),
Expand All @@ -57,7 +58,6 @@ ElectronImpactReactionReactant::computeQpResidual()

// return -_test[_i][_qp] * iz_term;
return -_test[_i][_qp] * (-1.0) * _alpha[_qp] * electron_flux_mag;

}

Real
Expand Down Expand Up @@ -108,7 +108,8 @@ ElectronImpactReactionReactant::computeQpOffDiagJacobian(unsigned int jvar)
// Real d_iz_term_d_potential = (_alpha_iz[_qp] * d_electron_flux_mag_d_potential);
// Real d_iz_term_d_mean_en =
// (electron_flux_mag * d_iz_d_mean_en + _alpha_iz[_qp] * d_electron_flux_mag_d_mean_en);
// Real d_iz_term_d_em = (electron_flux_mag * d_iz_d_em + _alpha_iz[_qp] * d_electron_flux_mag_d_em);
// Real d_iz_term_d_em = (electron_flux_mag * d_iz_d_em + _alpha_iz[_qp] *
// d_electron_flux_mag_d_em);

Real d_iz_term_d_potential = (_alpha[_qp] * d_electron_flux_mag_d_potential);
Real d_iz_term_d_mean_en =
Expand Down Expand Up @@ -138,5 +139,4 @@ ElectronImpactReactionReactant::computeQpOffDiagJacobian(unsigned int jvar)
//
// else
// return 0.0;

}
75 changes: 42 additions & 33 deletions src/kernels/ElectronProductSecondOrderLog.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ validParams<ElectronProductSecondOrderLog>()
params.addCoupledVar("electron", "The electron species variable.");
params.addCoupledVar("target", "The target species variable.");
params.addRequiredCoupledVar("energy",
"The energy variable. (Required for jacobian term. Ignore if reaction rate is a constant value.)");
"The energy variable. (Required for jacobian term. Ignore if "
"reaction rate is a constant value.)");
params.addRequiredParam<std::string>("reaction", "The full reaction equation.");
params.addRequiredParam<Real>("coefficient", "The stoichiometric coeffient.");
params.addParam<bool>("_electron_eq_u", false, "If v == u.");
Expand Down Expand Up @@ -53,7 +54,8 @@ ElectronProductSecondOrderLog::computeQpResidual()
mult2 = _n_gas[_qp];
}

return -_test[_i][_qp] * _stoichiometric_coeff * _reaction_coeff[_qp] * std::exp(_electron[_qp]) * mult2;
return -_test[_i][_qp] * _stoichiometric_coeff * _reaction_coeff[_qp] * std::exp(_electron[_qp]) *
mult2;
}

Real
Expand Down Expand Up @@ -81,41 +83,44 @@ ElectronProductSecondOrderLog::computeQpJacobian()
else
d_ame_d_electron = 0.0;

return -_test[_i][_qp] * _stoichiometric_coeff * (_reaction_coeff[_qp] + (_d_k_d_en[_qp]*d_ame_d_electron)) * std::exp(_electron[_qp]) * mult2 * _phi[_j][_qp];
return -_test[_i][_qp] * _stoichiometric_coeff *
(_reaction_coeff[_qp] + (_d_k_d_en[_qp] * d_ame_d_electron)) * std::exp(_electron[_qp]) *
mult2 * _phi[_j][_qp];
}
// else
// {
// power = 0.0;
// gas_mult = 1.0;
// k_deriv_mult = 0;
//
// if (_target_coupled)
// mult2 = std::exp(_target[_qp]);
// else
// mult2 = _n_gas[_qp];
//
// if (_electron_eq_u)
// {
// power += 1.0;
// actual_mean_en = std::exp(_energy[_qp] - _electron[_qp]);
// d_ame_d_electron = -actual_mean_en; // Multiplied by _phi[_j][_qp] at the end
// }
// else
// d_ame_d_electron = 0.0;
//
// if (_target_coupled && _target_eq_u)
// power += 1.0;
//
// gas_mult *= std::exp(_electron[_qp]) * mult2;
//
// return -_test[_i][_qp] * _stoichiometric_coeff * power * (_reaction_coeff[_qp] + (_d_k_d_en[_qp] * d_ame_d_electron)) * gas_mult * _phi[_j][_qp];
// power = 0.0;
// gas_mult = 1.0;
// k_deriv_mult = 0;
//
// if (_target_coupled)
// mult2 = std::exp(_target[_qp]);
// else
// mult2 = _n_gas[_qp];
//
// if (_electron_eq_u)
// {
// power += 1.0;
// actual_mean_en = std::exp(_energy[_qp] - _electron[_qp]);
// d_ame_d_electron = -actual_mean_en; // Multiplied by _phi[_j][_qp] at the end
// }
// else
// d_ame_d_electron = 0.0;
//
// if (_target_coupled && _target_eq_u)
// power += 1.0;
//
// gas_mult *= std::exp(_electron[_qp]) * mult2;
//
// return -_test[_i][_qp] * _stoichiometric_coeff * power * (_reaction_coeff[_qp] +
// (_d_k_d_en[_qp] * d_ame_d_electron)) * gas_mult * _phi[_j][_qp];
// }
}

Real
ElectronProductSecondOrderLog::computeQpOffDiagJacobian(unsigned int jvar)
{
Real mult2,actual_mean_en,d_ame_d_electron,d_ame_d_energy;
Real mult2, actual_mean_en, d_ame_d_electron, d_ame_d_energy;
// Real rate_constant;

if (_target_coupled)
Expand All @@ -128,23 +133,26 @@ ElectronProductSecondOrderLog::computeQpOffDiagJacobian(unsigned int jvar)
actual_mean_en = std::exp(_energy[_qp] - _electron[_qp]);
d_ame_d_electron = -actual_mean_en;

return -_test[_i][_qp] * _stoichiometric_coeff * (_reaction_coeff[_qp] + (_d_k_d_en[_qp] * d_ame_d_electron)) * std::exp(_electron[_qp]) * mult2 * _phi[_j][_qp];
return -_test[_i][_qp] * _stoichiometric_coeff *
(_reaction_coeff[_qp] + (_d_k_d_en[_qp] * d_ame_d_electron)) * std::exp(_electron[_qp]) *
mult2 * _phi[_j][_qp];
}
else if (_target_coupled && !_target_eq_u && jvar == _target_id)
{
return -_test[_i][_qp] * _stoichiometric_coeff * _reaction_coeff[_qp] * std::exp(_electron[_qp]) * mult2 * _phi[_j][_qp];
return -_test[_i][_qp] * _stoichiometric_coeff * _reaction_coeff[_qp] *
std::exp(_electron[_qp]) * mult2 * _phi[_j][_qp];
}
else if (jvar == _energy_id)
{
actual_mean_en = std::exp(_energy[_qp] - _electron[_qp]);
d_ame_d_energy = actual_mean_en;

return -_test[_i][_qp] * _stoichiometric_coeff * (_d_k_d_en[_qp] * d_ame_d_energy) * std::exp(_electron[_qp]) * mult2 * _phi[_j][_qp];
return -_test[_i][_qp] * _stoichiometric_coeff * (_d_k_d_en[_qp] * d_ame_d_energy) *
std::exp(_electron[_qp]) * mult2 * _phi[_j][_qp];
}
else
return 0.0;


// if (!_electron_eq_u && jvar==_electron_id)
// {
// power += 1;
Expand All @@ -161,5 +169,6 @@ ElectronProductSecondOrderLog::computeQpOffDiagJacobian(unsigned int jvar)
// // Since these are in exponential form, the exp(dens1 + dens2) term always exists regardless!
// gas_mult = mult1 * mult2;
//
// return -_test[_i][_qp] * _stoichiometric_coeff * (_reaction_coeff[_qp] + (_d_k_d_en[_qp] * d_ame_d_electron)) * gas_mult * power * _phi[_j][_qp];
// return -_test[_i][_qp] * _stoichiometric_coeff * (_reaction_coeff[_qp] + (_d_k_d_en[_qp] *
// d_ame_d_electron)) * gas_mult * power * _phi[_j][_qp];
}
Loading

0 comments on commit 0b9c77f

Please sign in to comment.