Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pv power fix #210

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object PvInputGenerator {
val height = sample(params.elevationAngle).asDegreeGeom
val kG = sample(params.kG)
val kT = sample(params.kT)
val sRated = input.sRated.asMegaVoltAmpere
val sRated = input.sRated.asKiloVoltAmpere
val cosPhiRated = determineCosPhiRated(input)
val qCharacteristics =
convertQCharacteristic(params.qCharacteristic, cosPhiRated)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ object WecTypeGenerator {

val capex = RandomSampler.sample(params.capex).asEuro
val opex = RandomSampler.sample(params.opex).asEuroPerMegaWattHour
val sRated = statGen.sRated.asMegaVoltAmpere
val sRated = statGen.sRated.asKiloVoltAmpere
val cosPhiRated = ConversionHelper.determineCosPhiRated(statGen)
val cpCharacteristic = new WecCharacteristicInput(
params.cpCharacteristic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ object QuantityUtils {
VOLTAMPERE
)

def asKiloVoltAmpere: ComparableQuantity[Power] = Quantities.getQuantity(
value,
MetricPrefix.KILO(VOLTAMPERE)
)

def asMegaVoltAmpere: ComparableQuantity[Power] = Quantities.getQuantity(
value,
MetricPrefix.MEGA(VOLTAMPERE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ object ConverterTestData extends LazyLogging {
1d,
0.9,
false,
11.asMegaVoltAmpere,
11.asKiloVoltAmpere,
0.91
)
)
Expand Down Expand Up @@ -444,7 +444,7 @@ object ConverterTestData extends LazyLogging {
"someWecType",
100.asEuro,
50.asEuroPerMegaWattHour,
11.asMegaVoltAmpere,
11.asKiloVoltAmpere,
0.91,
new WecCharacteristicInput("cP:{(10.00,0.05),(15.00,0.10),(20.00,0.20)}"),
96.asPercent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ class QuantityUtilsSpec extends Matchers with AnyWordSpecLike {
)
}

"convert a double to kilo volt ampere" in {
value.asKiloVoltAmpere should equalWithTolerance(
Quantities.getQuantity(
value,
MetricPrefix.KILO(VOLTAMPERE)
)
)
}

"convert a double to mega volt ampere" in {
value.asMegaVoltAmpere should equalWithTolerance(
Quantities.getQuantity(
Expand Down