Example use cases for interacting the with pyCAPS._capsValue.convertUnits() function.
1 from __future__
import print_function
7 print(
"Initiating capsProblem")
11 myGeometry = myProblem.loadCAPS(
"./csmData/cfdMultiBody.csm",
"basicTest")
14 myValue = myProblem.createValue(
"Altitude", [0.0, 30000.0, 60000.0], units=
"ft")
15 print(
"Name = ", myValue.name)
16 print(
"Value = ", myValue.value)
17 print(
"Units = ", myValue.units)
20 convertValue = myValue.convertUnits(
"m")
21 print(
"Converted Value = ", convertValue,
"(m)")
24 myValue = myProblem.createValue(
"Freq", [[0.0, 1, 2], [.25, .5, .75]], units=
"Hz")
25 print(
"Name = ", myValue.name)
26 print(
"Value = ", myValue.value)
27 print(
"Units = ", myValue.units)
30 convertValue = myValue.convertUnits(
"1 per minute")
31 print(
"Converted Value = ", convertValue,
"(1/min)")
34 myValue = myProblem.createValue(
"Energy", 1.0, units=
"Btu")
35 print(
"Name = ", myValue.name)
36 print(
"Value = ", myValue.value)
37 print(
"Units = ", myValue.units)
40 convertValue = myValue.convertUnits(
"J")
41 print(
"Converted Value = ", convertValue,
"(J)")
44 print(
"Closing our problem")