Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boltzmann integration #242

Merged
merged 80 commits into from
Jun 6, 2024
Merged

Boltzmann integration #242

merged 80 commits into from
Jun 6, 2024

Conversation

uvilla
Copy link
Member

@uvilla uvilla commented Dec 21, 2023

This PR demonstrates the one-way coupling between TPS and the Boltzmann solver

  • A new class GridFunctionReaction derived from the base class Reaction to handle reaction rates described as mfem::GridFunction.
  • Modify Reaction::computeRateCoefficient to take the dof index as an additional parameter. This additional parameter is only used by GridFunctionReaction. Breaks backward compatibility.
  • Add a new reaction type bte to instantiate a GridFunctionReaction from the tps input file.
  • Various improvements to the TPS2Boltzmann interface. These include: 1) the ability to count the number of reactions of type bte whose rates need to be computed by the Boltzmann solver; 2) the ability to interpolate back to the high-order FE space used by the flow solver; 3) Additional python interfaces (get the equation of each reaction handled by Boltzmann, save the information stored in the interface to paraview, angular frequency of the electric fields, number of reactions, number of species, number of E field components, etc).

The Python script tps-time-loop.py demonstrates the functionality of the coupled interface. This example uses Arrhenius reaction rates that are computed in python and then passed to the TPS solver to verify the implementation.

An input file to run this example can be found here.

Milinda's python driver for compiling with the 0D_3V solver has been renamed as: src/tps-bte_0d3v.py

@uvilla uvilla marked this pull request as ready for review January 8, 2024 19:55
milindasf and others added 27 commits March 18, 2024 12:12
After restart, make sure all data valid before using it.  I don't
think this could ever cause an incorrect result for a time step b/c
the info should be exchanged prior to all calculations that influence
the step.  But, it can lead to (and has recently led to) to failing
asserts in the primitive variable calculations.
…ata() out of conditional

These are necessary in the boundary data section of
M2ulPhyS::initIndirectionArrays().  However, previously they were
called inside of the conditional if (NumBCelems > 0), which leads to a
problem there are some mpi ranks that have no boundary elements.
Can cause problems when mixture->GetConservativesFromPrimitives(iUp,
iState) gets called below.
…when E=0 the steady-state solution would be the delta function
In the SpongeZone ctor we have

sigma = new ParGridFunction(&fes);
*sigma = 0.;
double *hSigma = sigma->HostWrite();

and the subsequent loop (prior to this commit) only set some entries
in hSigma.  On systems where a device is available, this process can
lead to uninitialized values in the sigma field, b/c *sigma = 0
initializes the device memory and `sigma->HostWrite` immediately
invalidates that (i.e., no copy is done) but then hSigma isn't fully
initialized.

In this commit, we eliminate the *sigma = 0. initialization in favor
of setting all entries within the loop.
Formatting
Addresses compilation error on Lassen
@trevilo trevilo merged commit 7293c4f into main Jun 6, 2024
16 checks passed
trevilo added a commit that referenced this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants