Update use_api_internal authored by Adrien Crovato's avatar Adrien Crovato
...@@ -5,34 +5,37 @@ The internal API is meant for users wanting to run a standard computational proc ...@@ -5,34 +5,37 @@ The internal API is meant for users wanting to run a standard computational proc
Sample cases making use of the internal API can be found under [cases](https://gitlab.uliege.be/am-dept/dartflo/blob/master/dart/cases). Sample cases making use of the internal API can be found under [cases](https://gitlab.uliege.be/am-dept/dartflo/blob/master/dart/cases).
**1. Defining the parameters** **1. Defining the parameters**
In practise, all the internal APIs use the [Core API](use_api_core) to initialize DART using a dictionary of parameters. Some additional parameters need to be defined and are listed hereunder. In practise, all the internal APIs use the [Core API](use_api_core) to initialize DART using a dictionary of parameters. Additional configuration dicts must be provided and are listed hereunder.
Additional common parameters: Additional dict for post-processing:
```python ```python
# Post-pro post_cfg = {
cfg['Slice'] = list of float # y-coordinates of cutting planes to extract slices on the geometry (optional, will only work with VTK) 'cut_tag': int # id of physical group to be sliced (can be obtained through Gmsh)
cfg['TagId'] = int # id of physical group to be sliced (id can be obtained through gmsh) 'y_slices': list(float) # y-coordinates of cutting planes to extract slices on the geometry (will only work if output format is VTK)
}
``` ```
Additional parameters specific to Polar class: Additional dict for polar calculation:
```python ```python
cfg['AoA_begin'] = float # first value of the angle of attack [degrees] polar_cfg = {
cfg['AoA_end'] = float # last value of the angle of attack [degrees] 'aoas': list(float) # list of angles of attack [deg] (optional, default=[0])
cfg['AoA_step'] = float # step in the angle of attack [degrees] }
``` ```
Additional parameters specific to Trim class: Additional dict for trim calculation:
```python ```python
cfg['CL'] = float # target lift coefficient trim_cfg = {
cfg['AoA'] = float # guess (first) angle of attack 'cl_target': float, # target lift coefficient (optional, default=0)
cfg['dCL'] = float # guess (first) slope of CL w.r.t AoA [1/rad] 'aoa_init': float, # guess (first) angle of attack [deg] (optional, default=0)
'cl_slope': float # guess (first) slope of CL w.r.t AoA [1/rad] (optional, default=6.3)
}
``` ```
**2. Using the solver** **2. Using the solver**
After the parameters have been defined, the solver can be set up automatically by instantiating the object as, After the parameters have been defined, the solver can be set up automatically by instantiating the object as,
```python ```python
import dart.api.internal.polar as pol import dart.api.internal.polar as pol
polar = pol.Polar(cfg) polar = pol.Polar(cfg, polar_cfg, post_cfg=None)
# or # or
import dart.api.internal.trim as trm import dart.api.internal.trim as trm
trim = trm.Trim(cfg) trim = trm.Trim(cfg, trim_cfg, post_cfg=None)
``` ```
The script can then be run by calling, The script can then be run by calling,
```python ```python
... ...
......