Update use_api authored by Adrien Crovato's avatar Adrien Crovato
......@@ -11,30 +11,44 @@ The [core](https://gitlab.uliege.be/am-dept/sdpm/blob/master/sdpm/api/core.py) A
SDPM is initialized by using a dictionary of parameters, and the type of scenario and task. The different parameters are listed hereunder:
```python
cfg = {
# Model (geometry or mesh)
'File': str, # input Gmsh file
'Pars': dict, # parameters for Gmsh file (optional)
# Markers
'Wing': str, # name of the marker defining the lifting body (wing)
'Te': str, # name of the marker defining the trailing edge of the lifting body
# Freestream
'Mach': float, # Mach number (optional)
'AoA': float, # angle of attack (optional)
'AoS': float, # angle of side slip (optional)
# Unsteady motion
'Num_wake_div': int, # number of cells per chord length in the wake
'Frequencies': array[float], # list of reduced frequencies
'Modes': str, # input file containing the modes (optional)
'Num_modes': int, # number of modes
# Transonic correction
'Transonic_pressure_grad': str, # input file containing the pressure derivative (optional)
# Geometry
'Symmetry': bool, # whether only half (symmetric) model is provided
's_ref': float, # reference surface area
'c_ref': float, # reference chord length
'x_ref': float, # reference point for moment computation (x)
'y_ref': float, # reference point for moment computation (y)
'z_ref': float # reference point for moment computation (z)
'options': {
'verbosity': int # verbosity level
},
'io': {
'model_file': str, # Gmsh input file
'parameters': dict # parameters for Gmsh file
},
'bodies': [
{
'tag': str, # name of Gmsh marker defining the body
'wakes': [
{
'te_tag': str, # name of Gmsh marker defining the trailing edge of the body
'ref_length': float, # reference length (wake be 10 times ref_length long)
'num_divisions': int, # number of cells per reference length
}
]
}
],
'freestream': {
'mach': float, # freestream Mach number
'aoa': float, # freestream angle of attack
'aos': float # freestream angle of side slip
},
'geometry': {
'symmetry': bool, # whether only half (symmetric) model is provided
'area': float, # reference surface area
'length': float, # reference chord length
'center': [float, float, float] # reference point coordinates for moment computation
},
'unsteady': {
'frequencies': list(float), # list of reduced frequencies
'num_motions': int, # number of modes
'amp_pitch': list(float), # rigid pitch amplitudes
'amp_plunge': list(float), # rigid plunge amplitudes
'modes_file': str, # input CSV file containing the modes
'dcp_file': str, # input CSV file containing the pressure derivative
}
}
```
Once the parameters have been defined, SDPM can simply be initialized by calling,
......@@ -44,14 +58,14 @@ from sdpm.api.core import init_sdpm
_sdpm = init_sdpm(cfg)
```
where `_sdpm` is a dictionary containing the following objects (named after their key):
* `n_f` is the number of reference reduced frequencies
* `n_m` is the number of modes
* `msh` is the mesh
* `wrt` is the utility to write mesh/results on disk
* `pbl` is the formulation of the problem
* `bdy` is the body of interest
* `sol` is the direct solver
* `grd` is the gradient calculator
* `num_frequencies` is the number of reference reduced frequencies
* `num_motions` is the number of motions
* `mesh` is the mesh
* `writer` is the utility to write mesh/results on disk
* `problem` is the formulation of the problem
* `bodies` is the body of interest
* `solver` is the direct solver
* `gradient` is the gradient calculator
### OMFlut
SDPM has been interfaced with [OMFlut](https://gitlab.uliege.be/am-dept/omflut), which is built on top of [OpenMDAO](https://openmdao.org/), in order to calculate flutter. SDPM must be initialized inside an OpenMDAO group using a builder which will latter be reused by OMFlut.
......
......