Skip to content
Snippets Groups Projects
Commit fe74dcde authored by Florian Schültke's avatar Florian Schültke
Browse files

Merge branch 'develop' into 'main'

Initial open source version

See merge request !38
parents aab36744 b0e5d27b
Branches
Tags 0.5.0
No related merge requests found
Showing
with 1562 additions and 0 deletions
# Exclude all binaries from the diff
*.exe binary
*.dll binary
*.so binary
*.a binary
# Exclude image files from the diff
*.png binary
*.jpg binary
*.jpeg binary
# Project specific
*.layout
obj/
# IDE Files
.vscode
.pdb
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# CMake
build/
cmake/
CMakeUserPresets.json
# Pip wheel artefacts
__pycache__
*.egg-info/
# UNICADO - UNIversity Conceptual Aircraft Design and Optimization
#
# Copyright (C) 2025 UNICADO consortium
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Description:
# This file is part of UNICADO.
# === Configure pipeline ===
stages:
- deploy
# === Trigger the website deployment when new commit to default branch ===
trigger_documentation:
stage: deploy
image: alpine:latest
tags:
- documentation
before_script:
- apk update && apk add curl
script:
- "curl --fail --request POST --form token=$TRIGGER_DEPLOY_WEBSITE --form ref=$CI_DEFAULT_BRANCH https://git.rwth-aachen.de/api/v4/projects/87829/trigger/pipeline"
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: on_success
<!-- Title: Provide a concise and descriptive title for the issue incl. tool or library name -->
## Choose Your Issue Template
Before creating an issue, please review existing issues to avoid duplicates!
ALso, select the **appropriate type for your issue in the desciption drop-down**.
- Bug Report Template
- Feature Request Template
- TODO Template
- Documentation Request Template
- Testing Request Template
If not suitable, use the sections below and contact the owners.
## Description
Provide a concise description of the issue.
## Additional Context
Add screenshots, logs, or relevant information here.
<!-- Title: Provide a concise and descriptive title for the issue incl. tool or library name -->
# Bug Report
## Description
Describe the bug clearly. What happened?
## Steps to Reproduce
1. [Step 1]
2. [Step 2]
3. [Step 3]
## Expected Behavior
Explain what you expected to see.
## Environment
- **OS**: [e.g., Windows 10]
- **Version/Branch**: [e.g., v1.2.3]
## Additional Context
Attach any logs, screenshots, or context.
/label ~"type::bug"
<!-- Title: Provide a concise and descriptive title for the issue -->
# Documentation
## Summary
Explain what documentation is missing.
- **Unicado Version**: vx.x.x
- **Page**: page-to-change
## Additional Context
Attach any logs, screenshots, or context.
/label ~"type::documentation"
<!-- Title: Provide a concise and descriptive title for the issue incl. tool or library name -->
# Feature Request
## Summary
What feature are you requesting?
## Why?
Explain the problem this feature solves or the value it adds.
## Acceptance Criteria
- [ ] Define measurable outcomes for success.
- [ ] List specific requirements.
## Additional Notes
Include references, examples, or diagrams if applicable.
/label ~"type::feature"
<!-- Title: Provide a concise and descriptive title for the issue incl. tool or library name -->
# Testing Issue
## Summary
Provide a brief overview of what should be tested or changed in the test process. Also think about what is the goal of this test? E.g.
- Verify that [feature/bug fix/module] works as expected.
- Ensure that [specific requirement] is met.
## Related Issues or Merge Requests
- Issue(s): #[Issue ID]
- Merge Request(s): #[Merge Request ID]
## Expected Results
- [Outcome 1]: [What should happen].
- [Outcome 2]: [Another expected result].
## Environment
- **OS**: [e.g., Windows 10]
- **Version/Branch**: [e.g., v1.2.3]
## Additional Context
Attach any logs, screenshots, or context.
/label ~"type::testing"
<!-- Title: Provide a concise and descriptive title for the issue incl. tool or library name -->
# TODO
## Summary
Briefly describe the task. Provide any background information or related issues.
## Subtasks
- [ ] Step 1
- [ ] Step 2
- [ ] Step 3
## Acceptance Criteria
- [ ] Define measurable outcomes for success.
- [ ] List specific requirements.
/label ~"type::todo"
<!-- Title: Use an imperative, clear title (e.g., "Fix login bug" or "Add new analytics feature") -->
## Description
Provide a concise explanation of the changes made in this merge request.
## Related Issue(s)
- Closes #[feature issues]
- Fixes #[bug report issue]
- Resolves #[any other issues]
### Other Changes
- [Mention refactoring, tests, etc.]
## Screenshots/Logs
Attach screenshots or log outputs if applicable.
## Testing Instructions
1. [Step 1: How to test]
2. [Step 2: Expected outcome]
3. [Step 3: Additional steps if required]
## Developer Checklist
- [ ] Code has been tested locally and/or in pipeline.
- [ ] (if applicable) documentation updated.
- [ ] (if applicable) impact of new dependencies reviewed and included in project.
- [ ] Merge conflicts resolved with the target branch.
## Additional Notes
Add any information reviewers should focus on, e.g., specific files, functions, or changes of interest.
[submodule "extern/doxygen-awesome-css"]
path = extern/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
[submodule "extern/pybind11"]
path = extern/pybind11
url = https://github.com/pybind/pybind11.git
branch = stable
# set relatively new cmake version
cmake_minimum_required(VERSION 3.29)
# Start the library project
project(UnicadoLibs
VERSION 2.1
DESCRIPTION "Libraries for UNICADO"
LANGUAGES CXX
)
# set the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# When GCC is used, check if the version is 10.2.0 or higher
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.2.0)
message(FATAL_ERROR "[${PROJECT_NAME}] -> GCC version 10.2.0 or higher is required!")
endif()
endif()
# Disable the min and max macros when building with MSVC
if(MSVC)
add_compile_definitions(NOMINMAX)
endif()
# *optional* Add cppcheck and cpplint
# set(CMAKE_CXX_CPPCHECK "cppcheck")
# set(CMAKE_CXX_CPPLINT "cpplint")
# Option whether to use gnuplot
option(USE_GNUPLOT "Use gnuplot" ON)
# Option for blackbox testing
option(BUILD_BLACKBOXTESTS "Use blackbox testing" OFF)
# Option for unit testing
option(BUILD_UNITTEST "Use unit testing" OFF)
# Option to include system libraries in the package archive
option(PACKAGE_SYSTEM_LIBRARIES "Include system libraries in the package archive" ON)
# Finally decide whether to build static or shared libraries
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
# Set the output directory for all libraries depending on platform
if (BUILD_SHARED_LIBS)
if( WIN32 )
message(STATUS "[${PROJECT_NAME}] -> Windows detected: Building .dll")
else( UNIX )
message(STATUS "[${PROJECT_NAME}] -> Unix detected: Building .so")
endif()
else()
message(STATUS "[${PROJECT_NAME}] -> Building static libraries")
endif()
# Get Python and pipenv to build the Python packages
set(PYTHON_TARGETS "") # List containing the python targets
#=== Googletest setup ===
if(BUILD_BLACKBOXTESTS OR BUILD_UNITTEST)
message(STATUS "[${PROJECT_NAME}] -> Building tests for the libraries.")
# Download and unpack googletest at configure time
include(FetchContent)
FetchContent_Declare(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.13.0
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
# *optional* Add gtest to ctest
# enable_testing()
# include(GoogleTest)
endif()
# Add library for python bindings
set(PYBIND11_FINDPYTHON ON) # Let pybind11 find the python interpreter
add_subdirectory(extern/pybind11)
# Set the output directory for all libraries -> Use generator expressions to force multi-generator output to the same location
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/unicadoRuntimeLibs$<0:>) # .dll for Windows
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/unicadoRuntimeLibs$<0:>) # .so for Unix
# Include the library directories based on dependency order
add_subdirectory(aerodynamics)
add_subdirectory(aixml)
add_subdirectory(airfoils)
add_subdirectory(blackboxTest)
add_subdirectory(aircraftGeometry2)
add_subdirectory(atmosphere)
add_subdirectory(coordinateSystemConversion)
add_subdirectory(engine)
add_subdirectory(energyCarriers)
add_subdirectory(liftingLineInterface2)
add_subdirectory(moduleBasics)
add_subdirectory(pymodulepackage)
add_subdirectory(runtimeInfo)
add_subdirectory(standardFiles)
add_subdirectory(svl)
add_subdirectory(unitConversion)
# Add a custom target which installs all python packages if pipenv is available
if(PIPENV)
message(STATUS "[${PROJECT_NAME}] -> Pipenv is available, use target 'install_python_packages' to install the python packages inside your virtual environment.")
add_custom_target(install_python_packages
COMMAND ${PIPENV} run python -m pip install --force-reinstall ${PYTHON_TARGETS}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} # Execute in the top level source directory
# List the dependencies which have to be build first:
DEPENDS py11aircraftGeometry2 py11aixml py11coordinateSystemConversion py11unitConversion py11energyCarriers
)
endif()
# === Package setup ===
# create config file
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/UnicadoLibsConfig.cmake.in
"${CMAKE_CURRENT_LIST_DIR}/cmake/UnicadoLibsConfig.cmake"
INSTALL_DESTINATION cmake
)
# create version file
write_basic_package_version_file(
"${CMAKE_CURRENT_LIST_DIR}/cmake/UnicadoLibsConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
# Provide a cmake file which can be used to get a list of all python packages
configure_file(
${CMAKE_CURRENT_LIST_DIR}/UnicadoPythonPackages.cmake.in
${CMAKE_CURRENT_LIST_DIR}/cmake/UnicadoPythonPackages.cmake
)
{
"version": 6,
"configurePresets": [
{
"name": "unix-common",
"description": "Common settings for Unix compilers",
"hidden": true,
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-fexceptions -fno-builtin"
}
},
{
"name": "unix-debug",
"description": "Base settings for building debug configuration with Unix compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS_DEBUG": "-Wextra -Wsign-conversion -Wfloat-equal -g"
}
},
{
"name": "unix-release",
"description": "Base settings for building release configuration with Unix compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS_RELEASE": "-O2 -s"
}
},
{
"name": "windows-common",
"description": "Common settings for Windows compilers",
"hidden": true,
"binaryDir": "${sourceDir}/build",
"generator": "Visual Studio 17 2022",
"toolset": "ClangCL",
"toolchainFile": "C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"Python_EXECUTABLE": {"type": "FILEPATH", "value": "$ENV{HOMEDRIVE}$ENV{HOMEPATH}/AppData/Local/Programs/Python/Python311/python.exe"},
"CMAKE_CXX_FLAGS": "/permissive- /EHsc"
}
},
{
"name": "windows-debug",
"description": "Base settings for building debug configuration with Windows compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS_DEBUG": "/W4"
}
},
{
"name": "windows-release",
"description": "Base settings for building release configuration with Windows compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS_RELEASE": "/O2"
}
},
{
"name": "x64-linux-debug",
"description": "Default debug configuration for building on Linux",
"generator": "Unix Makefiles",
"inherits": ["unix-common", "unix-debug"]
},
{
"name": "x64-linux-release",
"description": "Default release configuration for building on Linux",
"generator": "Unix Makefiles",
"inherits": ["unix-common", "unix-release"]
},
{
"name": "x64-mingw-debug",
"description": "Default debug configuration for building with MSYS2/MinGW on Windows",
"generator": "MinGW Makefiles",
"inherits": ["unix-common", "unix-debug"]
},
{
"name": "x64-mingw-release",
"description": "Default release configuration for building with MSYS2/MinGW on Windows",
"generator": "MinGW Makefiles",
"inherits": ["unix-common", "unix-release"]
},
{
"name": "x64-windows-debug",
"description": "Default debug configuration for building on Windows",
"architecture": "x64",
"inherits": ["windows-common", "windows-debug"]
},
{
"name": "x64-windows-release",
"description": "Default release configuration for building on Windows",
"architecture": "x64",
"inherits": ["windows-common", "windows-release"]
}
],
"buildPresets": [
{
"name": "x64-linux-debug",
"description": "Sets the build type to Debug for the Linux build system.",
"configurePreset": "x64-linux-debug"
},
{
"name": "x64-linux-release",
"description": "Sets the build type to Release for the Linux build system.",
"configurePreset": "x64-linux-release"
},
{
"name": "x64-windows-debug",
"description": "Sets the build type to Debug for the Windows build system.",
"configurePreset": "x64-windows-debug",
"configuration": "Debug"
},
{
"name": "x64-windows-release",
"description": "Sets the build type to Release for the Windows build system.",
"configurePreset": "x64-windows-release",
"configuration": "Release"
}
]
}
# Folder-specific code ownership
aerodynamics/ @lukas.neuerburg @ellen.seabrooke @gPauls-TUHH
aircraftGeometry2/ @meric.taneri @AndiGob @ChrisRuw
airfoils/ @ChrisRuw @gPauls-TUHH
aixml/ @ChrisRuw @gPauls-TUHH @meric.taneri
atmosphere/ @lukas.neuerburg @gPauls-TUHH @ellen.seabrooke
blackboxTest/ @maurice.zimmnau
coordinalteSystemConversion/ @meric.taneri @AndiGob
engine/ @tobi747 @ellen.seabrooke @lukas.neuerburg
extern/ @meric.taneri @ChrisRuw
liftingLineInterface2/ @lukas.neuerburg @ellen.seabrooke @gPauls-TUHH
moduleBasics/ @ChrisRuw @gPauls-TUHH @meric.taneri
pymodulepackage/ @ChrisRuw @AndiGob @gPauls-TUHH
runtimeInfo/ @ellen.seabrooke @ChrisRuw @meric.taneri
standardFiles/ @ellen.seabrooke @lukas.neuerburg @meric.taneri
svl/ @ChrisRuw @gPauls-TUHH @meric.taneri
unitConversion/ @gPauls-TUHH @lukas.neuerburg @ChrisRuw
# File-specific code ownership
.gitattributes @Florian.Schueltke
.gitignore @Florian.Schueltke
.gitlab-ci.yml @maurice.zimmnau
CMakeLists.txt @Florian.Schueltke
CMakePresets.json @Florian.Schueltke
CODEOWNERS @Florian.Schueltke
LICENSE @Florian.Schueltke
UnicadoLibsConfig.cmake.in @Florian.Schueltke
UnicadoPythonPackages.cmake.in @Florian.Schueltke
LICENSE 0 → 100644
This diff is collapsed.
# Welcome to UNICADO Libraries Repository :airplane:
The libraries repository includes functionalities that are used in several modules.
> &rarr; Checkout your [UNICADO website](https://unicado.io/) for more information!
## Installation
### For User
You want to use UNICADO to get familiar with the workflow and see first results? Great :fire: Then check out the [Installation Guide](https://unicado.pages.rwth-aachen.de/unicado.gitlab.io/download/installation/) and the [Cleared for Take-Off](https://unicado.pages.rwth-aachen.de/unicado.gitlab.io/download/takeoff/). It includes the prerequisites, troubleshooting hints and a standalone installer.
### For Developer
We welcome contributions! :sparkles: Please read our [developer guide](https://unicado.pages.rwth-aachen.de/unicado.gitlab.io/developer/developer-installation/). It explains step-by-step what you need to install, how to get the source code, how to build it, how to contribute and how to create the installer.
## License
This project is licensed under the GNU General Public License, Version 3 License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments and Funding
This project is a collaborative effort by
- RWTH Aachen, Chair and Institute of Aerospace Systems
- TU Berlin
- Aircraft Design and Aerostructures
- Flight Mechanics, Flight Control and Aeroelasticity
- TU Braunschweig, Chair of Overall Aircraft Design
- TU Hamburg, Institute of Air Transportation Systems
- TU Munich, Chair of Aircraft Design
- University of Stuttgart, Institute of Aircraft Design
including its associated partner
- Airbus SE
- Collins Aerospace
- TGM Lightweight Solutions GmbH
and is funded by the Federal Ministry of Economic Affairs and Climate Action on the basis of a decision by the German Bundestag.
## Contact
For questions or support, feel free to contact us :email: **E-Mail:** [contacts@unicado.io](mailto:contacts@unicado.io).
# Exit when the Libs are already part of the current package
if(UnicadoLibs_FOUND)
return()
endif()
@PACKAGE_INIT@
# Add required dependencies
include(CMakeFindDependencyMacro)
find_dependency(Eigen3)
find_dependency(Boost)
find_dependency(CGAL)
find_dependency(Threads) # Gtest dependencies
# Define a list with the UnicadoLibs targets which are included in the package
message(STATUS "[UnicadoLibs] -> Adding libraries as package. Make sure your CMAKE_PREFIX_PATH points to the correct directory!")
set(UNICADO_LIBS_TARGETS
"
aerodynamics;
aixml;
airfoils;
blackboxTest;
aircraftGeometry2;
atmosphere;
coordinateSystemConversion;
engine;
energyCarriers;
liftingLineInterface2;
moduleBasics;
runtimeInfo;
standardFiles;
svl;
unitConversion;
"
)
# Add the python targets if the parent package provides pipenv
if(PIPENV)
message(STATUS "[UnicadoLibs] -> PIPENV available. Installing python targets:")
foreach(target @PYTHON_TARGETS@)
message(STATUS "=> Installing ${target}")
execute_process( COMMAND ${PIPENV} run python -m pip install --force-reinstall ${target} OUTPUT_QUIET)
endforeach()
else()
message(WARNING "[${PROJECT_NAME}] -> PIPENV not available. Python targets will not be installed.")
endif()
# Include each of the exported targets
foreach(comp ${UNICADO_LIBS_TARGETS})
include("${CMAKE_PREFIX_PATH}/cmake/UnicadoLibs${comp}Targets.cmake")
endforeach()
# check required packages as per CMake documentation (https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#module:CMakePackageConfigHelpers)
check_required_components(UnicadoLibs)
# When the package is included tell the user
message(STATUS "UnicadoLibs found: TRUE")
# Make the list of python packages available to the parent scope by including this file
set(PYTHON_PACKAGES @PYTHON_TARGETS@)
# Set the library name
set( LIBRARY_NAME aerodynamics )
# Set the library sources
set( LIBRARY_SOURCES
src/aerodynamics.cpp
resources.rc
)
# Create the library target
add_library( ${LIBRARY_NAME} ${LIBRARY_SOURCES} )
add_library( UnicadoLibs::${LIBRARY_NAME} ALIAS ${LIBRARY_NAME} ) # Create an alias target with a namespace alias
# Set the library properties
if( WIN32 )
target_compile_definitions( ${LIBRARY_NAME} PRIVATE "_POSIX_THREAD_SAFE_FUNCTIONS")
endif()
# Options when building a shared library
if ( BUILD_SHARED_LIBS )
target_compile_definitions( ${LIBRARY_NAME} PRIVATE "BUILD_AERODYNAMICS_SHARED" PUBLIC "IMPORT_AERODYNAMICS_SHARED")
endif()
# Add the include directories as the public interface
target_include_directories( ${LIBRARY_NAME} PUBLIC include )
# Link against dependent libraries
target_link_libraries( ${LIBRARY_NAME}
PRIVATE
aixml
runtimeInfo
standardFiles
atmosphere
)
# Add the install rules
install(TARGETS ${LIBRARY_NAME} EXPORT ${LIBRARY_NAME}Targets
RUNTIME DESTINATION unicadoRuntimeLibs # Windows
LIBRARY DESTINATION unicadoRuntimeLibs # Linux
)
# Add the export rules
export(EXPORT ${LIBRARY_NAME}Targets
FILE "${PROJECT_SOURCE_DIR}/cmake/UnicadoLibs${LIBRARY_NAME}Targets.cmake"
NAMESPACE UnicadoLibs::
)
/*
* UNICADO - UNIversity Conceptual Aircraft Design and Optimization
*
* Copyright (C) 2025 UNICADO consortium
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Description:
* This file is part of UNICADO.
*/
#ifndef AERODYNAMICS_AERODYNAMICS_H_
#define AERODYNAMICS_AERODYNAMICS_H_
#include <string>
#include <cstdint>
#include <vector>
#ifdef BUILD_AERODYNAMICS_SHARED
#ifdef _WIN32
#define AERODYNAMICSDLLEXPORT __declspec(dllexport)
#else
#define AERODYNAMICSDLLEXPORT __attribute__ ((visibility ("default")))
#endif
#elif defined(IMPORT_AERODYNAMICS_SHARED)
#ifdef _WIN32
#define AERODYNAMICSDLLEXPORT __declspec(dllimport)
#else
#define AERODYNAMICSDLLEXPORT
#endif
#else
#define AERODYNAMICSDLLEXPORT
#endif
class atmosphere;
class configuration;
class node;
/** \brief Class to describe the aerodynamics
*/
class AERODYNAMICSDLLEXPORT aerodynamics {
public:
/* Typedefs and Enums */
/** \brief Class describes the configuration of aerodynamics
*/
class AERODYNAMICSDLLEXPORT configuration {
public:
/* Typedefs and Enums */
/** \brief Class describes aerodynamic polar and coeffients
*/
class AERODYNAMICSDLLEXPORT polar {
public:
/* Vectors with aerodynamic coefficients */
std::vector<double> vAOA;
std::vector<double> vCL;
std::vector<double> vCD;
std::vector<double> vCD_alternate;
std::vector<double> vCm;
std::vector<double> vIStab;
std::vector<std::string> vOrigin_polar;
uint16_t ID_firstValid;
uint16_t ID_lastValid;
uint16_t ID_CLmin;
uint16_t ID_CLmax;
polar(const std::string& aConfig, const int& machID, const node& configuration); /**< Constructor */
virtual ~polar(); /**< Destructor */
/* Function interpolates linearly between the data points and returns a CD */
double getCD(const double& CL, const bool& useAlternateDragPolars, const bool& reqCheck) const;
double getIStab(const double& CL, const bool& reqCheck) const;
double getCL_firstValid() const;
double getCL_lastValid() const;
bool isValid(const double& CL) const;
bool allowGridChange;
double extrapolationMargin; /* Extrapolation margin (1: no extrapolation allowed, 1.05 -> 5% extrapolation allowed, etc) */
std::string getOriginPolar(const double& CL, const bool& useAlternateDragPolars, const bool& reqCheck) const;
};
/* Constructor and destructor */
configuration(const std::string& aConfig, const double& myMMO, const node& polarXML); /**< Constructor */
virtual ~configuration(); /**< Destructor */
/* Member functions */
double getCD(const double& CL, const double& machNumber, const bool& useAlternateDragPolars, const bool& reqCheck) const;
double getIStab(const double& CL, const double& machNumber, const bool& reqCheck) const;
double getCLAtAlpha(const double& alpha, const double& machNumber) const;
double getAlphaAtCL(const double& CL, const double& machNumber) const;
double getCmAtAlpha(const double& alpha, const double& machNumber) const;
double getCmAtCL(const double& CL, const double& machNumber) const;
double getCmAtCLmax(const double& machNumber) const;
/** \brief Function returns the interpolated polar value for a given key point.
* \param xValue Target x value for interpolation (can be AoA, CL, etc)
* \param x_vec vector corresponding to target x value
* \param y_vec vector of y values used for interpolation
* \param extrapolationMargin extrapolation margin (1: no extrapolation allowed, 1.05 -> 5% extrapolation allowed, etc)
* \return interpolated polar value
*/
double getPolarValue(const double& xValue, const std::vector<double>& x_vec, const std::vector<double>& y_vec, const double& extrapolationMargin) const;
std::vector< std::vector<double> > getOriginPolar(const double& CL, const double& machNumber, const bool& useAlternateDragPolars, const bool& reqCheck);
/* Member variables */
std::string configName;
int numberOfFlapSettings;
std::vector<double> machnumbers; /**< Mach numbers of the polars [-] */
std::vector<double> altitudes; /**< Altitudes of the polars [m] */
std::vector<double> reynoldsNumbers; /**< Reynolds number of the related polar */
std::vector<polar> polars;
private:
double MMO;
};
/* Constants */
/* Constructors */
aerodynamics(const node& acXML, const node& polarXML);
/* Destructors */
virtual ~aerodynamics();
/* Methods */
double getCruiseDrag(const double& machNumber, const double& altitude, const double& bankAngle, const double& m_acft, const std::string& config, const atmosphere& atm) const;
std::vector< std::vector<double> > getCruiseOriginPolar(const double& machNumber, const double& altitude, const double& bankAngle, const double& m_acft,
const std::string& config, const atmosphere& atm);
double getIStabPolar(const double& machNumber, const double& CL, const std::string& config) const;
double getCruiseLoverD(const double& machNumber, const double& altitude, const double& bankAngle, const double& m_acft, const std::string& config, const atmosphere& atm) const;
/** \brief Function to determine the resistance at a given CL. Application in the start calculation
* \param machNumber Mach number
* \param altitude a flight altitude [m]
* \param CL
* \param config configuration
* \param atm atmosphere
*/
double getCLDrag(const double& machNumber, const double& altitude, const double& CL, const std::string& config, const atmosphere& atm) const;
/** \brief Function returns CLmax for configuration and Mach. If necessary, min. between two Mach numbers
* \param machNumber
* \param config configuration
*/
double getCLmax(const double& machNumber, const std::string& config) const;
/** \brief Function to determine altitude [m] at a given CL and airspeed
* \param machNumber
* \param bankAngle bank angle of the aircraft
* \param CL
* \param m_acft aircraft mass
* \param atm atmosphere
* \return altitude double: altitude [m] for a given lift coefficient
*/
double getAltitudeAtCL(const double& machNumber, const double& bankAngle, const double& CL, const double& m_acft, const atmosphere& atm) const;
/** \brief Function to determine CL
* \param altitude a flight altitude [m]
* \param machNumber
* \param bankAngle bank angle of the aircraft
* \param m_acft aircraft mass
* \param atm atmosphere
*/
double getCL(const double& altitude, const double& machNumber, const double& bankAngle, const double& m_acft, const atmosphere& atm) const;
/**< Determine L/D for a CL of a specific configuration */
double getCLLoverD(const double& machNumber, const double& CL, const std::string& config) const;
/** \brief Function to determine the angle of attack of the aircraft for a given flight condition
* \param M a Mach number
* \param config configuration of the secondary control devices
* \param liftCoefficient a lift coefficient [-]
*/
double getAlphaAtFlightCondition(const double& machNumber, const std::string& config, const double& liftCoefficient) const;
/** \brief Function to determine the max range CL for Rmax (CL/CD^2)max
* \param machNumber
* \param config: configuration
*/
double maxRangeCL(const double& machNumber, const std::string& config) const;
/** \brief Function to increase the resistance to the specified value. If this value cannot be reached, the function returns false.
* \param dragNeeded
* \param drag
*/
bool useSpoiler(const double& dragNeeded, double* drag) const;
/** \brief Function to switch between turbulent and (if present) laminar polar set
*/
void switchToAlternateDragPolars();
/** \brief Function to switch to use of default polars
*/
void switchToDefltDragPolars();
bool altPolarsInUse;
void switchOnReqSwitch();
void switchOffReqSwitch();
/** \brief function returns complete configuration information of the private vector configurations
* \param numberOfConfiguration a specific number of a configuration in the list
* \return an object of the class configuration with complete configuration information
*/
configuration getConfiguration(const uint8_t& numberOfConfiguration) const;
/* Data Members */
std::vector<std::string> configurationList;
std::vector<configuration> configurations;
std::string cruiseConfiguration;
double CLmaxTakeoff;
double CLmaxLanding;
double CLoptimumCruise;
double CLgroundRoll; /**< CL during rolling */
double maxSpoilerFactor; /**< Maximum spoiler effectiveness related to the resistance increase */
private:
/* Typedefs and Enums */
/* Constants */
const node& acXML;
const node& polarXML;
/* Member variables */
double MMO;
double wingReferenceArea;
std::string polarFileName;
bool useCDalternatePolars;
bool reqCheck;
};
#endif // AERODYNAMICS_AERODYNAMICS_H_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment