Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- assets/lua/application.lua
- +++ assets/lua/application.lua
- @@ -35,6 +35,8 @@ function Application.getNameTranslated(application)
- return ltr("Application","Electric and Magnetic Fields")
- elseif application == Application.PLSCADDTools then
- return ltr("Application","PLS-CADD Tools")
- + elseif application == Application.WindPressure then
- + return ltr("Application","Wind Pressure")
- elseif application == Application.Last then
- return ltr("Application","Transmission Line")
- else
- --- assets/lua/const.lua
- +++ assets/lua/const.lua
- @@ -24,6 +24,7 @@ Application.Test = "Test"
- Application.ThermalRating = "ThermalRating"
- Application.DP_ElectricMagneticFields = "ElectricMagneticFields"
- Application.PLSCADDTools = "PLSCADDTools"
- +Application.WindPressure = "WindPressure"
- Application.Last = "TransmissionLines"
- PipelineType = {}
- --- assets/reports/project.lhtml
- +++ assets/reports/project.lhtml
- @@ -64,3 +64,7 @@
- <? if config.applicationName == Application.SagTensionSubstation then ?>
- <?= include('substations/sagtensionsubstation', { margin = margin }) ?>
- <? end ?>
- +
- +<? if config.applicationName == Application.WindPressure then ?>
- + <?= include('transmissionlines/windpressure', { margin = margin }) ?>
- +<? end ?>
- --- src/core/applications/windpressure.cpp
- +++ src/core/applications/windpressure.cpp
- @@ -1,4 +1,16 @@
- #include "windpressure.h"
- +#include "project.h"
- +#include "transmissionline.h"
- +#include "util/tmath.h"
- +#include "cablesag.h"
- +#include "sagtension.h"
- +#include "core/database.h"
- +#include <QDebug>
- +
- +// References
- +// [1] Coletânia de normas de linhas de transmissão
- +
- +// [2] Norma IEC60826
- WindPressure::WindPressure(Project *project) :
- Application(project)
- @@ -19,3 +31,230 @@ WindPressure::WindPressure(Project *project) :
- m_modules[Module_TransmissionLineStructureDistances] = true;
- m_modules[Module_TransmissionLineFinalSags] = true;
- }
- +
- +bool WindPressure::calculate(QString &error)
- +{
- + for(TransmissionLinePtr tl : m_project->getTransmissionLines()) {
- + if(tl->isIgnored())
- + continue;
- +
- +
- + double windTemperature = tl->getWindTemperature();
- + double minimumAltitude = tl->getMinimumAltitude();
- + double airDensity = 1.293/(1+0.00367 * windTemperature)*(16000+64 * windTemperature - minimumAltitude)/(16000+64 * windTemperature + minimumAltitude);
- + tl->setAirDensity(airDensity);
- +
- + // Uses reference [1].
- + // Page 11
- + // 8.2.1 Pressão dinâmica de referência
- +
- + // Uses reference [2]
- + // Page 28
- + // 6.2.8 Unit action of the wind speed on any line component or element
- + double Kr = tl->getKr();
- + double extremeWindSpeed = tl->getExtremeWindSpeed();
- + double windPressure = 0.5 * airDensity * std::pow((Kr * extremeWindSpeed/3.6), 2)/math::g;
- + tl->setWindPressure(windPressure);
- +
- + if(true/*tl->getFinalSagAtAverageTemperatureText().isEmpty()*/) {
- +
- + // SagTension sagTension(m_project);
- + SagTension *sagTension = new SagTension(m_project);
- +
- + double finalSagAT = tl->getClearance() * 1.5; // AT = averageTemperature; chute inicial
- + double finalSagOT = tl->getClearance() * 1.5; // OT = operatingTemperature
- +
- + QString minimumTemperature = tl->getMinimumTemperatureText();
- + QString windTemperature = tl->getWindTemperatureText();
- + QString averageTemperature = tl->getAverageTemperatureText();
- + QString towerWindSpan = tl->getTowerWindSpanText();
- + //QString operatingTemperature =... checkHere!! QString tl->getOper operating temperature???/
- +
- + for(int i = 0; i < 1; i++) {// fazer condição de parada
- + double Pv = calculatePv(tl, 22.77, 24.42, (0.85 * 22.77), windPressure, Conductor);
- +// qDebug() << Pv;
- + CableSag *cableSag = new CableSag(tl);
- + QVector<CableCondition*>& governigConditions = cableSag->getGovernmentConditions();
- +
- + CableCondition* tempMin = new CableCondition();
- + tempMin->setTemperature(minimumTemperature);
- + tempMin->setWindPressure("0");
- + tempMin->setUltimateLoading("33");
- + tempMin->setLoadingCondition(CableCondition::Initial);
- + governigConditions.append(tempMin);
- +
- + CableCondition* extremeWind = new CableCondition();
- + extremeWind->setTemperature(windTemperature);
- + extremeWind->setWindPressure(QString::number(Pv));
- + extremeWind->setUltimateLoading("70");
- + extremeWind->setLoadingCondition(CableCondition::Final);
- + governigConditions.append(extremeWind);
- +
- + CableCondition* eds = new CableCondition();
- + eds->setTemperature(averageTemperature);
- + eds->setWindPressure("0");
- + eds->setUltimateLoading("20");
- + eds->setLoadingCondition(CableCondition::Final);
- + governigConditions.append(eds);
- +
- + CableCondition* creep = new CableCondition();
- + creep->setTemperature(averageTemperature);
- + creep->setWindPressure("0");
- + creep->setUltimateLoading("0");
- + creep->setLoadingCondition(CableCondition::Final);
- + governigConditions.append(creep);
- +
- +
- + QVector<CableCondition*>& loadingConditions = cableSag->getLoadings();
- +
- + CableCondition* loading = new CableCondition();
- + loading->setTemperature("60");//checkHere!!!!!! esse valor é uma variavel de entrada operating temperature
- + loading->setWindPressure("0");
- + loadingConditions.append(loading);
- +
- + QVector<QString>& spans = cableSag->getSpans();
- + spans.append(towerWindSpan);
- +
- + cableSag->setCableType(g_database->getCableByCode(CableCategory_Conductor, "CAL 1120 - 1055 kCM"));
- + sagTension->fleteiCalculate(cableSag, error);
- + qDebug() << cableSag->getGovernmentConditions().at(cableSag->getGovernmentConditions().size() - 1)->getTemperature();
- + qDebug() << cableSag->getGovernmentConditions().at(cableSag->getGovernmentConditions().size() - 1)->getConditionSag()[towerWindSpan].finalSag;
- +
- + qDebug() << cableSag->getLoadings().at(cableSag->getLoadings().size() - 1)->getTemperature();
- + qDebug() << cableSag->getLoadings().at(cableSag->getLoadings().size() - 1)->getConditionSag()[towerWindSpan].finalSag;
- + }
- +
- +
- + }
- +
- + double finalSagSW = tl->getFinalSagAtAverageTemperature() * 0.85;//0.85 variável ou constante?
- + tl->setFinalSagSW(finalSagSW);
- + }
- + return true;
- +}
- +
- +double WindPressure::calculatePv(TransmissionLinePtr tl, double finalSagAT, double finalSagOT, double finalSagSW, double windPressure, StructurePart part)
- +{
- + //BASEADO NA PLANILHA DO EXCEL
- + TerrainCategory terrainCategory = tl->getTerrainCategory();
- + double averageSpan = tl->getAverageSpan();
- + double averageHeight = calculateAverageHeight(tl, finalSagAT, finalSagOT, finalSagSW, part);
- + double Pv, Cxc, Cxi, Gc, Gl, Gt;
- + switch(part){
- + case Conductor:
- + Cxc = 1;
- + Gc = calculateGc(averageHeight, terrainCategory);
- + Gl = calculateGl(averageSpan);
- + Pv = Cxc * Gc * Gl * windPressure;
- + break;
- + case ShieldWire:
- + Cxc = 1;
- + Gc = calculateGc(averageHeight, terrainCategory);
- + Gl = calculateGl(averageSpan);
- + Pv = Cxc * Gc * Gl * windPressure;
- + break;
- + case InsulatorString:
- + Cxi = 1.2;
- + Gt = calculateGt(averageHeight, terrainCategory);
- + Pv = Cxi * Gt * windPressure;
- + break;
- + }
- + return Pv;
- +}
- +
- +double WindPressure::calculateAverageHeight(TransmissionLinePtr tl, double finalSagAT, double finalSagOT, double finalSagSW, StructurePart part)
- +{
- + double averageHeight;
- + double clearance = tl->getClearance();
- + double distanceConductorInfSup = tl->getDistanceConductorInfSup();
- + double distanceConductorSW = tl->getDistanceConductorSW();
- + double insulatorStringLength = tl->getInsulatorStringLength();
- + switch(part){
- + case Conductor:
- + averageHeight = clearance+finalSagOT-2*finalSagAT/3+distanceConductorInfSup;
- + break;
- + case ShieldWire:
- + averageHeight = finalSagOT+distanceConductorSW+clearance-2./3.*finalSagSW+distanceConductorInfSup;
- + break;
- + case InsulatorString:
- + averageHeight = clearance+finalSagOT+insulatorStringLength/2+distanceConductorInfSup;
- + break;
- + }
- +
- + return averageHeight;
- +}
- +
- +double WindPressure::calculateGc(double averageHeight, TerrainCategory terrainCategory)
- +{
- + double Gc;
- + switch(terrainCategory) {
- + case TerrainCategory_A:
- + if(averageHeight <= 16)
- + Gc = 1.72+0.0267*(averageHeight-10);
- + else
- + Gc = 1.88+0.60624*std::log10(averageHeight/16);
- + break;
- + case TerrainCategory_B:
- + if(averageHeight <= 16)
- + Gc = 1.85+0.0267*(averageHeight-10);
- + else
- + Gc = 2.01+0.85361*std::log10(averageHeight/16);
- + break;
- + case TerrainCategory_C:
- + if(averageHeight <= 16)
- + Gc = 2.06+0.0367*(averageHeight-10);
- + else
- + Gc = 2.28+1.14105*std::log10(averageHeight/16);
- + break;
- + case TerrainCategory_D:
- + if(averageHeight <= 16)
- + Gc = 2.24+0.05*(averageHeight-10);
- + else
- + Gc = 2.54+1.36752*std::log10(averageHeight/16);
- + break;
- + }
- + return Gc;
- +}
- +
- +double WindPressure::calculateGt(double averageHeight, TerrainCategory terrainCategory)
- +{
- + double Gt;
- + switch(terrainCategory) {
- + case TerrainCategory_A:
- + if(averageHeight <= 35)
- + Gt = 1.7+0.68006*std::log10(averageHeight/10);
- + else
- + Gt = 2.07+0.0072*(averageHeight-35);
- + break;
- + case TerrainCategory_B:
- + if(averageHeight <= 35)
- + Gt = 1.9+0.88224*std::log10(averageHeight/10);
- + else
- + Gt = 2.38+0.0088*(averageHeight-35);
- + break;
- + case TerrainCategory_C:
- + if(averageHeight <= 30)
- + Gt = 2.55+0.94316*std::log10(averageHeight/10);
- + else
- + Gt = 3+0.01*(averageHeight-30);
- + break;
- + case TerrainCategory_D:
- + if(averageHeight <= 40)
- + Gt = 3.3+0.02833*(averageHeight-10);
- + else
- + Gt = 4.15+0.0175*(averageHeight-40);
- + break;
- + }
- +
- + return Gt;
- +}
- +
- +double WindPressure::calculateGl(double averageSpan)
- +{
- + double Gl;
- + if(averageSpan <= 560)
- + Gl = -0.1/(560-200)*averageSpan+1.0556;
- + else
- + Gl = 0.9-((averageSpan-560)*0.000175);
- + return Gl;
- +}
- --- src/core/applications/windpressure.h
- +++ src/core/applications/windpressure.h
- @@ -2,6 +2,7 @@
- #define WINDPRESSURE_H
- #include "application.h"
- +#include "cablesag.h"
- class WindPressure : public Application
- {
- @@ -9,6 +10,21 @@ public:
- WindPressure(Project *project);
- ApplicationName getName() { return App_WindPressure; }
- +
- + bool calculate(QString &error);
- +
- +private:
- + enum StructurePart {
- + Conductor = 0,
- + ShieldWire,
- + InsulatorString,
- + };
- +
- + double calculatePv(TransmissionLinePtr tl, double finalSagAT, double finalSagOT, double finalSagSW, double windPressure, StructurePart part);
- + double calculateAverageHeight(TransmissionLinePtr tl, double finalSagAT, double finalSagOT, double finalSagSW, StructurePart part);
- + double calculateGc(double averageHeight, TerrainCategory terrainCategory);
- + double calculateGt(double averageHeight, TerrainCategory terrainCategory);
- + double calculateGl(double averageSpan);
- };
- #endif // WINDPRESSURE_H
- --- src/core/cablesag.cpp
- +++ src/core/cablesag.cpp
- @@ -75,7 +75,7 @@ void CableCondition::save(QSettings *settings, bool saveTemporary)
- }
- }
- -CableSag::CableSag(TransmissionLine *transmissionLine)
- +CableSag::CableSag(TransmissionLineWeakPtr transmissionLine)
- {
- m_transmissionLine = transmissionLine;
- }
- @@ -215,6 +215,6 @@ bool CableSag::moveSpans(int fromIndex, int toIndex)
- QString CableSag::getErrorLocation()
- {
- if(CableTypePtr cable = getCableType())
- - return "\n" + QObject::tr("Cable: ") + cable->getCode() + "\n" + QObject::tr("Transmission Line: ") + m_transmissionLine->getName();
- - return "\n" + QObject::tr("Transmission Line: ") + m_transmissionLine->getName();
- + return "\n" + QObject::tr("Cable: ") + cable->getCode() + "\n" + QObject::tr("Transmission Line: ") + m_transmissionLine.lock()->getName();
- + return "\n" + QObject::tr("Transmission Line: ") + m_transmissionLine.lock()->getName();
- }
- --- src/core/cablesag.h
- +++ src/core/cablesag.h
- @@ -62,6 +62,7 @@ public:
- QString getWindPressure() { return m_windPressure; }
- QString getUltimateLoading() { return m_ultimateLoading; }
- QMap<QString, CableConditionResult> getSagResults() { return m_sagResults; }
- + QMap<QString, CableConditionSag> getConditionSag() { return m_sags; }
- LoadingCondition getLoadingCondition() { return m_loadingCondition; }
- private:
- @@ -84,7 +85,7 @@ private:
- class CableSag
- {
- public:
- - explicit CableSag(TransmissionLine *transmissionLine);
- + explicit CableSag(TransmissionLineWeakPtr transmissionLine);
- void load(QSettings *settings);
- void save(QSettings *settings, bool saveTemporary);
- @@ -104,7 +105,7 @@ public:
- QString getSpan(int index);
- QVector<QString>& getSpans() { return m_spans; }
- bool moveSpans(int fromIndex, int toIndex);
- - TransmissionLine *getTransmissionLine() { return m_transmissionLine; }
- + TransmissionLineWeakPtr getTransmissionLine() { return m_transmissionLine; }
- private:
- QString getErrorLocation();
- @@ -113,7 +114,7 @@ private:
- QVector<CableCondition*> m_governingConditions;
- QVector<CableCondition*> m_loadings;
- QVector<QString> m_spans;
- - TransmissionLine *m_transmissionLine;
- + TransmissionLineWeakPtr m_transmissionLine;
- // Cache
- QMap<QString, bool> m_hasFinalWithCreep;
- --- src/core/transmissionline.cpp
- +++ src/core/transmissionline.cpp
- @@ -161,7 +161,7 @@ void TransmissionLine::load(QSettings *settings)
- removeCableSags();
- for(const QString& group : settings->childGroups()) {
- settings->beginGroup(group);
- - CableSag *c = new CableSag(this);
- + CableSag *c = new CableSag(shared_from_this());
- c->load(settings);
- m_cableSags.push_back(c);
- settings->endGroup();
- @@ -320,6 +320,9 @@ void TransmissionLine::save(QSettings *settings, bool saveTemporary)
- settings->setValue("dischargeRiskFailure", m_dischargeRiskFailure);
- settings->setValue("spanFlashShutdownsPerYear", m_spanFlashShutdownsPerYear);
- settings->setValue("structureFlashShutdownsPerYear", m_structureFlashShutdownsPerYear);
- + settings->setValue("finalSagSW", m_finalSagSW);
- + settings->setValue("airDensity", m_airDensity);
- + settings->setValue("windPressure", m_windPressure);
- settings->setValue("circuitsValid", m_circuitsValid);
- settings->setValue("shieldWiresValid", m_shieldWiresValid);
- Settings::saveMatrix(settings, "longitudinalPhaseMatrixWithShieldWires", m_longitudinalPhaseMatrixWithShieldWires);
- @@ -549,6 +552,8 @@ bool TransmissionLine::validate(QString& error)
- }
- }
- +// checkHere fazer as validações
- +
- return true;
- }
- @@ -1046,7 +1051,7 @@ CableSag *TransmissionLine::addCableSag(int index, bool clone)
- if(index >= 0 && index < m_cableSags.size() && clone)
- cableSag = m_cableSags[index]->clone();
- else
- - cableSag = new CableSag(this);
- + cableSag = new CableSag(shared_from_this());
- if(index >= 0 && index < m_cableSags.size())
- m_cableSags.insert(index, cableSag);
- @@ -1205,6 +1210,20 @@ double TransmissionLine::getAverageSoilResistivity()
- return soilResistivity / count;
- }
- +double TransmissionLine::getKr() //based on page 26
- +{
- + switch(m_terrainCategory){
- + case TerrainCategory_A:
- + return 1.08;
- + case TerrainCategory_B:
- + return 1;
- + case TerrainCategory_C:
- + return 0.85;
- + case TerrainCategory_D:
- + return 0.67;
- + }
- +}
- +
- void TransmissionLine::removeFaultLocations()
- {
- for(TransmissionLineFaultLocation *faultLocation : m_faultLocations)
- --- src/core/transmissionline.h
- +++ src/core/transmissionline.h
- @@ -131,6 +131,9 @@ public:
- void setDistanceConductorSW(const QString& distanceConductorSW) { m_distanceConductorSW = distanceConductorSW; }
- void setFinalSagAtOperationTemperature(const QString& finalSagAtOperatingTemperature) { m_finalSagAtOperatingTemperature = finalSagAtOperatingTemperature; }
- void setFinalSagAtAverageTemperature(const QString& finalSagAtAverageTemperature) { m_finalSagAtAverageTemperature = finalSagAtAverageTemperature; }
- + void setFinalSagSW(double finalSagSW) { m_finalSagSW = finalSagSW; }
- + void setAirDensity(double airDensity) { m_airDensity = airDensity; }
- + void setWindPressure(double windPressure) { m_windPressure = windPressure; }
- void setAverageElevation(const QString& elevation);
- void setAverageGroundResistance(const QString& groundResistance);
- @@ -203,6 +206,7 @@ public:
- QString getFinalSagAtOperatingTemperatureText() const { return m_finalSagAtOperatingTemperature; }
- double getFinalSagAtAverageTemperature() const { return m_finalSagAtAverageTemperature.toDouble(); }
- QString getFinalSagAtAverageTemperatureText() const { return m_finalSagAtAverageTemperature; }
- + double getKr(); //coeficiente de rugosidade Kr. Descreve a ação do vento de acordo com o terreno.
- double getAverageElevation();
- double getAverageGroundResistance();
- @@ -307,6 +311,10 @@ private:
- double m_dischargesPerYear;
- double m_dischargeRiskFailure;
- + double m_finalSagSW;
- + double m_airDensity;
- + double m_windPressure;
- +
- friend class AtmosphericDischarges;
- friend class CurrentDistribuition;
- friend class ElectricParameters;
- --- src/util/tmath.h
- +++ src/util/tmath.h
- @@ -25,6 +25,7 @@ const double feet_to_meter = 0.3048;
- const double c = 299792458; // speed of light
- const double u0 = 4 * math::pi * 1E-07; // vaccum permeability
- const double e0 = 8.854187817E-12; // vaccum permittivity
- +const double g = 9.80665; // gravitational acceleration
- const double speedOfSound = 343.2; // m/s at 20C dry air
- const double airDensity = 1.225; // kg/m^3 at 15C, 1atm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement