Commit Graph

5 Commits

Author SHA1 Message Date
Michele Guerini Rocco
7342566ac0
add a switch for realtime mode
This adds a single switch to configure GRAY for realtime operation.

In realtime a single ray is traced until absorption reaches ≈50% of the
total. The simulation is stopped immediately after returning only the
position (as ρ_p=√ψ) of the peak. So, no post-processing is performed at
all. In addition:

 - all outputs units are inactivated (equivalent to passing --units 0);

 - current drive computation is disabled (ecrh_cd.ieccd=0);

 - absorption is computed in weakly relativistic approximation
   (ecrh_cd.iwarm=1);

 - reflections and multiple plasma passes are disabled;
2024-03-24 09:25:50 +01:00
Michele Guerini Rocco
92b3ad9bd3
src/gray_core.f90: implement adaptive step control
This implements a method to control the integrator step size based on
the integration error and resonance conditions. The main advantages are that:

  - the ray trajectories have a bounded error;
  - the initial step size can be large as to quickly traverse the vacuum;
  - the results no longer depend on the choice of the step size.

The error is estimated from the real part of the dispersion relation
Λ(x̅, N̅), which if solved exactly should be zero.
The error bound is set to a strict value when crossing the plasma
boundary to ensure a correct coupling and is relaxed afterwards.

Finally, when the ray is approaching a resonance the controller ensures
the step size is small compared to the absorption profile.
2024-02-26 14:44:19 +01:00
Michele Guerini Rocco
c9c20198a7
src/gray_core.f90: make integrator configurable
This change makes the integration method of the raytracing equations
configurable and significantly simplifies the integrator subroutine
by moving the implementation details outside.
2024-02-26 13:50:07 +01:00
Michele Guerini Rocco
45ef9c5eae
src/coreprofiles: make psnbnd fully automatic
1. Fix the mismatch between the psnbnd in coreprofiles and gray_core.
   This happens whenever gray overrides the externally provided one
   (i.e. the density tail would become negative before psnbnd and is so
   rescaled to end exactly on the zero).

2. Make psnbnd no longer required by always computing it as in 1.
   It hasn't been removed, because gray_params.data is sacrosant,
   but it no longer has any effect.

3. Cleanup: mark public functions, restructure the global variables into
   three categories; add comments explaining the analytical profiles
   format, formulae and how the polynomial tail is computed.
2022-05-22 04:06:21 +02:00
Michele Guerini Rocco
6010a9361b
add INI configuration file
This adds a new configuration file based on the INI format.
The new format will allow adding GRAY parameters without breaking
compatibility with existing configurations, unlike as of the old
gray_params.data.
2022-05-22 01:02:19 +02:00