Skip to content

Commit

Permalink
rethought ActorWholeFacility
Browse files Browse the repository at this point in the history
  • Loading branch information
orso82 committed Dec 9, 2024
1 parent 83f2d0e commit fc645dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
19 changes: 13 additions & 6 deletions src/actors/compound/whole_facility_actor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ function _step(actor::ActorWholeFacility)
end

if par.update_plasma
# remove the wall from the calculation to avoid switching between limited/diverted plasma
wall_bkp = deepcopy(dd.wall)
empty!(dd.wall)
IMAS.first_wall!(dd.wall, IMAS.first_wall(dd.pf_active)...)
actor.StationaryPlasma = ActorStationaryPlasma(dd, act)
actor.StabilityLimits = ActorStabilityLimits(dd, act)
dd.wall = wall_bkp
end

if isempty(dd.build.layer)
Expand All @@ -109,29 +113,32 @@ function _step(actor::ActorWholeFacility)
if par.update_build
actor.HFSsizing = ActorHFSsizing(dd, act)
actor.LFSsizing = ActorLFSsizing(dd, act)
empty!(dd.pf_active) # remove old coils since those affect the shape of the layers
actor.CXbuild = ActorCXbuild(dd, act)

actor.PFdesign = ActorPFdesign(dd, act)
if act.ActorPFactive.update_equilibrium && act.ActorCXbuild.rebuild_wall
actor.CXbuild = ActorCXbuild(dd, act)
actor.PFactive = ActorPFactive(dd, act; update_equilibrium=false)
end

actor.PassiveStructures = ActorPassiveStructures(dd, act)
else
actor.FluxSwing = ActorFluxSwing(dd, act)
actor.Stresses = ActorStresses(dd, act)
actor.PFactive = ActorPFactive(dd, act)
end

actor.VerticalStability = ActorVerticalStability(dd, act)
actor.PFactive = ActorPFactive(dd, act)

actor.Neutronics = ActorNeutronics(dd, act)

actor.Blanket = ActorBlanket(dd, act)
actor.CXbuild = ActorCXbuild(dd, act)

actor.PassiveStructures = ActorPassiveStructures(dd, act)

actor.Divertors = ActorDivertors(dd, act)

actor.StabilityLimits = ActorStabilityLimits(dd, act)
actor.VerticalStability = ActorVerticalStability(dd, act)

actor.BalanceOfPlant = ActorBalanceOfPlant(dd, act)

actor.Costing = ActorCosting(dd, act)
Expand Down
3 changes: 0 additions & 3 deletions src/actors/nuclear/blanket_actor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@ function _step(actor::ActorBlanket)
end
end

# rebuild geometry
ActorCXbuild(dd, act)

return actor
end

Expand Down

0 comments on commit fc645dc

Please sign in to comment.