[Transport] Make transport XML node optional

The default is equivalent to specifying <transport model="None">
This commit is contained in:
Ray Speth
2015-04-20 21:03:19 -04:00
parent a4ba47594c
commit 25953f94d4
2 changed files with 4 additions and 15 deletions

View File

@@ -269,19 +269,10 @@ Transport* TransportFactory::newTransport(const std::string& transportModel,
Transport* TransportFactory::newTransport(thermo_t* phase, int log_level)
{
XML_Node& phaseNode=phase->xml();
/*
* Find the Thermo XML node
*/
if (!phaseNode.hasChild("transport")) {
throw CanteraError("TransportFactory::newTransport",
"no transport XML node");
}
XML_Node& transportNode = phaseNode.child("transport");
std::string transportModel = transportNode.attrib("model");
if (transportModel == "") {
throw CanteraError("TransportFactory::newTransport",
"transport XML node doesn't have a model string");
std::string transportModel = "None";
XML_Node& phaseNode = phase->xml();
if (phaseNode.hasChild("transport")) {
transportModel = phaseNode.child("transport").attrib("model");
}
return newTransport(transportModel, phase,log_level);
}

View File

@@ -13,7 +13,6 @@
</state>
<thermo model="IdealGas"/>
<kinetics model="GasKinetics"/>
<transport model="None"/>
</phase>
<!-- phase notair -->
@@ -28,7 +27,6 @@
<note>This phase contains no Argon.</note>
<thermo model="IdealGas"/>
<kinetics model="GasKinetics"/>
<transport model="None"/>
</phase>
<!-- species definitions -->