Skip to content

Commit

Permalink
Move function
Browse files Browse the repository at this point in the history
  • Loading branch information
cfe316 committed Dec 5, 2023
1 parent 3826972 commit 1c4eb68
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
11 changes: 11 additions & 0 deletions src/model/resources/fusion/fusion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -486,3 +486,14 @@ function fusion_annual_parasitic_power(EP, inputs, resource_component::AbstractS
annual_parasitic = weight' * eTotalParasitic
return annual_parasitic

Check warning on line 487 in src/model/resources/fusion/fusion.jl

View check run for this annotation

Codecov / codecov/patch

src/model/resources/fusion/fusion.jl#L483-L487

Added lines #L483 - L487 were not covered by tests
end

function thermal_fusion_annual_parasitic_power(EP::Model, inputs::Dict, setup::Dict)::Vector{Float64}
dfGen = inputs["dfGen"]
scale_factor = setup["ParameterScale"] == 1 ? ModelScalingFactor : 1
FUSION = resources_with_fusion(dfGen)

Check warning on line 493 in src/model/resources/fusion/fusion.jl

View check run for this annotation

Codecov / codecov/patch

src/model/resources/fusion/fusion.jl#L490-L493

Added lines #L490 - L493 were not covered by tests

resource_component = dfGen[FUSION, :Resource]

Check warning on line 495 in src/model/resources/fusion/fusion.jl

View check run for this annotation

Codecov / codecov/patch

src/model/resources/fusion/fusion.jl#L495

Added line #L495 was not covered by tests

expr = fusion_annual_parasitic_power.(Ref(EP), Ref(inputs), resource_component)
return scale_factor * value.(expr)

Check warning on line 498 in src/model/resources/fusion/fusion.jl

View check run for this annotation

Codecov / codecov/patch

src/model/resources/fusion/fusion.jl#L497-L498

Added lines #L497 - L498 were not covered by tests
end
16 changes: 0 additions & 16 deletions src/model/resources/fusion/fusion_policy_adjustments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,3 @@ function fusion_parasitic_power_adjust_energy_share_requirement!(EP, inputs)
end

Check warning on line 119 in src/model/resources/fusion/fusion_policy_adjustments.jl

View check run for this annotation

Codecov / codecov/patch

src/model/resources/fusion/fusion_policy_adjustments.jl#L119

Added line #L119 was not covered by tests
end

#################################
#
# For various outputs
#
#################################

function thermal_fusion_annual_parasitic_power(EP::Model, inputs::Dict, setup::Dict)::Vector{Float64}
dfGen = inputs["dfGen"]
scale_factor = setup["ParameterScale"] == 1 ? ModelScalingFactor : 1
FUSION = resources_with_fusion(dfGen)

resource_component = dfGen[FUSION, :Resource]

expr = fusion_annual_parasitic_power.(Ref(EP), Ref(inputs), resource_component)
return scale_factor * value.(expr)
end

0 comments on commit 1c4eb68

Please sign in to comment.