Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Release v1.0.7 (#746)
Browse files Browse the repository at this point in the history
* dummy commit for testing

* dummy test commit (#729)

* Test commit (#731)

* dummy test commit

* test commit

* test commit

* test commit

* bump up version no 1.0.7 post release

* Doxyfile version update

* Update doc for inputs, input formatting related to MotorEfficiency EstimateFLA

* docker-compose not valid, cmd is 'docker compose'

---------

Co-authored-by: omerb <omerb@ornl.gov>
Co-authored-by: omerbaa <72422757+omerbaa@users.noreply.github.com>
Co-authored-by: Mark Root <rmroot@live.com>
  • Loading branch information
4 people authored Oct 11, 2024
1 parent 69f14a6 commit f45a6cc
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = AMO-Tools-Suite
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v.1.0.5
PROJECT_NUMBER = v.1.0.7

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ See our hosted documentation for the latest release at [ornl-amo.github.io](http
### Dockerizing
To make it easy for developers local building and testing, it is dockerized. To run it in docker follow this steps.
- Download the repository
- Open command line tool, change directory to the repository run `docker-compose up -d`
- To stop the running container run `docker-compose down`
- Open command line tool, change directory to the repository run `docker compose up -d`
- To stop the running container run `docker compose down`
- Running Unit Tests
- WASM: in a browser, launch [http://localhost:3000/](http://localhost:3000/)
- C++: run `docker exec -it amo-tools-suite-build /bin/bash` and run the executable `/home/AMO-Tools-Suite/build-cpp/bin/cpp_tests`
- Note:
- Every time the container is started it will rebuild the application, to check status run `docker-compose logs --tail 5`
- Every time the container is started it will rebuild the application, to check status run `docker compose logs --tail 5`
- **This is not a tutorial for docker, assumption is made the user is knowledgeable.**
2 changes: 1 addition & 1 deletion include/calculator/motor/EstimateFLA.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class EstimateFLA {
* @param motorRPM double, RPM of motor
* @param lineFrequency Motor::LineFrequency, line frequency of motor in 50Hz or 60Hz
* @param efficiencyClass Motor::EfficiencyClass, Efficiency class of motor
* @param specifiedEfficiency double, specified efficiency of motor as defined by %
* @param specifiedEfficiency double, specified efficiency of motor as defined by fraction
* @param ratedVoltage double, rated voltage of motor in volts
*/
EstimateFLA(
Expand Down
2 changes: 1 addition & 1 deletion include/calculator/motor/MotorEfficiency.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MotorEfficiency {
/**
* Calculates the motor efficiency
* @param loadFactor double, load factor - unitless ratio
* @param specifiedEfficiency, efficiency of SPECIFIED efficiency class motor (optional)
* @param specifiedEfficiency, efficiency of SPECIFIED efficiency class motor (optional) as defined by fraction
* @return double, motor efficiency as %
*/
double calculate(double loadFactor, double specifiedEfficiency = -1);
Expand Down
2 changes: 1 addition & 1 deletion include/calculator/motor/MotorPowerFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MotorPowerFactor {
* @param lineFrequency Motor::LineFrequency, classification of line frequency in Hz
* @param motorRpm double, RPM of motor
* @param efficiencyClass Motor::EfficiencyClass, efficiency class of motor
* @param specifiedEfficiency double, specified efficiency as %
* @param specifiedEfficiency double, specified efficiency as defined by fraction
* @param motorRatedPower Rated Power of motor in hp
* @param loadFactor double, load factor - unitless
* @param motorCurrent double, motor current in A
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amo-tools-suite",
"version": "1.0.6",
"version": "1.0.7",
"engines": {
"node": "20.16.0",
"npm": "10.8.1"
Expand Down
4 changes: 2 additions & 2 deletions src/calculator/motor/EstimateFLA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ std::array<double, 6> EstimateFLA::calculate() {
auto const adjustForVoltage = [this] (double plVal, double effVal) {
auto const estimate = plVal * 460 / ratedVoltage;
if (efficiencyClass == Motor::EfficiencyClass::SPECIFIED) {
return effVal * estimate * 100 / specifiedEfficiency;
return effVal * estimate / specifiedEfficiency;
}
return estimate;
};
Expand Down Expand Up @@ -233,7 +233,7 @@ std::array<double, 6> EstimateFLA::calculate() {
auto const eeeffVal = MotorEfficiency(lineFrequency, motorRPM, Motor::EfficiencyClass::ENERGY_EFFICIENT,
motorRatedPower).calculate(1, specifiedEfficiency);

if (std::fabs(seeffVal - (specifiedEfficiency / 100)) < std::fabs(eeeffVal - (specifiedEfficiency / 100)))
if (std::fabs(seeffVal - (specifiedEfficiency)) < std::fabs(eeeffVal - (specifiedEfficiency)))
{
// SE is the nominal efficiency
estimatedFLA = adjustForVoltage(seFLAValue * plMultiplier[4], seeffVal);
Expand Down
1 change: 0 additions & 1 deletion src/calculator/motor/MotorEfficiency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ double MotorEfficiency::calculate(double loadFactor, double specifiedEfficiency)
}
};
} else { // EE chosen
specifiedEfficiency = specifiedEfficiency / 100;
const double C = specifiedEfficiency / motorEfficiency[3];

for (std::size_t i = 0; i < 5; ++i) {
Expand Down
28 changes: 14 additions & 14 deletions tests/cpp/MotorEfficiency.unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ TEST_CASE( "Calculate Motor Efficiencies", "[MotorEfficiency]" ) {
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::STANDARD, 150).calculate(0.2) == Approx(0.8671487126));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::STANDARD, 150).calculate(0.25) == Approx(0.8867837736));

CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, 25) == Approx(0.2427959928));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, 35) == Approx(0.3399143899));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, 55) == Approx(0.5341511841));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, 75) == Approx(0.7283879783));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, 85) == Approx(0.8255063754));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, 95) == Approx(0.9226247725));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, .25) == Approx(0.2371623657));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, .35) == Approx(0.332027312));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, .55) == Approx(0.5217572046));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, .75) == Approx(0.7114870972));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, .85) == Approx(0.8063520435));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.25, .95) == Approx(0.9226247725));

CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.05, 25) == Approx(0.0709296658));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.15, 35) == Approx(0.25140747859));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.35, 55) == Approx(0.5403781513));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.55, 85) == Approx(0.84636808254));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.75, 95) == Approx(0.95082302895));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(1, 95) == Approx(0.95));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(1.25, 95) == Approx(0.9405));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(1.5, 95) == Approx(0.9223230289));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.05, .25) == Approx(0.0689209016));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.15, .35) == Approx(0.2448123855));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.35, .55) == Approx(0.53252116));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.55, .85) == Approx(0.8441439051));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(0.75, .95) == Approx(0.95082302895));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(1, .95) == Approx(0.95));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(1.25, .95) == Approx(0.9405));
CHECK(MotorEfficiency(Motor::LineFrequency::FREQ60, 1600, Motor::EfficiencyClass::SPECIFIED, 150).calculate(1.5, .95) == Approx(0.9223230289));
}

TEST_CASE( "Calculate Motor25 Efficiencies", "[MotorEfficiency25]" ) {
Expand Down
20 changes: 10 additions & 10 deletions tests/cpp/Results.unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ TEST_CASE( "PSATResultsPremium existing", "[PSAT results]" ) {

TEST_CASE( "PSATResults existing and modified", "[PSAT results]" ) {
double pumpEfficiency = 0.80, pump_rated_speed = 1780, kinematic_viscosity = 1.0, specific_gravity = 1.0;
double stages = 2.0, motor_rated_power = 200, motor_rated_speed = 1780, efficiency = 95, motor_rated_voltage = 460;
double stages = 2.0, motor_rated_power = 200, motor_rated_speed = 1780, efficiency = .95, motor_rated_voltage = 460;
double motor_rated_fla = 225.0, margin = 0, operating_hours = 8760, cost_kw_hour = 0.05, flow_rate = 1840;
double head = 174.85, motor_field_power = 80, motor_field_current = 125.857, motor_field_voltage = 480;
double specified_efficiency = 1.0;
Expand Down Expand Up @@ -225,7 +225,7 @@ TEST_CASE( "PSATResults - specified drive", "[PSAT results]" ) {

TEST_CASE( "PSATResults - existing and modified", "[PSAT results]" ) {
double pumpEfficiency = 0.382, pump_rated_speed = 1780, kinematic_viscosity = 1.0, specific_gravity = 1.0;
double stages = 1.0, motor_rated_power = 200, motor_rated_speed = 1780, efficiency = 95, motor_rated_voltage = 460;
double stages = 1.0, motor_rated_power = 200, motor_rated_speed = 1780, efficiency = .95, motor_rated_voltage = 460;
double motor_rated_fla = 227.29, margin = 0, operating_hours = 8760, cost_kw_hour = 0.06, flow_rate = 1000;
double head = 277.0, motor_field_power = 150.0, motor_field_current = 125.857, motor_field_voltage = 480;
double specified_efficiency = 1.0;
Expand Down Expand Up @@ -492,8 +492,8 @@ TEST_CASE( "EstimateFLA", "[EstimateFLA]" ) {
compare(EstimateFLA(100, 900, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::STANDARD, 0, 100).calculate());
compare(EstimateFLA(100, 2900, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::STANDARD, 0, 100).calculate());

compare(EstimateFLA(200, 2200, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, 96.5, 100).calculate());
compare(EstimateFLA(250, 2800, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, 98.5, 110).calculate());
compare(EstimateFLA(200, 2200, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, .965, 100).calculate());
compare(EstimateFLA(250, 2800, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, .985, 110).calculate());

compare(EstimateFLA(250, 2800, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::ENERGY_EFFICIENT, 98.5, 110).calculate());
compare(EstimateFLA(290, 1800, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::ENERGY_EFFICIENT, 93.5, 110).calculate());
Expand All @@ -516,27 +516,27 @@ TEST_CASE( "EstimateFLA", "[EstimateFLA]" ) {
t.calculate();
CHECK(t.getEstimatedFLA() == Approx(460.3700518143));

t = EstimateFLA(100, 900, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, 80, 220);
t = EstimateFLA(100, 900, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, .80, 220);
t.calculate();
CHECK(t.getEstimatedFLA() == Approx(312.5479443728)); //311.3720600292

t = EstimateFLA(125, 1900, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, 90, 220); // 120 -> 125,
t = EstimateFLA(125, 1900, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, .90, 220); // 120 -> 125,
t.calculate();
CHECK(t.getEstimatedFLA() == Approx(302.2156478756)); //291.0633925033

t = EstimateFLA(90, 900, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, 95, 120);
t = EstimateFLA(90, 900, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, .95, 120);
t.calculate();
CHECK(t.getEstimatedFLA() == Approx(432.5925070407));

t = EstimateFLA(150, 2900, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, 55, 600); // 90 -> 600
t = EstimateFLA(150, 2900, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, .55, 600); // 90 -> 600
t.calculate();
CHECK(t.getEstimatedFLA() == Approx(218.1935995715)); //1457.2693184418

t = EstimateFLA(200, 1780, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, 94, 460);
t = EstimateFLA(200, 1780, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, .94, 460);
t.calculate();
CHECK(t.getEstimatedFLA() == Approx(228.3902237064));

t = EstimateFLA(200, 1780, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, 95, 460);
t = EstimateFLA(200, 1780, Motor::LineFrequency::FREQ60, Motor::EfficiencyClass::SPECIFIED, .95, 460);
t.calculate();
CHECK(t.getEstimatedFLA() == Approx(227.288340026));
}
4 changes: 2 additions & 2 deletions tests/wasm/psat/wasm-psat-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function resultsExisting() {
let motorRatedPower = 300;
let motorRpm = 1780;
let efficiencyClass = Module.MotorEfficiencyClass.STANDARD;
let specifiedMotorEfficiency = 95;
let specifiedMotorEfficiency = .95;
let motorRatedVoltage = 460;
let fullLoadAmps = 337.3;
let sizeMargin = 0;
Expand Down Expand Up @@ -121,7 +121,7 @@ function resultsModified() {
let motorRatedPower = 100;
let motorRpm = 1780;
let efficiencyClass = Module.MotorEfficiencyClass.SPECIFIED;
let specifiedMotorEfficiency = 95;
let specifiedMotorEfficiency = .95;
let motorRatedVoltage = 460;
let fullLoadAmps = 225;
let sizeMargin = 0;
Expand Down

0 comments on commit f45a6cc

Please sign in to comment.