mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 15:09:19 +02:00
Added torque converter and diesel engine momentum interpolation by table
This commit is contained in:
@@ -1110,6 +1110,7 @@ public:
|
|||||||
double dizel_Mnmax = 2.0;
|
double dizel_Mnmax = 2.0;
|
||||||
double dizel_nmax = 2.0;
|
double dizel_nmax = 2.0;
|
||||||
double dizel_nominalfill = 0.0;
|
double dizel_nominalfill = 0.0;
|
||||||
|
std::map<double, double> dizel_Momentum_Table;
|
||||||
/*parametry aproksymacji silnika spalinowego*/
|
/*parametry aproksymacji silnika spalinowego*/
|
||||||
double dizel_Mstand = 0.0; /*moment oporow ruchu silnika dla enrot=0*/
|
double dizel_Mstand = 0.0; /*moment oporow ruchu silnika dla enrot=0*/
|
||||||
/* dizel_auto_min, dizel_auto_max: real; {predkosc obrotowa przelaczania automatycznej skrzyni biegow*/
|
/* dizel_auto_min, dizel_auto_max: real; {predkosc obrotowa przelaczania automatycznej skrzyni biegow*/
|
||||||
@@ -1142,6 +1143,7 @@ public:
|
|||||||
double hydro_TC_TorqueOutOut = 0.0; /*stala momentu proporcjonalnego do kwadratu obrotow wyjsciowych*/
|
double hydro_TC_TorqueOutOut = 0.0; /*stala momentu proporcjonalnego do kwadratu obrotow wyjsciowych*/
|
||||||
double hydro_TC_LockupSpeed = 1.0; /*prog predkosci zalaczania sprzegla blokujacego*/
|
double hydro_TC_LockupSpeed = 1.0; /*prog predkosci zalaczania sprzegla blokujacego*/
|
||||||
double hydro_TC_UnlockSpeed = 1.0; /*prog predkosci rozlaczania sprzegla blokujacego*/
|
double hydro_TC_UnlockSpeed = 1.0; /*prog predkosci rozlaczania sprzegla blokujacego*/
|
||||||
|
std::map<double, double> hydro_TC_Table; /*tablica przetwornika momentu*/
|
||||||
/*parametry retardera*/
|
/*parametry retardera*/
|
||||||
bool hydro_R = false; /*obecnosc retardera*/
|
bool hydro_R = false; /*obecnosc retardera*/
|
||||||
int hydro_R_Placement = 0; /*umiejscowienie retardera: 0 - za skrzynia biegow, 1 - miedzy przetwornikiem a biegami, 2 - przed skrzynia biegow */
|
int hydro_R_Placement = 0; /*umiejscowienie retardera: 0 - za skrzynia biegow, 1 - miedzy przetwornikiem a biegami, 2 - przed skrzynia biegow */
|
||||||
@@ -1748,6 +1750,8 @@ private:
|
|||||||
bool readRList( std::string const &Input );
|
bool readRList( std::string const &Input );
|
||||||
bool readUCList(std::string const &Input);
|
bool readUCList(std::string const &Input);
|
||||||
bool readDList( std::string const &line );
|
bool readDList( std::string const &line );
|
||||||
|
bool readDMList(std::string const &line);
|
||||||
|
bool readHTCList(std::string const &line);
|
||||||
bool readFFList( std::string const &line );
|
bool readFFList( std::string const &line );
|
||||||
bool readWWList( std::string const &line );
|
bool readWWList( std::string const &line );
|
||||||
bool readLightsList( std::string const &Input );
|
bool readLightsList( std::string const &Input );
|
||||||
|
|||||||
@@ -79,6 +79,29 @@ int DirF(int CouplerN)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double TableInterpolation(std::map<double, double> &Map, double Parameter)
|
||||||
|
{
|
||||||
|
if (Map.size() == 0)
|
||||||
|
return 0.0;
|
||||||
|
if (Map.size() == 1)
|
||||||
|
return Map.begin()->second;
|
||||||
|
|
||||||
|
auto lower = Map.lower_bound(Parameter);
|
||||||
|
auto upper = lower;
|
||||||
|
|
||||||
|
if (lower != Map.begin())
|
||||||
|
lower--;
|
||||||
|
else
|
||||||
|
upper++;
|
||||||
|
|
||||||
|
if (upper == Map.end()) {
|
||||||
|
lower--;
|
||||||
|
upper--;
|
||||||
|
}
|
||||||
|
double ratio = (upper->second - lower->second) / (upper->first - lower->first);
|
||||||
|
return (lower->second + (Parameter - lower->first) * ratio);
|
||||||
|
}
|
||||||
|
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
// Q: 20160716
|
// Q: 20160716
|
||||||
// Obliczanie natężenie prądu w silnikach
|
// Obliczanie natężenie prądu w silnikach
|
||||||
@@ -7116,7 +7139,12 @@ double TMoverParameters::dizel_Momentum(double dizel_fill, double n, double dt)
|
|||||||
neps = (n - dizel_n_old) / dt; //przyspieszenie katowe walu wejsciowego skrzyni biegow
|
neps = (n - dizel_n_old) / dt; //przyspieszenie katowe walu wejsciowego skrzyni biegow
|
||||||
|
|
||||||
if( enrot > 0 ) {
|
if( enrot > 0 ) {
|
||||||
Moment = ( dizel_Mmax - ( dizel_Mmax - dizel_Mnmax ) * square( ( enrot - dizel_nMmax ) / ( dizel_nMmax - dizel_nmax ) ) ) * dizel_fill - dizel_Mstand;
|
if (dizel_Momentum_Table.size() > 1) {
|
||||||
|
Moment = TableInterpolation(dizel_Momentum_Table, enrot) * dizel_fill - dizel_Mstand;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Moment = (dizel_Mmax - (dizel_Mmax - dizel_Mnmax) * square((enrot - dizel_nMmax) / (dizel_nMmax - dizel_nmax))) * dizel_fill - dizel_Mstand;
|
||||||
|
}
|
||||||
Mm = Moment;
|
Mm = Moment;
|
||||||
dizel_FuelConsumptionActual = dizel_FuelConsumption * enrot * dizel_fill;
|
dizel_FuelConsumptionActual = dizel_FuelConsumption * enrot * dizel_fill;
|
||||||
dizel_FuelConsumptedTotal += dizel_FuelConsumptionActual * dt / 3600.0;
|
dizel_FuelConsumptedTotal += dizel_FuelConsumptionActual * dt / 3600.0;
|
||||||
@@ -7176,17 +7204,25 @@ double TMoverParameters::dizel_Momentum(double dizel_fill, double n, double dt)
|
|||||||
HydroTorque += (hydro_TC_nIn - hydro_TC_nOut) * hydro_TC_TorqueInOut;
|
HydroTorque += (hydro_TC_nIn - hydro_TC_nOut) * hydro_TC_TorqueInOut;
|
||||||
HydroTorque += hydro_TC_nOut * hydro_TC_nOut * hydro_TC_TorqueOutOut;
|
HydroTorque += hydro_TC_nOut * hydro_TC_nOut * hydro_TC_TorqueOutOut;
|
||||||
double nOut2In = hydro_TC_nOut / std::max(0.01, hydro_TC_nIn);
|
double nOut2In = hydro_TC_nOut / std::max(0.01, hydro_TC_nIn);
|
||||||
if (nOut2In < hydro_TC_CouplingPoint)
|
if (hydro_TC_Table.size() > 1) {
|
||||||
{
|
hydro_TC_TMRatio = TableInterpolation(hydro_TC_Table, nOut2In);
|
||||||
hydro_TC_TMRatio = 1 + (hydro_TC_TMMax - 1) * square(1 - nOut2In / hydro_TC_CouplingPoint);
|
|
||||||
hydro_TC_TorqueIn = HydroTorque * hydro_TC_Fill;
|
|
||||||
hydro_TC_TorqueOut = HydroTorque * hydro_TC_Fill * hydro_TC_TMRatio;
|
hydro_TC_TorqueOut = HydroTorque * hydro_TC_Fill * hydro_TC_TMRatio;
|
||||||
|
hydro_TC_TorqueIn = HydroTorque * hydro_TC_Fill * std::min(1.0, hydro_TC_TMRatio);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hydro_TC_TMRatio = (1 - nOut2In) / (1 - hydro_TC_CouplingPoint);
|
if (nOut2In < hydro_TC_CouplingPoint)
|
||||||
hydro_TC_TorqueIn = HydroTorque * hydro_TC_Fill * hydro_TC_TMRatio;
|
{
|
||||||
hydro_TC_TorqueOut = HydroTorque * hydro_TC_Fill * hydro_TC_TMRatio;
|
hydro_TC_TMRatio = 1 + (hydro_TC_TMMax - 1) * square(1 - nOut2In / hydro_TC_CouplingPoint);
|
||||||
|
hydro_TC_TorqueIn = HydroTorque * hydro_TC_Fill;
|
||||||
|
hydro_TC_TorqueOut = HydroTorque * hydro_TC_Fill * hydro_TC_TMRatio;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hydro_TC_TMRatio = (1 - nOut2In) / (1 - hydro_TC_CouplingPoint);
|
||||||
|
hydro_TC_TorqueIn = HydroTorque * hydro_TC_Fill * hydro_TC_TMRatio;
|
||||||
|
hydro_TC_TorqueOut = HydroTorque * hydro_TC_Fill * hydro_TC_TMRatio;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TorqueH = hydro_TC_TorqueOut;
|
TorqueH = hydro_TC_TorqueOut;
|
||||||
TorqueL = hydro_TC_LockupTorque * hydro_TC_LockupRate;
|
TorqueL = hydro_TC_LockupTorque * hydro_TC_LockupRate;
|
||||||
@@ -8090,6 +8126,7 @@ bool TMoverParameters::switch_physics(bool const State) // DO PRZETLUMACZENIA NA
|
|||||||
bool startBPT;
|
bool startBPT;
|
||||||
bool startMPT, startMPT0;
|
bool startMPT, startMPT0;
|
||||||
bool startRLIST, startUCLIST;
|
bool startRLIST, startUCLIST;
|
||||||
|
bool startDIZELMOMENTUMLIST, startHYDROTCLIST;
|
||||||
bool startDLIST, startFFLIST, startWWLIST;
|
bool startDLIST, startFFLIST, startWWLIST;
|
||||||
bool startLIGHTSLIST;
|
bool startLIGHTSLIST;
|
||||||
bool startCOMPRESSORLIST;
|
bool startCOMPRESSORLIST;
|
||||||
@@ -8327,6 +8364,46 @@ bool TMoverParameters::readDList( std::string const &line ) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TMoverParameters::readDMList(std::string const &line) {
|
||||||
|
|
||||||
|
cParser parser(line);
|
||||||
|
if (false == parser.getTokens(2, false)) {
|
||||||
|
|
||||||
|
WriteLog("Read DMList: arguments missing in line " + std::to_string(LISTLINE + 1));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
auto idx = LISTLINE++;
|
||||||
|
double x = 0.0;
|
||||||
|
double y = 0.0;
|
||||||
|
parser
|
||||||
|
>> x
|
||||||
|
>> y;
|
||||||
|
|
||||||
|
dizel_Momentum_Table.emplace(x / 60.0, y);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TMoverParameters::readHTCList(std::string const &line) {
|
||||||
|
|
||||||
|
cParser parser(line);
|
||||||
|
if (false == parser.getTokens(2, false)) {
|
||||||
|
|
||||||
|
WriteLog("Read HTCList: arguments missing in line " + std::to_string(LISTLINE + 1));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
auto idx = LISTLINE++;
|
||||||
|
double x = 0.0;
|
||||||
|
double y = 0.0;
|
||||||
|
parser
|
||||||
|
>> x
|
||||||
|
>> y;
|
||||||
|
|
||||||
|
hydro_TC_Table.emplace(x, y);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool TMoverParameters::readFFList( std::string const &line ) {
|
bool TMoverParameters::readFFList( std::string const &line ) {
|
||||||
|
|
||||||
cParser parser( line );
|
cParser parser( line );
|
||||||
@@ -8522,6 +8599,8 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
|||||||
startRLIST = false;
|
startRLIST = false;
|
||||||
startUCLIST = false;
|
startUCLIST = false;
|
||||||
startDLIST = false;
|
startDLIST = false;
|
||||||
|
startDIZELMOMENTUMLIST = false;
|
||||||
|
startHYDROTCLIST = false;
|
||||||
startFFLIST = false;
|
startFFLIST = false;
|
||||||
startWWLIST = false;
|
startWWLIST = false;
|
||||||
startLIGHTSLIST = false;
|
startLIGHTSLIST = false;
|
||||||
@@ -8594,6 +8673,16 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
|||||||
startDLIST = false;
|
startDLIST = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (issection("END-DML", inputline)) {
|
||||||
|
startBPT = false;
|
||||||
|
startDIZELMOMENTUMLIST = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (issection("END-HTCL", inputline)) {
|
||||||
|
startBPT = false;
|
||||||
|
startHYDROTCLIST = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if( issection( "endff", inputline ) ) {
|
if( issection( "endff", inputline ) ) {
|
||||||
startBPT = false;
|
startBPT = false;
|
||||||
startFFLIST = false;
|
startFFLIST = false;
|
||||||
@@ -8831,6 +8920,22 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (issection("DMList:", inputline))
|
||||||
|
{
|
||||||
|
startBPT = false;
|
||||||
|
fizlines.emplace("DMList", inputline);
|
||||||
|
startDIZELMOMENTUMLIST = true; LISTLINE = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (issection("HTCList:", inputline))
|
||||||
|
{
|
||||||
|
startBPT = false;
|
||||||
|
fizlines.emplace("HTCList", inputline);
|
||||||
|
startHYDROTCLIST = true; LISTLINE = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if( issection( "ffList:", inputline ) ) {
|
if( issection( "ffList:", inputline ) ) {
|
||||||
startBPT = false;
|
startBPT = false;
|
||||||
startFFLIST = true; LISTLINE = 0;
|
startFFLIST = true; LISTLINE = 0;
|
||||||
@@ -8887,6 +8992,14 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
|||||||
readDList( inputline );
|
readDList( inputline );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (true == startDIZELMOMENTUMLIST) {
|
||||||
|
readDMList(inputline);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (true == startHYDROTCLIST) {
|
||||||
|
readHTCList(inputline);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if( true == startFFLIST ) {
|
if( true == startFFLIST ) {
|
||||||
readFFList( inputline );
|
readFFList( inputline );
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user