WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
TabularAtmosphereModel.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX, INC.
15******************************************************************************/
16/*
17Tabular atmosphere model header file
18
19Author: Alex Reynolds
20*/
21/*
22Metadata for MS GUI:
23imdata = {"exclude" : True}
24*/
25
26#ifndef MODELS_ENVIRONMENT_TABULAR_ATMOSPHERE_MODEL_H
27#define MODELS_ENVIRONMENT_TABULAR_ATMOSPHERE_MODEL_H
28
29#include "simulation/Model.h"
30#include "utils/Interpolate2D.h"
31#include "locations.h"
32
33namespace warptwin {
34
60 MODEL(TabularAtmosphereModel)
61 public:
62 // TODO: Replace need for mass with direct acceleration calculation when
63 // body accel methods are implemented
64 // Model params
65 // NAME TYPE DEFAULT VALUE
68 SIGNAL(atmos_file, std::string, warptwinDir()+"data"+slash()+"atmosphere"+slash()+"1976stdatmos.txt")
70 SIGNAL(R_idealgas_kJ_kg_K, double, 286.0)
72 SIGNAL(gamma, double, 1.4)
74
75 // Model inputs
76 // NAME TYPE DEFAULT VALUE
79 SIGNAL(altitude_m, double, 0.0)
81
82 // Model outputs
83 // NAME TYPE DEFAULT VALUE
86 SIGNAL(temperature_K, double, 0.0)
88 SIGNAL(pressure_Pa, double, 0.0)
90 SIGNAL(density_kg_m3, double, 0.0)
92 SIGNAL(speed_of_sound, double, 0.0)
94
95 protected:
96 int16 start() override;
97 int16 execute() override;
98
99 // Internal variables for atmosphere calculations.
100 double _alt_km;
103 std::vector<std::vector<double>> _atmos_table;
107
108 // Variables to prevent repeated warning calls when above/below the table
109 bool _min_warned = false;
110 bool _max_warned = false;
111 };
112}
113
114#endif
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition appmacros.h:27
#define START_PARAMS
Definition appmacros.h:42
#define END_OUTPUTS
Definition appmacros.h:33
#define END_PARAMS
Definition appmacros.h:47
#define START_OUTPUTS
Definition appmacros.h:28
#define END_INPUTS
Definition appmacros.h:40
#define START_INPUTS
Definition appmacros.h:35
A class for performing simple x-y linear interpolation.
Definition Interpolate2D.h:50
Extensions to the C++ standard library.
Definition half.hpp:2325
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
Interpolate2D _interp_density
Definition TabularAtmosphereModel.h:106
int16 start() override
Class to execute logging.
SIGNAL(_mu, double, warpos::earth_wgs84.mu)
Interpolate2D _interp_pressure
Definition TabularAtmosphereModel.h:104
std::vector< std::vector< double > > _atmos_table
Definition TabularAtmosphereModel.h:103
bool _min_warned
Definition TabularAtmosphereModel.h:109
Interpolate2D _interp_temperature
Definition TabularAtmosphereModel.h:105
@ MODEL
Simplified dynamics model representing motion in the circular restricted 3 body problem.
Definition ImNode.h:31
double _max_altitude_km
Definition TabularAtmosphereModel.h:102
double _alt_km
Definition TabularAtmosphereModel.h:100
double _min_altitude_km
Definition TabularAtmosphereModel.h:101
bool _max_warned
Definition TabularAtmosphereModel.h:110
int16 execute() override
Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in...