Skip to content

Commit 9b580bd

Browse files
authored
Update flux_matcher_actor.jl (#999)
* Update flux_matcher_actor.jl reset fast ion densities in flux matcher * Update flux_matcher_actor.jl handle missing fast ion density in flux matcher * Update init_expressions.json fast density and pressure is now being populated in flux matcher
1 parent d017674 commit 9b580bd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/actors/transport/flux_matcher_actor.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,10 +1132,16 @@ function cp1d_copy_primary_quantities(cp1d::IMAS.core_profiles__profiles_1d{T})
11321132
to_cp1d.grid.rho_tor_norm = deepcopy(cp1d.grid.rho_tor_norm)
11331133
to_cp1d.electrons.density_thermal = deepcopy(cp1d.electrons.density_thermal)
11341134
to_cp1d.electrons.temperature = deepcopy(cp1d.electrons.temperature)
1135+
if !ismissing(cp1d.electrons, :density_fast)
1136+
to_cp1d.electrons.density_fast = deepcopy(cp1d.electrons.density_fast)
1137+
end
11351138
resize!(to_cp1d.ion, length(cp1d.ion))
11361139
for (initial_ion, ion) in zip(to_cp1d.ion, cp1d.ion)
11371140
initial_ion.element = ion.element
11381141
initial_ion.density_thermal = deepcopy(ion.density_thermal)
1142+
if !ismissing(ion, :density_fast)
1143+
initial_ion.density_fast = deepcopy(ion.density_fast)
1144+
end
11391145
initial_ion.temperature = deepcopy(ion.temperature)
11401146
end
11411147
to_cp1d.rotation_frequency_tor_sonic = deepcopy(cp1d.rotation_frequency_tor_sonic)
@@ -1147,9 +1153,15 @@ function cp1d_copy_primary_quantities!(to_cp1d::T, cp1d::T) where {T<:IMAS.core_
11471153
to_cp1d.grid.rho_tor_norm .= cp1d.grid.rho_tor_norm
11481154
to_cp1d.electrons.density_thermal .= cp1d.electrons.density_thermal
11491155
to_cp1d.electrons.temperature .= cp1d.electrons.temperature
1156+
if !ismissing(cp1d.electrons, :density_fast)
1157+
to_cp1d.electrons.density_fast .= cp1d.electrons.density_fast
1158+
end
11501159
for (initial_ion, ion) in zip(to_cp1d.ion, cp1d.ion)
11511160
initial_ion.density_thermal .= ion.density_thermal
11521161
initial_ion.temperature .= ion.temperature
1162+
if !ismissing(ion, :density_fast)
1163+
initial_ion.density_fast .= ion.density_fast
1164+
end
11531165
end
11541166
to_cp1d.rotation_frequency_tor_sonic .= cp1d.rotation_frequency_tor_sonic
11551167
return to_cp1d

0 commit comments

Comments
 (0)