Skip to content

Commit

Permalink
adding _GPU_ ifdef for radiativeDecay in chemistry
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigfried Haering committed Oct 15, 2024
1 parent 99ba2d0 commit 7ab8954
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 35 deletions.
5 changes: 5 additions & 0 deletions src/chemistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ MFEM_HOST_DEVICE Chemistry::Chemistry(GasMixture *mixture, const ChemistryInput
case RADIATIVE_DECAY: {
assert(inputs.reactionInputs[r].modelParams != NULL);
double R = inputs.reactionInputs[r].modelParams[0];
#ifndef _GPU_
reactions_[r] = new RadiativeDecay(R, &inputs.speciesMapping, &inputs.speciesNames, &numSpecies_,
&reactantStoich_[r * numSpecies_], &productStoich_[r * numSpecies_]);
#else
printf("Radiative decay not currently supported for GPU execution.") assert(false);
break;
#endif
} break;
default:
printf("Unknown reactionModel.");
Expand Down
35 changes: 0 additions & 35 deletions src/reaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,41 +296,6 @@ MFEM_HOST_DEVICE double RadiativeDecay::escapeFactCalc(const double &n_i, const
}

eta = min(eta, 1.0);

return eta;
}

#else
// Radiative decay portion: extracted from commit (de27f14)
MFEM_HOST_DEVICE RadiativeDecay::RadiativeDecay(const double _R, const std::map<std::string, int> *_speciesMapping,
const std::vector<std::string> *_speciesNames, const int *numSpecies,
const double *_reactantStoich, const double *_productStoich) {
// : Reaction(RADIATIVE_DECAY), Rcyl(_R) {
rank0_ = Mpi::Root();
if (rank0_) {
printf("Radiative decay not supported on GPU yet!");
}
}

MFEM_HOST_DEVICE RadiativeDecay::~RadiativeDecay() {}

MFEM_HOST_DEVICE double RadiativeDecay::computeRateCoefficient(const double &T_h, const double &T_e,
const int &dofindex,
[[maybe_unused]] const bool isElectronInvolved,
const double *nsp) {
double effAcoef = 0.0;
return effAcoef;
}

MFEM_HOST_DEVICE void RadiativeDecay::GetNumDensityOfInteralLevels(const int NumOfInteral_lvl, const double &n_sp,
const double &T_e, double *n_sp_internal) {}

MFEM_HOST_DEVICE void RadiativeDecay::GetEinsteinACoefficient(const double &T_h, const double &T_e, double *effAcoef) {}

MFEM_HOST_DEVICE double RadiativeDecay::escapeFactCalc(const double &n_i, const double &E_j, const double &E_i,
const double &g_j, const double &g_i, const double &A_ji,
const double &T_g) {
double eta = 1.0;
return eta;
}
#endif

0 comments on commit 7ab8954

Please sign in to comment.