-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Turbine and HydropowerDam nodes #107
Comments
I cna start looking at implementing the
|
Yes, the schema node will create a We should also add I think this where we'll benefit from having the power functions split out as simple functions. They will be used by |
I am still trying to get my head around metrics and how they are handled. What if I create something like this: impl TurbineNode {
...
pub fn set_constraints(
&self,
network: &mut pywr_core::network::Network,
schema: &crate::model::PywrNetwork,
domain: &ModelDomain,
tables: &LoadedTableCollection,
data_path: Option<&Path>,
inter_network_transfers: &[PywrMultiNetworkTransfer],
) -> Result<(), SchemaError> {
if let Some(cost) = &self.cost {
let value = cost.load(network, schema, domain, tables, data_path, inter_network_transfers)?;
network.set_node_cost(self.meta.name.as_str(), None, value.into())?;
}
if let Some(target) = &self.target {
let name = format!("{}-power", self.meta.name.as_str());
let p = pywr_core::parameters::HydropowerTargetParameter::new(
&name,
target,
&self.water_elevation,
&self.turbine_elevation,
&self.min_head,
&self.max_flow,
&self.min_flow,
&self.efficiency,
&self.water_density,
&self.flow_unit_conversion,
&self.energy_unit_conversion,
);
let power_idx = network.add_parameter(Box::new(p))?;
let metric = Metric::ParameterValue(power_idx);
network.set_node_max_flow(self.meta.name.as_str(), None, metric.clone().into())?;
}
Ok(())
}
} Wouldn't it make more sense to have a |
Yes, this looks good. This opens an issue about parameter names. I would like to eventually remove the need for making up names like this. @Batch21 has come across a similar issue in #99 . I suggest we leave it as is now, but put a Re the derived metric. Won't it be |
One of the purposes of this version is to allow the design of more useful high level nodes. To that end, and related to #105 , are the implementation of Turbine and HydropowerDam nodes.
Here are some pseudo schemas before writing the actual implementation.
The text was updated successfully, but these errors were encountered: