ProjectTorreyPines / QED.jl

Q Evolution by Diffusion
https://projecttorreypines.github.io/QED.jl/dev
Apache License 2.0
0 stars 0 forks source link

Create structure and evolution for build currents #18

Closed bclyons12 closed 3 weeks ago

bclyons12 commented 1 month ago

This will allow for the evolution of currents in active & passive conducting structures (hereafter all referred to as coils) with implicit coupling to the changing plasma current and explicit coupling to the changing plasma shape (through provided, fixed time-derivatives of the plasma-coil mutuals).

bclyons12 commented 1 month ago

@lstagner The goal here is to keep QED very lightweight. We should build the inductance matrix, resistivity vector, and plasma-coil mutual/mutual-derivative vectors externally (from an IMAS dd or TokSys model), then just pass it to a QED_build struct.

I've made the evolve!() function to do the θ-implicit time evolution of just the coil currents (no plasma coupling). It is completely untested even for syntax errors right now, but the goal of this is to reproduce what you've done with DifferentialEquations.jl so far. We should do some benchmarking.

After this, we need to couple it to the diffusion inside the plasma, which amounts to combining the matrix equations defined in diffuse! and evolve!. These couple together as the plasma Ip used in the coil current evolution will come from the edge value of iota, while the edge loop voltage (Neumman-like boundary condition) in the diffusion equation will now come as a sum over the mutual inductance with each coil current.

bclyons12 commented 1 month ago

As of this commit, the build evolution gives the same result as @lstagner's DifferentialEquations.jl implementation.

Screenshot 2024-09-16 at 6 35 41 PM
bclyons12 commented 1 month ago

7a2ecca is untested, but should evolve the coupled plasma-build system.

bclyons12 commented 3 weeks ago

As of the last commit, the plasma-as-coil boundary condition produces the same results for the plasma and coil currents as a system where an extra coil is added with the same L, R, and V_noninductive as the plasma. If L, R, and V_ni are correct, then this should work.