Skip to content
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

New Wind Features 2024 #1186

Merged
merged 31 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
94b1b1c
add wake model enum for clarity
janinefreeman Feb 29, 2024
7e3082e
add timeseries and additional annual wake loss outputs to the wind mo…
janinefreeman Feb 29, 2024
927bbf2
updated some annual energy outputs in wind model, fixes #1143
janinefreeman Mar 2, 2024
6b3eeb3
Merge branch 'develop' into wind2024updates
janinefreeman Mar 6, 2024
52e941c
update annual wake loss outputs in wind model to be more clear and pr…
janinefreeman Mar 6, 2024
3e2b820
update wind tests for new wake loss output names
janinefreeman Mar 6, 2024
beab282
added optional wake decay constant for park wake model in wind model …
janinefreeman Mar 14, 2024
2cd6462
Merge branch 'develop' into wind2024updates
janinefreeman Mar 14, 2024
e0abe34
added optional wake loss multiplier input to wind model
janinefreeman Mar 14, 2024
fc8c310
added a new wind test for the wake model loss multiplier
janinefreeman Mar 14, 2024
a0958b1
added optional coefficient of thrust curve input to cmod_windpower fo…
janinefreeman Mar 28, 2024
7dcbd75
Merge branch 'develop' into wind2024updates
janinefreeman Mar 28, 2024
1aeaa7f
change implementation of optional user-defined thrust coefficient cur…
janinefreeman Mar 29, 2024
93b5771
added functionality to overwrite calculated coefficient of thrust wit…
janinefreeman Mar 29, 2024
762f489
modified where coefficient of thrust is initialized
janinefreeman Apr 3, 2024
419458a
updated ctcurve initialization
janinefreeman Apr 4, 2024
b67c957
Merge branch 'develop' into wind2024updates
janinefreeman Apr 4, 2024
a3393f5
add check for power curve existence in thrust curve set function and …
janinefreeman Apr 4, 2024
b583981
added a test for the thrust curve input to wind compute module, still…
janinefreeman Apr 4, 2024
aa4f910
updated wind test
janinefreeman Apr 5, 2024
4d77818
fixed variable ingestion of ct curve in wind cmod and updated thrust …
janinefreeman Apr 11, 2024
4b83850
Merge branch 'develop' into wind2024updates
janinefreeman Apr 11, 2024
6fb0126
Merge branch 'develop' into wind2024updates
janinefreeman Jul 21, 2024
e1289c0
added icing loss persistence input to allow icing loss to last for mo…
janinefreeman Jul 21, 2024
798cb1d
added test for icing persistence
janinefreeman Jul 30, 2024
aa242bf
Merge branch 'develop' into wind2024updates
janinefreeman Oct 4, 2024
26c584c
added error if ct curve setting fails
janinefreeman Oct 4, 2024
90fe1c8
Merge branch 'develop' into wind2024updates
janinefreeman Oct 12, 2024
83a96ab
updated wind model to disallow wake loss multiplier with constant wak…
janinefreeman Oct 12, 2024
6b70a2d
add wake loss multiplier code to wind speed x direction distribution …
janinefreeman Oct 15, 2024
27b57fa
Merge branch 'develop' into wind2024updates
janinefreeman Oct 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions shared/lib_windwakemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ bool windTurbine::setPowerCurve(std::vector<double> windSpeeds, std::vector<doub
return 1;
}

bool windTurbine::setCtCurve(std::vector<double> thrustCoeffCurve)
{
if (powerCurveWS.empty())
{
errDetails = "Power curve must be set before thrust curve.";
return 0;
}
if (thrustCoeffCurve.size() != powerCurveWS.size())
{
errDetails = "Coefficient of thrust curve must have the same number of values as the power curve wind speeds";
return 0;
}
ctCurve.resize(thrustCoeffCurve.size());
ctCurve = thrustCoeffCurve;
return 1;
}

double windTurbine::tipSpeedRatio(double windSpeed)
{
if (powerCurveRPM[0] == -1) return 7.0;
Expand Down Expand Up @@ -104,9 +121,9 @@ void windTurbine::turbinePower(double windVelocity, double airDensity, double *t

// Find power from turbine power curve
double out_pwr = 0.0;
int j = 1; // an index for the correct wind speed in the power curve for interpolations
if ((windVelocity > densityCorrectedWS[0]) && (windVelocity < densityCorrectedWS[powerCurveArrayLength - 1]))
{
int j = 1;
while (densityCorrectedWS[j] <= windVelocity)
j++; // find first m_adPowerCurveWS > windVelocity

Expand All @@ -132,6 +149,16 @@ void windTurbine::turbinePower(double windVelocity, double airDensity, double *t
*turbineOutput = out_pwr;
if (fPowerCoefficient >= 0.0)
*thrustCoefficient = max_of(0.0, -1.453989e-2 + 1.473506*fPowerCoefficient - 2.330823*pow(fPowerCoefficient, 2) + 3.885123*pow(fPowerCoefficient, 3));

// overwrite the coefficient of thrust if it has been specified by the user
// if it has not been specified by the user, the thrust curve vector is {0.}
if (ctCurve.size() != 1)
{
//interpolate to right value of Ct based on wind speed, like for power curve
//can use the same index for the wind speed array that was determined above
*thrustCoefficient = util::interpolate(densityCorrectedWS[j - 1], ctCurve[j - 1], densityCorrectedWS[j], ctCurve[j], windVelocity);
}

} // out_pwr > (rated power * 0.001)

return;
Expand Down Expand Up @@ -214,7 +241,7 @@ double parkWakeModel::delta_V_Park(double Uo, double Ui, double distCrosswind, d
// bound the coeff of thrust
double Ct = max_of(min_of(0.999, dThrustCoeff), minThrustCoeff);

double k = wakeDecayCoefficient;
double k = wakeDecayConstant;

double dRadiusOfWake = dRadiusUpstream + (k * distDownwind); // radius of circle formed by wake from upwind rotor
double dAreaOverlap = circle_overlap(distCrosswind, dRadiusDownstream, dRadiusOfWake);
Expand Down
23 changes: 16 additions & 7 deletions shared/lib_windwakemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
class windTurbine
{
private:
std::vector<double> powerCurveWS, // windspeed: x-axis on turbine power curve
powerCurveKW, // power output: y-axis
densityCorrectedWS,
powerCurveRPM;
std::vector<double> powerCurveWS, // windspeed: x-axis on turbine power curve
powerCurveKW, // power output: y-axis
densityCorrectedWS,
powerCurveRPM,
ctCurve; // vector that stores the optional coefficient of thrust curve input
double cutInSpeed;
double previousAirDensity;
public:
Expand All @@ -68,8 +69,10 @@ class windTurbine
hubHeight = -999;
rotorDiameter = -999;
previousAirDensity = physics::AIR_DENSITY_SEA_LEVEL;
ctCurve = { 0.0 }; // set to a default value of length 1 to mean that it's not assigned, and check for that length before using it
}
bool setPowerCurve(std::vector<double> windSpeeds, std::vector<double> powerOutput);
bool setCtCurve(std::vector<double> thrustCoeffCurve);

double tipSpeedRatio(double windSpeed);

Expand Down Expand Up @@ -151,17 +154,23 @@ class simpleWakeModel : public wakeModelBase{
class parkWakeModel : public wakeModelBase{
private:
double rotorDiameter;
double wakeDecayCoefficient = 0.07,
double wakeDecayConstant = 0.07,
minThrustCoeff = 0.02;
double delta_V_Park(double dVelFreeStream, double dVelUpwind, double dDistCrossWind, double dDistDownWind, double dRadiusUpstream, double dRadiusDownstream, double dThrustCoeff);
double circle_overlap(double dist_center_to_center, double rad1, double rad2);

public:
parkWakeModel(){ nTurbines = 0; }
parkWakeModel(size_t numberOfTurbinesInFarm, windTurbine* wt){ nTurbines = numberOfTurbinesInFarm; wTurbine = wt; }
parkWakeModel(size_t numberOfTurbinesInFarm, windTurbine* wt, double wdc)
{
nTurbines = numberOfTurbinesInFarm;
wTurbine = wt;
setWakeDecayConstant(wdc);
}
virtual ~parkWakeModel() {};
std::string getModelName() override { return "Park"; }
void setRotorDiameter(double d){ rotorDiameter = d; }
void setWakeDecayConstant(double w) { wakeDecayConstant = w; }
void wakeCalculations(
/*INPUTS*/
const double airDensity, // not used in this model
Expand Down Expand Up @@ -302,4 +311,4 @@ class constantWakeModel : public wakeModelBase
) override;
};

#endif
#endif
Loading