Skip to content

Commit

Permalink
(#90) unit test, code cleanup, new tuning helper spreadsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlharvey committed Jun 14, 2024
1 parent 402cd91 commit aad3c18
Show file tree
Hide file tree
Showing 13 changed files with 1,576 additions and 144 deletions.
Binary file not shown.
65 changes: 51 additions & 14 deletions aspects/electrical/SolarArray/GunnsElectPvString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,23 @@ const double GunnsElectPvCellEquivCircuit::mBoltzmannOverCharge = UnitConversion
////////////////////////////////////////////////////////////////////////////////////////////////////
GunnsElectPvCellEquivCircuit::GunnsElectPvCellEquivCircuit()
:
mIL(0.0),
mRsh(0.0),
mRs(0.0),
mNVt(0.0),
mI0(0.0),
mFillFactor(0.0),
mEfficiency(0.0),
mVoc(0.0),
mIsc(0.0),
mVmp(0.0),
mImp(0.0),
mPhotoFlux(0.0),
mIdeality(0.0),
mTemperature(0.0),
mCoeffDVocDT(0.0),
mCoeffDIscDT(0.0),
mSurfaceArea(0.0),
mName("")
{
clear();
Expand All @@ -193,13 +210,23 @@ GunnsElectPvCellEquivCircuit::~GunnsElectPvCellEquivCircuit()
GunnsElectPvCellEquivCircuit& GunnsElectPvCellEquivCircuit::operator =(const GunnsElectPvCellEquivCircuit& that)
{
if (&that != this) {
mIL = that.mIL;
mRsh = that.mRsh;
mRs = that.mRs;
mNVt = that.mNVt;
mI0 = that.mI0;
mFillFactor = that.mFillFactor;
mEfficiency = that.mEfficiency;
mIL = that.mIL;
mRsh = that.mRsh;
mRs = that.mRs;
mNVt = that.mNVt;
mI0 = that.mI0;
mFillFactor = that.mFillFactor;
mEfficiency = that.mEfficiency;
mVoc = that.mVoc;
mIsc = that.mIsc;
mVmp = that.mVmp;
mImp = that.mImp;
mPhotoFlux = that.mPhotoFlux;
mIdeality = that.mIdeality;
mTemperature = that.mTemperature;
mCoeffDVocDT = that.mCoeffDVocDT;
mCoeffDIscDT = that.mCoeffDIscDT;
mSurfaceArea = that.mSurfaceArea;
}
return *this;
}
Expand All @@ -210,13 +237,23 @@ GunnsElectPvCellEquivCircuit& GunnsElectPvCellEquivCircuit::operator =(const Gun
////////////////////////////////////////////////////////////////////////////////////////////////////
void GunnsElectPvCellEquivCircuit::clear()
{
mIL = 0.0;
mRsh = 0.0;
mRs = 0.0;
mNVt = 0.0;
mI0 = 0.0;
mFillFactor = 0.0;
mEfficiency = 0.0;
mIL = 0.0;
mRsh = 0.0;
mRs = 0.0;
mNVt = 0.0;
mI0 = 0.0;
mFillFactor = 0.0;
mEfficiency = 0.0;
mVoc = 0.0;
mIsc = 0.0;
mVmp = 0.0;
mImp = 0.0;
mPhotoFlux = 0.0;
mIdeality = 0.0;
mTemperature = 0.0;
mCoeffDVocDT = 0.0;
mCoeffDIscDT = 0.0;
mSurfaceArea = 0.0;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
17 changes: 5 additions & 12 deletions aspects/electrical/SolarArray/GunnsElectPvString.hh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ class GunnsElectPvCellEquivCircuit
/// @brief Initializes this Photovoltaic Cell Equivalent Circuit Properties.
virtual void initialize(const GunnsElectPvCellConfigData* configData, const std::string& name);
/// @brief Updates this Photovoltaic Cell Equivalent Circuit Properties.
virtual void update(const GunnsElectPvCellEquivCircuit* refCell, const double temperature, const double photoFlux);
virtual void update(const GunnsElectPvCellEquivCircuit* refCell, const double temperature,
const double photoFlux, const double degradation = 0.0);
/// @brief Computes remaining equivalent circuit properties after initialization or update.
virtual void derive();
/// @brief Returns the cell current at the given voltage.
Expand All @@ -138,8 +139,6 @@ class GunnsElectPvCellEquivCircuit

protected:
std::string mName; /**< (1) trick_chkpnt_io(**) Instance name for H&S messages. */
/// @brief Validates the initialization of this Photovoltaic Cell Equivalent Circuit Properties.
virtual void validate() const;

private:
/// @brief Copy constructor unavailable since declared private and not implemented.
Expand Down Expand Up @@ -398,12 +397,14 @@ inline void GunnsElectPvCellEquivCircuit::initialize(const GunnsElectPvCellConfi
/// @param[in] refCell (--) Not used.
/// @param[in] temperature (--) Not used.
/// @param[in] photoFlux (--) Not used.
/// @param[in] degradation (--) Not used.
///
/// @details This is an empty virtual method intended for override by derived classes.
////////////////////////////////////////////////////////////////////////////////////////////////////
inline void GunnsElectPvCellEquivCircuit::update(const GunnsElectPvCellEquivCircuit* refCell __attribute__((unused)),
const double temperature __attribute__((unused)),
const double photoFlux __attribute__((unused)))
const double photoFlux __attribute__((unused)),
const double degradation __attribute__((unused)))
{
// nothing to do
}
Expand Down Expand Up @@ -440,14 +441,6 @@ inline double GunnsElectPvCellEquivCircuit::computeVoltage(const double current
return 0.0;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details This is an empty virtual method intended for override by derived classes.
////////////////////////////////////////////////////////////////////////////////////////////////////
inline void GunnsElectPvCellEquivCircuit::validate() const
{
// nothing to do
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] flag (--) Malfunction activation flag.
/// @param[in] magnitude (W/m2) Malfunction magnitude.
Expand Down
Loading

0 comments on commit aad3c18

Please sign in to comment.