COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
Cosmos::Physics::ThermalPropagator Class Reference

#include <physicsclass.h>

Inheritance diagram for Cosmos::Physics::ThermalPropagator:
Collaboration diagram for Cosmos::Physics::ThermalPropagator:

Public Member Functions

 ThermalPropagator (locstruc *locp, physicsstruc *physp, double idt, float itemperature)
 
int32_t Init (float temp)
 
int32_t Propagate ()
 
- Public Member Functions inherited from Cosmos::Physics::Propagator
 Propagator (locstruc *locp, physicsstruc *physp, double idt)
 
int32_t Increment (double nextutc)
 

Public Attributes

float temperature
 
- Public Attributes inherited from Cosmos::Physics::Propagator
double dt
 
double dtj
 
locstruc oldloc
 
locstrucnewloc
 
physicsstruc oldphys
 
physicsstrucnewphys
 
Type type
 

Additional Inherited Members

- Public Types inherited from Cosmos::Physics::Propagator
enum  Type {
  None = 0, PositionInertial = 10, PositionIterative = 11, PositionGaussJackson = 12,
  AttitudeInertial = 20, AttitudeIterative = 21, AttitudeLVLH = 22, Thermal = 30,
  Electrical = 40
}
 

Constructor & Destructor Documentation

Cosmos::Physics::ThermalPropagator::ThermalPropagator ( locstruc locp,
physicsstruc physp,
double  idt,
float  itemperature 
)
inline
263  : Propagator{ locp, physp, idt }, temperature{itemperature}
264  {
265  type = AttitudeLVLH;
268  newphys->radiation = SIGMA * pow(temperature, 4.);
269  for (trianglestruc& triangle : newphys->triangles)
270  {
271  triangle.temp = temperature;
272  triangle.heat = triangle.temp * (triangle.mass * triangle.hcap);
273  }
274  }
float radiation
Definition: jsondef.h:3428
physicsstruc * newphys
Definition: physicsclass.h:113
Propagator(locstruc *locp, physicsstruc *physp, double idt)
Definition: physicsclass.h:129
float mass
mass in Kg
Definition: jsondef.h:3303
Definition: physicsclass.h:123
float temp
Definition: jsondef.h:3426
Definition: jsondef.h:3275
float hcap
Definition: jsondef.h:3424
float heat
Definition: jsondef.h:3427
float temperature
Definition: physicsclass.h:278
float mass
Definition: jsondef.h:3425
float heat
Energy content in Joules.
Definition: jsondef.h:3291
#define SIGMA
SI Stefan-Boltzmann constant.
Definition: convertdef.h:51
float hcap
Heat Capacity in Joules / (Kg Kelvin)
Definition: jsondef.h:3293
float temp
Temperature in Kelvin.
Definition: jsondef.h:3305
Type type
Definition: physicsclass.h:127
vector< trianglestruc > triangles
Definition: jsondef.h:3452

Member Function Documentation

