EPANET-RTX  1.1
real-time extension for the EPANET toolkit
Sample Configuration File
# RTX configuration file format
# comments
// comments
/* comments */
version = "1.0";
configuration:
{
# point records
records = (
{
name = "mysql record name";
type = "MySQL";
connection = "DB=RTX_db_name;UID=mysql_user;PWD=mysql_pass;HOST=tcp://localhost;";
},
{
name = "csv record";
type = "CSV";
path = "csv_data";
readonly = false;
},
{
name = "Scada Historian";
type = "SCADA";
connection = "DRIVER=TDS;SERVER=192.168.1.2;UID=scada_user;PWD=scada_pass;DATABASE=Runtime;TDS_Version=7.0;Port=1433;";
querySyntax = {
Table = "History";
DateColumn = "DateTime";
TagColumn = "TagName";
ValueColumn = "Value";
QualityColumn = "Quality";
};
connectorType = "wonderware_mssql";
}
); // records
# regular timeseries clocks
clocks = (
{
name = "1m";
type = "regular";
period = 60;
start = 0;
},
{
name = "15m";
type = "regular";
period = 900;
start = 0;
}
); // clocks
timeseries = (
{
name = "Scada_tag_1_flowrate";
type = "TimeSeries";
description = "description of tag";
pointRecord = "Scada Historian";
units = "gpm"; // gallons per minute -- see Units.h for list of recognized units
},
{
name = "Tag 1 flow (regular)";
type = "Resampler";
source = "Scada_tag_1_flowrate";
clock = "1m";
units = "lps"; // liters per second
},
{
name = "Tag 1 flow (smooth)";
type = "MovingAverage";
source = "Tag 1 flow (regular)";
clock = "1m";
window = 10;
units = "lps";
},
{
name = "Scada_tag_2_tanklevel";
type = "TimeSeries";
description = "description of tag";
pointRecord = "Scada Historian";
units = "ft"; // feet -- see Units.h for list of recognized units
},
{
name = "Tag 2 level (regular)";
type = "Resampler";
clock = "1m";
source = "Scada_tag_2_tanklevel";
units = "m"; // meters
},
{
name = "Tag 2 level (smooth)";
type = "MovingAverage";
source = "Tag 2 level (regular)";
clock = "1m";
window = 10;
units = "m"; // meters
},
{
name = "Tag 2 volume";
type = "CurveFunction";
source = "Tag 2 level (smooth)";
clock = "1m";
units = "l"; // liters as output "y" units
inputUnits = "m"; // meters as units of "x" values below...
function = (
{x=0; y=0; },
{x=1; y=.5; },
{x=2; y=.8; },
{x=3; y=1; },
{x=4; y=1.2;}
)
},
{
name = "Tag 2 flow";
type = "Derivative";
source = "Tag 2 volume";
clock = "1m";
units = "lps";
},
{
name = "Area Demand";
type = "Aggregator";
units = "lps";
sources = (
{source = "Tag 2 flow"; multiplier = -1.0; }, // flow "in" to a tank is "out" of the area
{source = "Tag 1 flow (smooth)"; multiplier = 1.0; }
);
},
{
name = "MultiplierTS";
type = "Multiplier";
units = "mgd";
source = "Area Demand";
multiplier = "Tag 2 flow"; // basis for multiplication
},
{
name = "Valid Range Test";
type = "ValidRange";
units = "lps";
source = "Tag 2 flow";
range_min = -1;
range_max = 1;
mode = "drop"; // or "saturate"
}
{
name = "RuntimeStatusTS";
type = "RuntimeStatus";
source = "Pump_1_Runtime";
thresholdValue = 60.0; // seconds
}
); // timeseries
model = {
file = "modelFile.inp";
type = "epanet";
}; // model
elements = (
{
model_id = "model_pump";
timeseries = "Pump Status TS";
parameter = "pumpstatus";
},
{
model_id = "model_tank";
timeseries = "Tag 2 level (smooth)";
parameter = "tanklevel";
},
{
model_id = "model_plant_source_node";
timeseries = "Tag 1 flow (smooth)";
parameter = "boundaryflow";
}
); // elements
// parameters (measurements): pressuremeasure / headmeasure / levelmeasure / quality / flow / energy
// parameters (boundaries): boundaryflow / boundaryhead / status / setting / qualitysource
# simulation properties
simulation = {
time = {
hydraulic = 600; // 10m
quality = 60; // 1m
};
}; // simulation
save = {
staterecord = "sampletown_realtime";
save_states = ( "measured", "dma_demand" );
/* states == all / head / flow / quality / energy / demand / dma_demand / status / setting / error / measured*/
};
dma = {
auto_detect = true;
detect_closed_links = true;
}; // dma
}; // configuration