GithubHelp home page GithubHelp logo

ornl-amo / amo-tools-suite Goto Github PK

View Code? Open in Web Editor NEW
20.0 13.0 12.0 15.57 MB

AMO-Tools-Suite is an energy efficiency calculation library in C++ with optional Nan Node add-on bindings for the Department of Energy Advanced Manufacturing Office (DOE AMO) Desktop, also known as MEASUR.

License: Other

CMake 0.87% Shell 0.05% C++ 84.55% JavaScript 14.35% Dockerfile 0.02% HTML 0.16%
energy modeling industrial steam pump fans furnace process-heating

amo-tools-suite's Introduction

AMO Tools Suite

AMO Tools Suite is a cross-platform collection of calculations and tools to support industrial equipment modeling. See our hosted documentation for the latest release at ornl-amo.github.io

Dependencies

C++

  • make
  • CMake (cmake-curses to use the ccmake gui)
  • GCC 4.8.5 or later
    • Windows: MinGW or Cygwin or Visual Studio Build Tools or with other C++ compiler
  • Doxygen (only for building documentation)

Web Assembly Compilation SDK

Node

Building

  • cd into the emsdk directory:
    • run emsdk install latest followed by emsdk activate latest
    • Activate PATH and other environment variables by running source emsdk_env.sh or on Windows run emsdk_env.bat
  • cd into AMO-Tools-Suite directory:
    • create directory buildwasm and cd into it
    • run 'emcmake cmake -DBUILD_WASM=ON ..'
      • Note: If multiple compilers are present and default environment is not used, use -G "XXX Makefiles", example for windows using MinGW => emcmake cmake -D BUILD_WASM=ON .. -G "MinGW Makefiles"
    • run emmake make

Unit Tests

  • To run the WASM unit tests:
    • Install node_modules dependencies: cd into AMO-Tools-Suite directory and
      run npm install followed by npm run test-wasm
  • To build C++ unit tests, ensure the BUILD_TESTING flag is set (which is default) then:
    • create directory buildcpp and cd into it
    • run 'cmake ..'
      • Note: If multiple compilers are present and default environment is not used, use -G "XXX Makefiles", example for windows using MinGW => cmake .. -G "MinGW Makefiles"
    • run 'cmake --build .'
    • execute cpp_tests.exe
  • On MacOS or Linux, the test executable can be found under the bin directory. On Windows, the executable can be found under either the Debug or Release directories, depending on CMake configuration

Packaging

  • Enable the BUILD_PACKAGE flag in the CMakeCache, then cmake ./ then make package
  • Or use this directly for Windows: cmake -D BUILD_TESTING:BOOL=OFF ./ and cmake --build . --config Release --target PACKAGE
  • To make package on Linux or Mac, run ccmake. and set BUILD_TESTING OFF, BUILD_PACKAGE ON, then configure and generate. Then make package.

Documentation

  • To generate documentation: doxygen Doxyfile

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
  • Running Unit Tests
    • WASM: in a browser, launch 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
        • This is not a tutorial for docker, assumption is made the user is knowledgeable.

amo-tools-suite's People

Contributors

aeledbetter avatar akferree avatar brappop avatar c0desimple avatar causeyc avatar dmitryhoward avatar fontenotzach avatar gaccawi avatar jeffjensen avatar kbeanblossom avatar koay9f avatar mbadams5 avatar mlwhitmer avatar mmaniat01 avatar nbintertech avatar omerbaa avatar pshires avatar rmroot avatar rounddev avatar shubhamkokul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amo-tools-suite's Issues

Flue Gas Bug

Bug in the calculation for flue gas losses

1- lines 47 & 53 for GasFlueGasMaterial.cpp
"combustionAirTemp" needs to be changed to a new variable

2- Header - add variable
3- Bindings - add variable

PHAST Exe Units

For electricity HHV units, Imperial: Btu/kWh.
Metric is fine

Add layer materials to database

Determine layer material properties from Visual Basic source code and define/design the table based on that.

Add the data to the project.

Refactor EstimateFLA

Completely refactor EstimateFLA code to make use of modern C++ features and optimizations

Premium Motors

When optimizing,

if hp > 500 hp then use 500 hp

if poles > 6, use poles = 6

Furnace types

Get list of furnace types for electro technologies and fuel fired.

Help text for calculators

Add text for the individual fields in the calculators where there currently is none.
Primarily PSAT,

Catch C++ exceptions in the bindings

Catch C++ runtime exceptions and throw them at a higher level (the NAN bindings) so that a useful message will be shown to the developer in the console and the program will not crash due to a C++ runtime exception

PHAST Utility Cost

I think this comes from Issue 793. The calculations for annual cost are all now coming out as zero. I THINK b/c we changed the final annual energy values to GJ & MMBtu, so probably the calculation for cost has a /1000000 that it does not need

implement amca203 based fan doc

provide C++ implementations for the amca 203 based fan document, received sometime near the end of august. And halfway provide fan performance curve algorithms in C++

Energy Input - Electric Arc Furnace (EAF)

Inputs:
natural_gas_heat_input
natural_gas_flow
natural_gas_heat (cu.ft/cycle) = natural_gas_flow * (1020/10^6)
measured_oxygen_flow (scfh)

coal_carbon_injection (lbs/cycle)
coal_heating_value (btu/lb)
coal_heat_content (mm btu/cycle) = coal_heating_value * coal_carbon_injection/10^6

electrode_use (lbs/cycle)
electrode_heating_value (btu/lb)
electrode_heat_content (mm btu/cycle) = electrode_use * electrode_heating_value/10^6

other_fuels (mm btu/cycle)

electricity_input (kwh/cycle)

total_chemical_energy_input (mm btu/cycle) = natural_gas_heat_input + coal_heat_content +
electrode_heat_content + other_fuels

kwh_cycle = total_chemical_energy_input * (10^6/3412)

heat_delivered (btu/cycle) = natural_gas_heat + coal_heat_content + electrode_heat_content
+ other_fuels

total (kwh/cycle) = kwh_cycle + electricity_input;

PH Calculator help text remove maxes

Some of these still have "Maximum Value Allowed" please remove all Maxes EXCEPT the following

O2 Enrichment:
O2 in combustion air
O2 in flue gasses (both)

Efficiency Improvement Calculator
Flue Gas Oxygen (both)

Energy Equivalency
ALL OF THESE ARE OKAY AS IS

Flow Calculations Energy Use
Coefficient of Discharge

Pre-Assessment
THESE ARE FINE

Refactor MotorEfficiency Classes

Refactor MotorEfficiency and MotorEfficiency25 classes to make use of modern C++ features and optimizations. Good potential for optimization and cleaner code here, just like EstimateFLA

Refactor CurveFitVal

Change curve fit val to make more sense reading wise, as well as look at that actual calculation. The constructor has been changed to take vectors and let the compiler decide when to std::move them (it will move in all current usages of CurveFitVal - in place vectors are passed to the constructor)

Slag - Other Material Losses

Issue overview

Params:
Weight (lb/cycle)
Initial Temp (F)
Final Temp (F)
Specific Heat (Btu/(lb. F))
Correction Factor

totalHeat = weight * specificHeat * (finalTemp - initialTemp);
totalHeat = totalHeat * correctionFactor;

Reorganize MotorEfficiency class

Both MotorEfficiency classes share nearly identical input, so this presents potential to combine them and have separate calculation methods. User input could be checked at runtime to determine correctness as well

Add Fan Bindings

The bindings for fans have not yet been added. Will need to have a UI mockup brainstorm session of some kind before tackling this one

Database materials cleanup

There are duplicate string names in the database for different materials. Each material needs to be uniquely named.

PHAST O2 Enrichment Calculator - Suite

Calculations for Energy Savings assume "Oxygen in air " = 21%.

