1
0
Fork 0

Added recent ground effect modeling changes.

This commit is contained in:
curt 2001-07-23 20:31:59 +00:00
parent 450de25cc7
commit 97067e62a2
8 changed files with 101 additions and 58 deletions

View file

@ -37,6 +37,8 @@ INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "FGAerodynamics.h" #include "FGAerodynamics.h"
#include "FGFactorGroup.h"
#include "FGCoefficient.h"
static const char *IdSrc = "$Id$"; static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_AERODYNAMICS; static const char *IdHdr = ID_AERODYNAMICS;
@ -143,8 +145,13 @@ bool FGAerodynamics::Load(FGConfigFile* AC_cfg)
axis = AC_cfg->GetValue("NAME"); axis = AC_cfg->GetValue("NAME");
AC_cfg->GetNextConfigLine(); AC_cfg->GetNextConfigLine();
while ((token = AC_cfg->GetValue()) != "/AXIS") { while ((token = AC_cfg->GetValue()) != "/AXIS") {
ca.push_back(new FGCoefficient(FDMExec, AC_cfg)); if( token == "COEFFICIENT" ) {
if (debug_lvl > 0) DisplayCoeffFactors(ca.back()->Getmultipliers()); ca.push_back( new FGCoefficient(FDMExec) );
ca.back()->Load(AC_cfg);
} else if ( token == "GROUP" ) {
ca.push_back( new FGFactorGroup(FDMExec) );
ca.back()->Load(AC_cfg);
}
} }
Coeff[AxisIdx[axis]] = ca; Coeff[AxisIdx[axis]] = ca;
AC_cfg->GetNextConfigLine(); AC_cfg->GetNextConfigLine();
@ -156,19 +163,6 @@ bool FGAerodynamics::Load(FGConfigFile* AC_cfg)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGAerodynamics::DisplayCoeffFactors(vector <eParam> multipliers)
{
unsigned int i;
cout << " Non-Dimensionalized by: ";
for (i=0; i<multipliers.size();i++) cout << State->paramdef[multipliers[i]];
cout << endl;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
string FGAerodynamics::GetCoefficientStrings(void) string FGAerodynamics::GetCoefficientStrings(void)
{ {
string CoeffStrings = ""; string CoeffStrings = "";
@ -182,7 +176,7 @@ string FGAerodynamics::GetCoefficientStrings(void)
} else { } else {
CoeffStrings += ", "; CoeffStrings += ", ";
} }
CoeffStrings += Coeff[axis][sd]->Getname(); CoeffStrings += Coeff[axis][sd]->GetCoefficientStrings();
} }
} }
return CoeffStrings; return CoeffStrings;
@ -203,8 +197,7 @@ string FGAerodynamics::GetCoefficientValues(void)
} else { } else {
SDValues += ", "; SDValues += ", ";
} }
sprintf(buffer, "%9.6f", Coeff[axis][sd]->GetSD()); SDValues += Coeff[axis][sd]->GetCoefficientValues();
SDValues += string(buffer);
} }
} }

View file

@ -58,6 +58,7 @@ INCLUDES
#include "FGMassBalance.h" #include "FGMassBalance.h"
#include "FGTranslation.h" #include "FGTranslation.h"
#include "FGCoefficient.h" #include "FGCoefficient.h"
#include "FGFactorGroup.h"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS DEFINITIONS
@ -65,6 +66,7 @@ DEFINITIONS
#define ID_AERODYNAMICS "$Id$" #define ID_AERODYNAMICS "$Id$"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@ -107,12 +109,6 @@ public:
@return true if successful */ @return true if successful */
bool Load(FGConfigFile* AC_cfg); bool Load(FGConfigFile* AC_cfg);
/** Outputs coefficient information.
Non-dimensionalizing parameter descriptions are output
for each aero coefficient defined.
@param multipliers the list of multipliers for this coefficient.*/
void DisplayCoeffFactors(vector <eParam> multipliers);
/** Gets the total aerodynamic force vector. /** Gets the total aerodynamic force vector.
@return a force vector reference. */ @return a force vector reference. */
FGColumnVector& GetForces(void) {return vForces;} FGColumnVector& GetForces(void) {return vForces;}

View file

