git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@50874 248e525c-4dfb-0310-94bc-949c084e9493

This commit is contained in:
andrew.gilmore
2012-03-19 11:57:19 +00:00
parent 2a0f4900c3
commit 0e9ca75d77
1587 changed files with 500863 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
CREATE OR REPLACE PACKAGE EFT_NOM.cout_energy_calculations IS
/**
-- Purpose : Utilities for energy calculations
-- #version $Revision: 1 $
-- #author $Author: Gilberta $
-- Created : 13/09/2004 09:39:11
*/
/*
$Header: /Isle Of Grain/database/PLSQL/cout_energy_calculations.pck 1 7/01/05 12:54 Gilberta $ Logfile, Revision, Date, Author
$Date: 7/01/05 12:54 $ Date and time of last checkin
$Modtime: 4/01/05 16:41 $ Date and time of last modification
$History: cout_energy_calculations.pck $
*
* ***************** Version 1 *****************
* User: Gilberta Date: 7/01/05 Time: 12:54
* Created in $/Isle Of Grain/database/PLSQL
* Initial Version
*/
/**
Convert energy in watt hours to a volume in cubic metres based on the given CV.
#param p_energy energy value
#param p_cv caloric value to be used (Joules per cubic metre)
#param p_energy_unit_of_size the SI prefix (multiplier) being used in the p_energy_w value e.g. 1000
#param p_cv_unit_of_size the SI prefix (multiplier) being used in the p_cv value e.g. 1000
#param p_cv_unit_quantity used indicates whether the p_cv value is expressed as mass or volume e.g. cout_units_of_measure.g_c_volume
#param p_unit_of_size_required used to indicate the SI prefix (divisor) that the volume is to be returned in e.g. 1000000
#return volume represented by the given energy and calorific value.
#usage l_vol := energy_to_volume(p_energy_w => 125, p_cv => 37.2, p_unit_of_size => cout_units_of_measure.g_c_kilo); -- kWh to cubic metres
#usage l_vol := energy_to_volume(p_energy_w => 125, p_cv => 37.2, p_unit_of_size => 1000, p_unit_of_size_required = cout_units_of_measure.g_c_mega); -- kWh to million cubic metres
*/
FUNCTION energy_to_volume(p_energy IN NUMBER
,p_cv IN NUMBER
,p_energy_unit_of_size IN cout_units_of_measure.g_t_si_prefix DEFAULT cout_units_of_measure.g_c_kilo
,p_energy_derived_unit IN cout_units_of_measure.g_t_joule_or_watthour DEFAULT cout_units_of_measure.g_c_watthour
,p_cv_unit_of_size IN cout_units_of_measure.g_t_si_prefix DEFAULT cout_units_of_measure.g_c_mega
,p_cv_unit_quantity IN cout_units_of_measure.g_t_volume_or_mass DEFAULT cout_units_of_measure.g_c_volume
,p_cv_density_of_lng IN NUMBER DEFAULT 424.5 -- kg per cubic metre
,p_unit_of_size_required IN cout_units_of_measure.g_t_si_prefix DEFAULT cout_units_of_measure.g_c_mega)
RETURN NUMBER;
/**
Wrapper to the above function for kwh to mcm conversions only.
Convert energy in watt hours to a volume in million cubic metres based on the given CV.
#param p_energy_wh energy value in watt hours
#param p_cv caloric value to be used (MegaJoules per cubic metre)
*/
FUNCTION kwh_to_mcm(p_energy IN NUMBER
,p_cv IN NUMBER) RETURN NUMBER;
/**
Wrapper to the above function for kwh to cm conversions only.
Convert energy in watt hours to a volume in cubic metres based on the given CV.
#param p_energy_wh energy value in watt hours
#param p_cv caloric value to be used (MegaJoules per cubic metre)
*/
FUNCTION kwh_to_cm(p_energy IN NUMBER
,p_cv IN NUMBER) RETURN NUMBER;
END cout_energy_calculations;
/