allow constructing SpiralICD from variables
also make it default constructible and add equality operator
This commit is contained in:
@@ -39,7 +39,19 @@ namespace Opm {
|
||||
SHUT
|
||||
};
|
||||
|
||||
SpiralICD();
|
||||
explicit SpiralICD(const DeckRecord& record);
|
||||
SpiralICD(double strength,
|
||||
double length,
|
||||
double densityCalibration,
|
||||
double viscosityCalibration,
|
||||
double criticalValue,
|
||||
double widthTransitionRegion,
|
||||
double maxViscosityRatio,
|
||||
int methodFlowScaling,
|
||||
double maxAbsoluteRate,
|
||||
Status status,
|
||||
double scalingFactor);
|
||||
|
||||
// the function will return a map
|
||||
// [
|
||||
@@ -62,6 +74,8 @@ namespace Opm {
|
||||
void updateScalingFactor(const double segment_length, const double completion_length);
|
||||
double scalingFactor() const;
|
||||
|
||||
bool operator==(const SpiralICD& data) const;
|
||||
|
||||
private:
|
||||
double m_strength;
|
||||
double m_length;
|
||||
|
||||
@@ -28,6 +28,37 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
SpiralICD::SpiralICD()
|
||||
: SpiralICD(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, Status::SHUT, 1.0)
|
||||
{
|
||||
}
|
||||
|
||||
SpiralICD::SpiralICD(double strength,
|
||||
double length,
|
||||
double densityCalibration,
|
||||
double viscosityCalibration,
|
||||
double criticalValue,
|
||||
double widthTransitionRegion,
|
||||
double maxViscosityRatio,
|
||||
int flowScaling,
|
||||
double maxAbsoluteRate,
|
||||
Status status,
|
||||
double scalingFactor)
|
||||
: m_strength(strength),
|
||||
m_length(length),
|
||||
m_density_calibration(densityCalibration),
|
||||
m_viscosity_calibration(viscosityCalibration),
|
||||
m_critical_value(criticalValue),
|
||||
m_width_transition_region(widthTransitionRegion),
|
||||
m_max_viscosity_ratio(maxViscosityRatio),
|
||||
m_method_flow_scaling(flowScaling),
|
||||
m_max_absolute_rate(maxAbsoluteRate),
|
||||
m_status(status),
|
||||
m_scaling_factor(scalingFactor)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SpiralICD::SpiralICD(const DeckRecord& record)
|
||||
: m_strength(record.getItem("STRENGTH").getSIDouble(0)),
|
||||
m_length(record.getItem("LENGTH").getSIDouble(0)),
|
||||
@@ -154,4 +185,19 @@ namespace Opm {
|
||||
throw std::logic_error(" invalid method specified to calculate flow scaling factor for SICD");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SpiralICD::operator==(const SpiralICD& data) const {
|
||||
return this->strength() == data.strength() &&
|
||||
this->length() == data.length() &&
|
||||
this->densityCalibration() == data.densityCalibration() &&
|
||||
this->viscosityCalibration() == data.viscosityCalibration() &&
|
||||
this->criticalValue() == data.criticalValue() &&
|
||||
this->widthTransitionRegion() == data.widthTransitionRegion() &&
|
||||
this->maxViscosityRatio() == data.maxViscosityRatio() &&
|
||||
this->methodFlowScaling() == data.methodFlowScaling() &&
|
||||
this->maxAbsoluteRate() == data.maxAbsoluteRate() &&
|
||||
this->status() == data.status() &&
|
||||
this->scalingFactor() == data.scalingFactor();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user