The user input for this should be removed (Desktop) and the calculation for available heat for the "air" side should use 21% for O2 in air (Suite).

Repair Doxygen warnings

/ClionProjects/AMO-Tools-Suite/include/calculator/losses/WallLosses.h:17: warning: Compound WallLosses is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/GasLoadChargeMaterial.h:20: warning: Compound GasLoadChargeMaterial is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/furnace/FlowCalculationsEnergyUse.h:15: warning: Compound FlowCalculationsEnergyUse is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/furnace/EnergyEquivalency.h:15: warning: Compound ElectricalEnergyEquivalency is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/LiquidLoadChargeMaterial.h:20: warning: Compound LiquidLoadChargeMaterial is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/furnace/EnergyEquivalency.h:122: warning: Compound FuelFiredEnergyEquivalency is not documented.
/ClionProjects/AMO-Tools-Suite/include/psat/Motor.h:17: warning: Compound Motor is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/EnergyInputEAF.h:17: warning: Compound EnergyInputEAF is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/GasFlueGasMaterial.h:185: warning: Compound GasFlueGasMaterial is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/motor/MotorShaftPower.h:24: warning: Compound MotorShaftPower is not documented.
/ClionProjects/AMO-Tools-Suite/include/psat/OptimizationRating.h:19: warning: Compound OptimizationRating is not documented.
/ClionProjects/AMO-Tools-Suite/include/psat/Financial.h:19: warning: Compound Financial is not documented.
/ClionProjects/AMO-Tools-Suite/include/psat/Pump.h:18: warning: Compound Pump is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/SolidLoadChargeMaterial.h:25: warning: Compound SolidLoadChargeMaterial is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/FixtureLosses.h:20: warning: Compound FixtureLosses is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/SlagOtherMaterialLosses.h:22: warning: Compound SlagOtherMaterialLosses is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/pump/HeadTool.h:66: warning: Compound HeadToolBase is not documented.
/ClionProjects/AMO-Tools-Suite/include/sqlite/SQLite.h:17: warning: Compound SQLiteWrapper is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/LoadChargeMaterial.h:10: warning: Compound LoadChargeMaterial is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/LiquidCoolingLosses.h:14: warning: Compound LiquidCoolingLosses is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/furnace/O2Enrichment.h:15: warning: Compound O2Enrichment is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/GasFlueGasMaterial.h:21: warning: Compound GasProperties is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/pump/HeadTool.h:151: warning: Compound HeadToolSuctionTank is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/LeakageLosses.h:16: warning: Compound LeakageLosses is not documented.
/ClionProjects/AMO-Tools-Suite/include/sqlite/SQLite.h:90: warning: Compound SQLite is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/AuxiliaryPower.h:17: warning: Compound AuxiliaryPower is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/pump/HeadTool.h:205: warning: Compound HeadTool is not documented.
/ClionProjects/AMO-Tools-Suite/include/psat/PSATResult.h:23: warning: Compound PSATResult is not documented.
/ClionProjects/AMO-Tools-Suite/include/psat/FieldData.h:18: warning: Compound FieldData is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/furnace/EfficiencyImprovement.h:15: warning: Compound EfficiencyImprovement is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/GasFlueGasMaterial.h:67: warning: Compound GasCompositions is not documented.
/ClionProjects/AMO-Tools-Suite/include/phast/Furnace.h:17: warning: Compound Furnace is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/GasCoolingLosses.h:17: warning: Compound GasCoolingLosses is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/Atmosphere.h:19: warning: Compound Atmosphere is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/SolidLiquidFlueGasMaterial.h:6: warning: Compound SolidLiquidFlueGasMaterial is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/WaterCoolingLosses.h:14: warning: Compound WaterCoolingLosses is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/OpeningLosses.h:13: warning: Compound OpeningLosses is not documented.
/ClionProjects/AMO-Tools-Suite/include/calculator/losses/ExhaustGasEAF.h:16: warning: Compound ExhaustGasEAF is not documented.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.