int32_t Cosmos::Physics::ThermalPropagator::Init ( float  temp)
int32_t Cosmos::Physics::ThermalPropagator::Propagate ( )
538  {
540  Vector unite = Vector(newloc->pos.eci.s).normalize(-1.);
541  unite = Vector(newloc->pos.eci.s).normalize(-1.);
543  double energyd;
544  double sdot;
545  double edot;
547  newphys->heat = 0.;
548  double ienergyd = newphys->radiation / newphys->area;
549  for (trianglestruc& triangle : newphys->triangles)
550  {
551  triangle.temp = triangle.heat / (triangle.mass * triangle.hcap);
552 
553  // First do all inputs
554 
555  if (triangle.external)
556  {
557  // External Normal face
558  // Solar effects
559  sdot = units.dot(triangle.normal);
560 
561  // Earth effects
562  edot = acos(unite.dot(triangle.normal) / triangle.normal.norm()) - RADOF(5.);
563  if (edot < 0.)
564  {
565  edot = 1.;
566  }
567  else
568  {
569  edot = cos(edot);
570  }
571 
572  energyd = 0.;
573  if (newloc->pos.sunradiance && sdot > 0)
574  {
575  energyd += sdot * triangle.irradiation * dt;
576  }
577 
578  if (edot > 0)
579  {
580  energyd += edot * dt * SIGMA * pow(290.,4);
581  }
582 
583  // Area not covered with cells
584  triangle.heat += (1. - triangle.pcell) * triangle.area * triangle.abs * energyd;
585  if (triangle.pcell > 0.)
586  {
587  // Area covered with cells
588  if (triangle.ecellbase > 0.)
589  {
590  double efficiency = triangle.ecellbase + triangle.ecellslope * triangle.temp;
591  triangle.heat += (triangle.pcell) * triangle.area * (triangle.abs - efficiency) * energyd;
592  }
593  else {
594  triangle.heat += (triangle.pcell) * triangle.area * triangle.abs * energyd;
595  }
596  }
597 
598  if (triangle.external == 2)
599  {
600  // External Anti-Normal face
601  // Solar effects
602  sdot = units.dot(-triangle.normal);
603 
604  // Earth effects
605  edot = acos(unite.dot(-triangle.normal) / -triangle.normal.norm()) - RADOF(5.);
606  if (edot < 0.)
607  {
608  edot = 1.;
609  }
610  else
611  {
612  edot = cos(edot);
613  }
614 
615  energyd = 0.;
616  if (newloc->pos.sunradiance && sdot > 0)
617  {
618  energyd += sdot * triangle.irradiation * dt;
619  }
620 
621  if (edot > 0)
622  {
623  energyd += edot * dt * SIGMA * pow(290.,4);
624  }
625 
626  triangle.heat += triangle.area * triangle.abs * energyd;
627  }
628  else {
629  // Internal Anti-Normal face
630  triangle.heat += triangle.iabs * triangle.area * ienergyd;
631  newphys->radiation -= triangle.iabs * triangle.area * ienergyd;
632  }
633  }
634  else {
635  // Internal Normal face
636  triangle.heat += triangle.iabs * triangle.area * ienergyd;
637  newphys->radiation -= triangle.iabs * triangle.area * ienergyd;
638 
639  // Internal Anti-Normal face
640  triangle.heat += triangle.iabs * triangle.area * ienergyd;
641  newphys->radiation -= triangle.iabs * triangle.area * ienergyd;
642  }
643 
644  // Self emission
645  // energyd = dt * SIGMA * pow(triangle.temp ,4);
646  // triangle.heat -= triangle.iemi * triangle.area * energyd;
647  // newphys->radiation += triangle.iemi * triangle.area * energyd;
648 
649  // Then do outputs
650  energyd = dt * SIGMA * pow(triangle.temp ,4);
651  if (triangle.external)
652  {
653  // External Normal face
654  triangle.heat -= triangle.emi * triangle.area * energyd;
655  if (triangle.external == 2)
656  {
657  // External Anti-Normal face
658  triangle.heat -= triangle.emi * triangle.area * energyd;
659  }
660  else {
661  // Internal Anti-Normal face
662  triangle.heat -= triangle.iemi * triangle.area * energyd;
663  newphys->radiation += triangle.iemi * triangle.area * energyd;
664  }
665  }
666  else {
667  {
668  // Internal Normal face
669  triangle.heat -= triangle.iemi * triangle.area * energyd;
670  newphys->radiation += triangle.iemi * triangle.area * energyd;
671 
672  // Internal Anti-Normal face
673  triangle.heat -= triangle.iemi * triangle.area * energyd;
674  newphys->radiation += triangle.iemi * triangle.area * energyd;
675 
676  }
677  }
678 
679  newphys->heat += triangle.heat;
680  triangle.temp = triangle.heat / (triangle.mass * triangle.hcap);
681  }
684 
685  return 0;
686  }
locstruc * newloc
Definition: physicsclass.h:111
float area
Definition: jsondef.h:3429
double dot(Vector b)
Dot product.
Definition: vector.cpp:1684
float radiation
Definition: jsondef.h:3428
physicsstruc * newphys
Definition: physicsclass.h:113
double norm()
Norm.
Definition: vector.cpp:1735
float mass
mass in Kg
Definition: jsondef.h:3303
float sunradiance
Watts per square meter per steradian.
Definition: convertdef.h:752
float area
Area.
Definition: jsondef.h:3307
double dt
Definition: physicsclass.h:108
float pcell
Solar cell coverage.
Definition: jsondef.h:3315
float temp
Definition: jsondef.h:3426
rvector s
Location.
Definition: convertdef.h:163
Definition: jsondef.h:3275
float hcap
Definition: jsondef.h:3424
uint8_t external
External facing sides.
Definition: jsondef.h:3278
float abs
Absorptivity: 0-1.
Definition: jsondef.h:3297
attstruc att
attstruc for this time.
Definition: convertdef.h:883
float iabs
Internal Absorptivity: 0-1.
Definition: jsondef.h:3301
qatt icrf
Definition: convertdef.h:830
float ecellbase
Solar cell base efficiency.
Definition: jsondef.h:3317
float iemi
Internal Emissivity: 0-1.
Definition: jsondef.h:3299
float emi
Emissivity: 0-1.
Definition: jsondef.h:3295
Vector normal
outward facing normal
Definition: jsondef.h:3282
posstruc pos
posstruc for this time.
Definition: convertdef.h:881
float heat
Definition: jsondef.h:3427
Vector & normalize(double size=1.)
Normalize.
Definition: vector.cpp:1706
float temperature
Definition: physicsclass.h:278
float mass
Definition: jsondef.h:3425
quaternion s
0th derivative: Quaternion
Definition: convertdef.h:479
cartpos eci
Definition: convertdef.h:737
float heat
Energy content in Joules.
Definition: jsondef.h:3291
float irradiation
Insolation in Watts/sq m.
Definition: jsondef.h:3313
Vector Class.
Definition: vector.h:672
#define SIGMA
SI Stefan-Boltzmann constant.
Definition: convertdef.h:51
cartpos icrf
Definition: convertdef.h:736
float hcap
Heat Capacity in Joules / (Kg Kelvin)
Definition: jsondef.h:3293
float temp
Temperature in Kelvin.
Definition: jsondef.h:3305
Vector irotate(const Vector &v)
Indirectly rotate a ::Vector using a ::Quaternion.
Definition: vector.cpp:2473
vector< trianglestruc > triangles
Definition: jsondef.h:3452
float ecellslope
Solar cell efficiency with temp.
Definition: jsondef.h:3319
#define RADOF(deg)
Radians of a Degree value.
Definition: math/constants.h:29

Member Data Documentation

float Cosmos::Physics::ThermalPropagator::temperature

The documentation for this class was generated from the following files: