Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
04d0050
Implement low-pass filter damping in gyrokinetic species model
Maxwell-Rosen Mar 27, 2026
b99a98c
Add reset function for species damping in gyrokinetic app
Maxwell-Rosen Mar 27, 2026
41e4a27
Refactor damping functions for low-pass filter implementation in gyro…
Maxwell-Rosen Mar 27, 2026
a768b4f
Uncrustify format
Maxwell-Rosen Mar 27, 2026
107f2cd
Refactor damping functions in gk_species_damping.c for improved clari…
Maxwell-Rosen Mar 27, 2026
3f3be48
Refactor gk_species_damping_step_fbar_ssp_rk3 for improved clarity an…
Maxwell-Rosen Mar 27, 2026
f35880e
Implement low-pass filter damping functions and integrate into gyroki…
Maxwell-Rosen Mar 28, 2026
e3bce23
Uncrustify format
Maxwell-Rosen Mar 28, 2026
135599f
Add comments for damping helpers and low-pass filter functions
Maxwell-Rosen Mar 28, 2026
98492c3
Update damping parameters to use rate_const instead of damping_const …
Maxwell-Rosen Mar 28, 2026
ec79063
Add low-pass filter fbar write functions and update damping struct fo…
Maxwell-Rosen Mar 28, 2026
a799125
Remove unused parameter from gk_species_damping_reset function
Maxwell-Rosen Mar 28, 2026
740d630
Set evolve flag for low-pass filter damping to enable time evolution …
Maxwell-Rosen Mar 28, 2026
40a87ec
Add write_rate flag to damping struct and implement rate diagnostics …
Maxwell-Rosen Mar 29, 2026
a3825e7
Merge branch 'main' into low-pass-filter
Maxwell-Rosen Apr 4, 2026
d4be6d1
Change the fbar distribution (low passed) that we update to P0 to sav…
Maxwell-Rosen Apr 4, 2026
df74b33
There was some really crazy spacing issues that look like it might co…
Maxwell-Rosen Apr 4, 2026
d1a1d43
Depricate damping with the loss cone multiplier. This will cause merg…
Maxwell-Rosen Apr 4, 2026
bd9a617
Bring back whether fbar is gkhyb basis or p0. I get a feeling that ha…
Maxwell-Rosen Apr 4, 2026
0b06424
Add the appropriate reset method to gyrokinetic.c
Maxwell-Rosen Apr 4, 2026
26b3917
Make sure the timings are where they should be. Update the header to …
Maxwell-Rosen Apr 4, 2026
6e876a2
Change the flag for wite init only dependent on evolve. This was a mi…
Maxwell-Rosen Apr 5, 2026
44bd9c2
Implement low-pass filter damping enhancements: preserve fbar state a…
Maxwell-Rosen Apr 5, 2026
6d13d26
Push changes to the regression test too
Maxwell-Rosen Apr 5, 2026
4b22dc1
Clean up the reset of the fbar across phases. Valgrind clean
Maxwell-Rosen Apr 8, 2026
f2599ba
Merge branch 'main' into low-pass-filter
Maxwell-Rosen May 26, 2026
6a42871
Merge branch 'main' into low-pass-filter
Maxwell-Rosen Sep 6, 2026
7d80cca
› When simulations are restarted, the low-pass filter fbar should be …
Maxwell-Rosen Sep 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions gyrokinetic/apps/gk_species.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ gk_species_omegaH_dt(gkyl_gyrokinetic_app *app, struct gk_species *gks, const st

static double
gk_species_rhs_dynamic(gkyl_gyrokinetic_app *app, struct gk_species *species,
const struct gkyl_array *fin, struct gkyl_array *rhs, struct gkyl_array **bflux_moms)
const struct gkyl_array *fin, const struct gkyl_array *fbar_in,
struct gkyl_array *rhs, struct gkyl_array **bflux_moms)
{
// Gyroaverage the potential if needed.
species->gyroaverage(app, species, app->field->phi_smooth, species->gyro_phi);
Expand All @@ -92,7 +93,7 @@ gk_species_rhs_dynamic(gkyl_gyrokinetic_app *app, struct gk_species *species,

// Damping term.
gk_species_damping_advance(app, species, &species->damping, app->field->phi_smooth, fin,
species->lte.f_lte, rhs, species->cflrate);
fbar_in, species->lte.f_lte, rhs, species->cflrate);

// LBO Collisions.
gk_species_lbo_rhs(app, species, &species->lbo, fin, rhs);
Expand Down Expand Up @@ -182,7 +183,8 @@ gk_species_rhs_implicit_dynamic(gkyl_gyrokinetic_app *app, struct gk_species *sp

static double
gk_species_rhs_static(gkyl_gyrokinetic_app *app, struct gk_species *species,
const struct gkyl_array *fin, struct gkyl_array *rhs, struct gkyl_array **bflux_moms)
const struct gkyl_array *fin, const struct gkyl_array *fbar_in,
struct gkyl_array *rhs, struct gkyl_array **bflux_moms)
{
double omega_cfl = 1/DBL_MAX;
return app->cfl/omega_cfl;
Expand Down Expand Up @@ -1611,6 +1613,7 @@ gk_species_init(struct gkyl_gk *gk_app_inp, struct gkyl_gyrokinetic_app *app, st
gk_species_anomalous_diff_init(app, gks, &gks->anom_diff);

// Damping term -nu*f on RHS.
gks->damping = (struct gk_damping) { };
gk_species_damping_init(app, gks, &gks->damping);

// Function multiplying df/dt.
Expand Down Expand Up @@ -1850,6 +1853,9 @@ gk_species_apply_ic(gkyl_gyrokinetic_app *app, struct gk_species *gks, double t0
if (gks->info.init_from_file.type == 0)
gk_species_projection_calc(app, gks, &gks->proj_init, gks->f, t0);

// Initialize fbar for low-pass filter damping
gk_species_damping_set_fbar_to_f(gks, &gks->damping, gks->f);

// We are pre-computing source for now as it is time-independent.
gk_species_source_calc(app, gks, &gks->src, gks->lte.f_lte, t0);
}
Expand Down Expand Up @@ -1900,9 +1906,10 @@ gk_species_apply_ic_cross(gkyl_gyrokinetic_app *app, struct gk_species *gks_self

double
gk_species_rhs(gkyl_gyrokinetic_app *app, struct gk_species *species,
const struct gkyl_array *fin, struct gkyl_array *rhs, struct gkyl_array **bflux_moms)
const struct gkyl_array *fin, const struct gkyl_array *fbar_in,
struct gkyl_array *rhs, struct gkyl_array **bflux_moms)
{
return species->rhs_func(app, species, fin, rhs, bflux_moms);
return species->rhs_func(app, species, fin, fbar_in, rhs, bflux_moms);
}

double
Expand Down
Loading