MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / lbmToLbf

Method lbmToLbf

src/utilities/units/Quantity.cpp:144–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144void Quantity::lbmToLbf() {
145 OptionalIPUnit iu = m_units.optionalCast<IPUnit>();
146 if (!iu) {
147 LOG_AND_THROW("Cannot convert non-IP quantity " << *this << " in system " << system().valueName() << " from pound-mass to pound-force.");
148 }
149
150 // convert from (value * lb_m^x * ...) to (value * lb_f^x * ...)
151 // lb_m^x * (1/gc)^x = lb_f^x * s^{2x} / ft^x
152 int x = baseUnitExponent("lb_m");
153 if (x != 0) {
154 iu->lbmToLbf();
155 m_value /= std::pow(IPUnit::gc(), x);
156 }
157 OS_ASSERT(baseUnitExponent("lb_m") == 0);
158}
159
160void Quantity::lbfToLbm() {
161 OptionalIPUnit iu = m_units.optionalCast<IPUnit>();

Callers

nothing calls this directly

Calls 2

valueNameMethod · 0.80
powFunction · 0.70

Tested by

no test coverage detected