@ -162,15 +162,15 @@ public:
inline float GetAlphaCLMax(void) { return alphaclmax; } inline float GetAlphaCLMax(void) { return alphaclmax; }
inline float GetAlphaCLMin(void) { return alphaclmin; } inline float GetAlphaCLMin(void) { return alphaclmin; }
inline void SetGearUp(bool tt) { GearUp = tt; } inline void SetGear(bool tt) { GearUp = tt; }
inline void SetGearUp(void) { GearUp = true; }
inline void SetGearDown(bool tt) { GearUp = false; }
inline void SetAlphaCLMax(float tt) { alphaclmax=tt; } inline void SetAlphaCLMax(float tt) { alphaclmax=tt; }
inline void SetAlphaCLMin(float tt) { alphaclmin=tt; } inline void SetAlphaCLMin(float tt) { alphaclmin=tt; }
string GetGroundReactionStrings(void); string GetGroundReactionStrings(void);
string GetGroundReactionValues(void); string GetGroundReactionValues(void);
float GetLoD(void);
/// Subsystem types for specifying which will be output in the FDM data logging /// Subsystem types for specifying which will be output in the FDM data logging
enum SubSystems { enum SubSystems {
/** Subsystem: Simulation (= 1) */ ssSimulation = 1, /** Subsystem: Simulation (= 1) */ ssSimulation = 1,

View file

@ -75,22 +75,35 @@ extern short debug_lvl;
CLASS IMPLEMENTATION CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg) FGCoefficient::FGCoefficient( FGFDMExec* fdex )
{ {
int start, end, n;
string multparms;
FDMExec = fdex; FDMExec = fdex;
State = FDMExec->GetState(); State = FDMExec->GetState();
Table = 0; Table = 0;
if (debug_lvl & 2) cout << "Instantiated: FGCoefficient" << endl;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FGCoefficient::~FGCoefficient()
{
if (Table) delete Table;
if (debug_lvl & 2) cout << "Destroyed: FGCoefficient" << endl;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bool FGCoefficient::Load(FGConfigFile *AC_cfg) {
int start, end, n;
string multparms, mult;
if (AC_cfg) { if (AC_cfg) {
name = AC_cfg->GetValue("NAME"); name = AC_cfg->GetValue("NAME");
method = AC_cfg->GetValue("TYPE"); method = AC_cfg->GetValue("TYPE");
AC_cfg->GetNextConfigLine(); AC_cfg->GetNextConfigLine();
*AC_cfg >> description; *AC_cfg >> description;
if (debug_lvl > 0) { if (debug_lvl > 0) {
cout << "\n " << highint << underon << name << underoff << normint << endl; cout << "\n " << highint << underon << name << underoff << normint << endl;
cout << " " << description << endl; cout << " " << description << endl;
@ -137,17 +150,18 @@ FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg)
n = multparms.find("|"); n = multparms.find("|");
start = 0; start = 0;
while (n < end && n >= 0) { if(multparms != "FG_NONE") {
n -= start; while (n < end && n >= 0) {
n -= start;
mult = multparms.substr(start,n);
multipliers.push_back( State->GetParameterIndex(mult) );
start += n+1;
n = multparms.find("|",start);
}
multipliers.push_back(State->GetParameterIndex(multparms.substr(start,n))); multipliers.push_back(State->GetParameterIndex(multparms.substr(start,n)));
start += n+1; // End of non-dimensionalizing parameter read-in
n = multparms.find("|",start);
} }
multipliers.push_back(State->GetParameterIndex(multparms.substr(start,n)));
// End of non-dimensionalizing parameter read-in
switch(type) { switch(type) {
case VALUE: case VALUE:
*AC_cfg >> StaticValue; *AC_cfg >> StaticValue;
@ -164,17 +178,14 @@ FGCoefficient::FGCoefficient(FGFDMExec* fdex, FGConfigFile* AC_cfg)
break; break;
} }
AC_cfg->GetNextConfigLine(); AC_cfg->GetNextConfigLine();
} if (debug_lvl > 0) DisplayCoeffFactors();
if (debug_lvl & 2) cout << "Instantiated: FGCoefficient" << endl; return true;
} else {
return false;
}
} }
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FGCoefficient::~FGCoefficient()
{
if (Table) delete Table;
if (debug_lvl & 2) cout << "Destroyed: FGCoefficient" << endl;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -253,3 +264,32 @@ void FGCoefficient::Debug(void)
//TODO: Add your source code here //TODO: Add your source code here
} }
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGCoefficient::DisplayCoeffFactors(void)
{
unsigned int i;
cout << " Non-Dimensionalized by: ";
if( multipliers.size() == 0) {
cout << "none" << endl;
} else {
for (i=0; i<multipliers.size();i++)
cout << FDMExec->GetState()->paramdef[multipliers[i]];
}
cout << endl;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
string FGCoefficient::GetCoefficientValues(void) {
char buffer[10];
string value;
//value = ", ";
snprintf(buffer,10,"%9.6f",SD);
value += string(buffer);
return value;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View file

@ -98,16 +98,25 @@ CLASS DECLARATION
class FGCoefficient class FGCoefficient
{ {
public: public:
FGCoefficient(FGFDMExec*, FGConfigFile*); FGCoefficient(FGFDMExec*);
~FGCoefficient(); ~FGCoefficient();
virtual bool Load(FGConfigFile* AC_cfg);
typedef vector <eParam> MultVec; typedef vector <eParam> MultVec;
float TotalValue(void); virtual float TotalValue(void);
inline string Getname(void) {return name;} virtual inline string Getname(void) {return name;}
inline float GetSD(void) {return SD;} virtual inline float GetSD(void) { return SD;}
inline MultVec Getmultipliers(void) {return multipliers;} inline MultVec Getmultipliers(void) {return multipliers;}
void DumpSD(void); void DumpSD(void);
/** Outputs coefficient information.
Non-dimensionalizing parameter descriptions are output
for each aero coefficient defined.
@param multipliers the list of multipliers for this coefficient.*/
virtual void DisplayCoeffFactors(void);
virtual inline string GetCoefficientStrings(void) { return name; }
virtual string GetCoefficientValues(void);
private: private:
enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION}; enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};

View file

@ -108,6 +108,8 @@ FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex),
RunwayRadius = SeaLevelRadius; RunwayRadius = SeaLevelRadius;
DistanceAGL = Radius - RunwayRadius; // Geocentric DistanceAGL = Radius - RunwayRadius; // Geocentric
vRunwayNormal(3) = -1.0; // Initialized for standalone mode vRunwayNormal(3) = -1.0; // Initialized for standalone mode
b =1;
if (debug_lvl & 2) cout << "Instantiated: " << Name << endl; if (debug_lvl & 2) cout << "Instantiated: " << Name << endl;
} }
@ -157,7 +159,7 @@ bool FGPosition:: Run(void) {
h = Radius - SeaLevelRadius; // Geocentric h = Radius - SeaLevelRadius; // Geocentric
DistanceAGL = Radius - RunwayRadius; // Geocentric DistanceAGL = Radius - RunwayRadius; // Geocentric
hoverb = DistanceAGL/b; hoverb = DistanceAGL/b;
if (Vt > 0) { if (Vt > 0) {
@ -186,7 +188,7 @@ void FGPosition::GetState(void) {
Vt = Translation->GetVt(); Vt = Translation->GetVt();
vVel = State->GetTb2l() * Translation->GetUVW(); vVel = State->GetTb2l() * Translation->GetUVW();
vVelDot = State->GetTb2l() * Translation->GetUVWdot(); vVelDot = State->GetTb2l() * Translation->GetUVWdot();
b = Aircraft->GetWingSpan(); b = Aircraft->GetWingSpan();
} }
@ -196,6 +198,7 @@ void FGPosition::Seth(double tt) {
h = tt; h = tt;
Radius = h + SeaLevelRadius; Radius = h + SeaLevelRadius;
DistanceAGL = Radius - RunwayRadius; // Geocentric DistanceAGL = Radius - RunwayRadius; // Geocentric
hoverb = DistanceAGL/b;
} }
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -204,6 +207,7 @@ void FGPosition::SetDistanceAGL(double tt) {
DistanceAGL=tt; DistanceAGL=tt;
Radius = RunwayRadius + DistanceAGL; Radius = RunwayRadius + DistanceAGL;
h = Radius - SeaLevelRadius; h = Radius - SeaLevelRadius;
hoverb = DistanceAGL/b;
} }
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View file

@ -129,7 +129,7 @@ private:
double SeaLevelRadius; double SeaLevelRadius;
double gamma; double gamma;
double Vt, Vground; double Vt, Vground;
double hoverb,b; float hoverb,b;
double psigt; double psigt;

View file

@ -21,6 +21,7 @@ libJSBSim_a_SOURCES = \
FGDefs.h \ FGDefs.h \
FGFCS.cpp FGFCS.h \ FGFCS.cpp FGFCS.h \
FGFDMExec.cpp FGFDMExec.h \ FGFDMExec.cpp FGFDMExec.h \
FGFactorGroup.cpp FGFactorGroup.h \
FGForce.cpp FGForce.h \ FGForce.cpp FGForce.h \
FGInertial.cpp FGInertial.h \ FGInertial.cpp FGInertial.h \
FGInitialCondition.cpp FGInitialCondition.h \ FGInitialCondition.cpp FGInitialCondition.h \