First Steps#
This tutorial will give a short introduction on how to use Loads Kernel. For more information on the theoretical background, please consult the User Guide. It is also assumed that you sucessfully installed the software as a Python package as described in the README.
Let’s see if we can import the software, which is a good indictor for a sucessful installation.
from loadskernel import program_flow
Initialization and Pre-Processing#
First, initialize the main module with the job name as well as input and output folders. Please adjust to your folder structure.
The program flow is organized in a pre-, main- and post-processing step. These three steps need to be performed sequentially, but can be performed individually. This is an advantage in case you want to repeat e.g. the main- and/or post-processing while the model itself remained unchanged. Also, the main-processing may be run on a different computer or a high performance cluster while the results are copied back to the local file system for the post-processing step.
Now, run Loads Kernel and observe the console output below. The runtime should be a few seconds and the glider below the cumulus clouds indicates the program finished.
k = program_flow.Kernel('jcl_dc3_trim', pre=True, main=False, post=False,
path_input='./DC3_model/JCLs',
path_output='./DC3_results')
k.run()
INFO: This is the log for process 0.
INFO: Starting Loads Kernel with job: jcl_dc3_trim
INFO: User carn_fr on schwalbe (Linux-4.18.0-513.24.1.el8_9.x86_64-x86_64-with-glibc2.28)
INFO: pre: True
INFO: main: False
INFO: post: False
INFO: test: False
INFO: --> Reading parameters from JCL.
INFO: Generated list of 3 empty dicts.
INFO: --> Starting preprocessing.
INFO: Building structural model...
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/structure_only.bdf
INFO: Found include(s):
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/export_FUS.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-wing/left-wing.GRID_LREFAX_5400001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-wing/left-wing.RBE2_LREFAX_5400001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-wing/left-wing.CORD2R_LREFAX
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-wing/left-wing.MAT_ZR
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-wing/export_left-wing.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-wing/right-wing.GRID_LREFAX_6400001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-wing/right-wing.RBE2_LREFAX_6400001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-wing/right-wing.CORD2R_LREFAX
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-wing/right-wing.MAT_ZR
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-wing//export_right-wing.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-ht/left-ht.GRID_LREFAX_3330001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-ht/left-ht.RBE2_LREFAX_3330001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-ht/left-ht.CORD2R_LREFAX
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-ht/left-ht.MAT_ZR
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/left-ht/export_left-ht.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-ht/right-ht.GRID_LREFAX_3340001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-ht/right-ht.RBE2_LREFAX_3340001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-ht/right-ht.CORD2R_LREFAX
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-ht/right-ht.MAT_ZR
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/right-ht/export_right-ht.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/vt/vt.GRID_LREFAX_3320001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/vt/vt.RBE2_LREFAX_3320001
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/vt/vt.CORD2R_LREFAX
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/vt/vt.MAT_ZR
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/vt/export_vt.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/export_left-nacell.csv
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/../fem/export_right-nacell.csv
INFO: The structural model consists of 278 grid points (1668 DoFs) and 7 coordinate systems.
INFO: Reading Monitoring Stations from MONPNTs...
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/export_monitoring-stations.csv
INFO: Splining (rigid body) of 1668 DOFs to 192 DOFs...
INFO: Building atmo model...
INFO: Building aero model...
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/vt/vt.CAERO1
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-ht/left-ht.CAERO1
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-ht/right-ht.CAERO1
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-wing/left-wing.CAERO1
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-wing/right-wing.CAERO1
INFO: Constructing aero panels from CAERO cards
INFO: - from corner points and aero panels, constructing aerogrid
INFO: Read W2GJ data from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/w2gj_list.DMI_merge
INFO: Splining (rigid body) of 6336 DOFs to 6336 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6336 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/vt/vt.AESURF
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-ht/left-ht.AESURF
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-ht/right-ht.AESURF
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-wing/left-wing.AESURF
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-wing/right-wing.AESURF
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/vt/vt.AELIST
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-ht/left-ht.AELIST
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-ht/right-ht.AELIST
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/left-wing/left-wing.AELIST
INFO: Read from file: /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/aero/right-wing/right-wing.AELIST
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6336 DOFs to 6 DOFs...
INFO: Calculating steady AIC matrices (1056 panels, k=0.0) for 2 Mach number(s)...
INFO: done in 0.92 [sec].
INFO: The aerodynamic model consists of 1056 panels and 5 control surfaces.
INFO: Coupling aerogrid directly. Doing cleanup/thin out of strcgrid to avoid singularities (safety first!)
INFO: The spline model consists of 272 grid points.
INFO: Searching nearest neighbour of 1056 dependent nodes in 272 independent nodes...
INFO: Splining (rigid body) of 6336 DOFs to 1668 DOFs...
INFO: Building stiffness and mass model...
INFO: Reading matrix KGG from /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/SOL103_structure_only.mtx.h5
INFO: Reading matrix GM from /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/SOL103_structure_only.mtx.h5
INFO: Read USET from OP2-file /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/uset.op2 ...
Table USET , bytes = 6935 [ 0 to 6936]
INFO: Extracting bit positions from USET to determine DoFs
INFO: Prepare stiffness matrices for independent and free DoFs (f-set)
INFO: Mass configuration 1 of 1: M3
INFO: Reading matrix MGG from /data/carn_fr/LoadsKernel/doc/tutorials/DC3_model/fem/SOL103_M3.mtx.h5
INFO: Calculate center of gravity, mass and inertia (GRDPNT)...
INFO: Splining (rigid body) of 1668 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 1668 DOFs to 6 DOFs...
INFO: Mass: 11883.983000000002
INFO: CG at: [8.62280419e+00 5.43474355e-08 3.11704131e-01]
INFO: Inertia:
[[ 6.93201323e+04 -3.80956656e-04 1.17729353e+04]
[-3.80956654e-04 1.40925492e+05 -1.74794555e-04]
[ 1.17729353e+04 -1.74794555e-04 1.97104534e+05]]
INFO: Prepare mass matrices for independent and free DoFs (f-set)
INFO: Modal analysis for first 76 modes...
INFO: Found 76 modes with the following frequencies [Hz]:
INFO: [ nan nan 1.05457802e-06 4.52538930e-06
1.45457362e-05 3.39333114e-05 3.13716140e+00 4.68251648e+00
7.20798842e+00 7.88159198e+00 8.33703334e+00 8.49130434e+00
9.88499185e+00 1.25695152e+01 1.53520000e+01 1.70224904e+01
1.71353125e+01 1.84415883e+01 2.53323405e+01 2.53529787e+01
2.68433851e+01 2.81886245e+01 3.20724571e+01 3.24562324e+01
3.51081211e+01 3.52877859e+01 3.71484020e+01 3.74387461e+01
4.65087795e+01 4.66555395e+01 5.19704569e+01 5.31897897e+01
5.59827047e+01 5.61588818e+01 5.79161872e+01 5.83859187e+01
6.49254027e+01 6.49636994e+01 6.52953993e+01 6.55893563e+01
6.76977070e+01 7.39272939e+01 7.40020584e+01 7.92493678e+01
7.98448917e+01 8.44686963e+01 8.44977700e+01 8.89696420e+01
8.90380160e+01 9.17266784e+01 9.27516791e+01 1.00718906e+02
1.00742526e+02 1.05800840e+02 1.06520421e+02 1.09898735e+02
1.10071029e+02 1.12603325e+02 1.12677121e+02 1.21628942e+02
1.21633308e+02 1.25797288e+02 1.25826624e+02 1.30369009e+02
1.30516978e+02 1.37566261e+02 1.37608584e+02 1.41676350e+02
1.44303157e+02 1.44811563e+02 1.47038007e+02 1.47151873e+02
1.55547154e+02 1.56081100e+02 1.56183006e+02 1.57181628e+02]
INFO: From these 76 modes, the following 70 modes are selected: [ 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76]
INFO: Working on f-set
INFO: Damping: modal damping of 0.02
INFO: Working on h-set
INFO: Splining (rigid body) of 1668 DOFs to 6 DOFs...
INFO: Damping: modal damping of 0.02
INFO: Splining (rigid body) of 1668 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6 DOFs to 6 DOFs...
INFO: Splining (rigid body) of 6 DOFs to 6 DOFs...
INFO: --> Saving model data.
INFO: --> Done in 0:00:04 [h:mm:ss].
INFO: Loads Kernel finished.
INFO:
INFO: ( )
INFO: ( )
INFO:
INFO: ( )
INFO: ( )
INFO:
INFO: _|_
INFO: ---------O---------
INFO:
INFO:
The Log#
The log above should show only info messages, which give some information on the model or simply tell which step is currently performed. Other messages include warnings and errors, so it’s always a good indea to check the log. The log messages are also written to a file in the output folder (defined perviously by “path_output”).
Model Viewer#
As the preprocessing is finished, you should find a file “model_*.hdf5” in the output folder. You can explore the file with tools such as “hdfview” or use the Model Viewer to visualize the model. Note that HDF5 files have a locking mechnism, so always remember to close the file again.
During the installation, a link should have been added to your system PATH, so that you can launch the the Model Viewer from the command line with “model-viewer”. For this tutorial, we initialze the Model Viewer interactively from python. The Model Viewer is based on Mayavi, which is powerful for 3D visualizaions but needs a few seconds to be loaded.
After a few seconds, new window should open, possibly in the background. Load the model via File -> Load model and start exploring! Remember that this GUI is not as robust and tested as you might be used form your daily software and it can break easily (e.g. random clicking, clicking buttons twice, etc.), so be careful and you will get some nice visualizations.
The Model Viewer also allows for a visual inspection / quality control. For example, you can
check that the geometry of the FE model is correct and that the model is complete
check that the mass distribution looks plausible
compare the center of gravity, mode shapes and frequencies with reference results
inspect the aerodynmic mesh for gaps, overlaps and aspect ratio
confirm that the control surfaces work correctly
etc.
from modelviewer import view
m = view.Modelviewer()
m.run()
Qt: Session management error: None of the authentication protocols specified are supported
Main Processing#
The main-processing depends on the model data prepared in the pre-processing. In addition, a trim case definition is needed as input in the JCL. The first step of the main-processing is to establish a set of so-called trim conditions. The aircraft states are set as free or fixed according to the selected maneuver and in such a way that the system is neither over- nor under-determined. Next, the solution of this system is computed, yielding the trimmed aircraft.
As the model hasn’t changed, there is no need to run the pre-processing again, so it can be turned off while the main processing is switched on.
Once the computation finished, look for “The solution converged.” in the log, which indicates that the algorithm was able to find a solution that satisfies all trim parameters. There will be two new files in the output folder: “response_*.hdf5” and “monstations_*.hdf5”. In the response, all results are stored, such as the trim solution, the aerodynamic forces, the structural deformations, the nodal forces on the structure, etc. Depending on the model size and number of load cases, the file may become very large, especially for time domain simulations. Therefor, the second file only includes the section loads calculated at the monitoring stations.
k = program_flow.Kernel(job_name='jcl_dc3_trim', pre=False, main=True, post=False,
path_input='./DC3_model/JCLs',
path_output='./DC3_results')
k.run()
INFO: This is the log for process 0.
INFO: Starting Loads Kernel with job: jcl_dc3_trim
INFO: User carn_fr on schwalbe (Linux-4.18.0-513.24.1.el8_9.x86_64-x86_64-with-glibc2.28)
INFO: pre: False
INFO: main: True
INFO: post: False
INFO: test: False
INFO: --> Reading parameters from JCL.
INFO: Generated list of 3 empty dicts.
INFO: --> Starting Main in sequential mode for 3 trimcase(s).
INFO:
INFO: ========================================
INFO: trimcase: CC.M3.OVCFL000.level
INFO: subcase: 1
INFO: (case 1 of 3)
INFO: ========================================
INFO: Setting trim conditions to "default"
INFO: Init model equations of type "Steady"
INFO: Init EFCS "efcs_dc3"
INFO: Running trim for 76 variables...
INFO: The solution converged.
INFO: calculating forces & moments on structural set (force summation method)...
INFO: apply euler angles...
INFO: calculating cutting forces & moments...
INFO: gathering information on monitoring stations from response(s)...
INFO: searching min/max in time data at 32 monitoring stations and gathering loads (dyn2stat)...
INFO: --> Saving response(s).
INFO:
INFO: ========================================
INFO: trimcase: CC.M3.OVCFL000.pushdown
INFO: subcase: 2
INFO: (case 2 of 3)
INFO: ========================================
INFO: Setting trim conditions to "default"
INFO: Init model equations of type "Steady"
INFO: Init EFCS "efcs_dc3"
INFO: Running trim for 76 variables...
INFO: The solution converged.
INFO: calculating forces & moments on structural set (force summation method)...
INFO: apply euler angles...
INFO: calculating cutting forces & moments...
INFO: gathering information on monitoring stations from response(s)...
INFO: searching min/max in time data at 32 monitoring stations and gathering loads (dyn2stat)...
INFO: --> Saving response(s).
INFO:
INFO: ========================================
INFO: trimcase: CC.M3.OVCFL000.pullup
INFO: subcase: 3
INFO: (case 3 of 3)
INFO: ========================================
INFO: Setting trim conditions to "default"
INFO: Init model equations of type "Steady"
INFO: Init EFCS "efcs_dc3"
INFO: Running trim for 76 variables...
INFO: The solution converged.
INFO: calculating forces & moments on structural set (force summation method)...
INFO: apply euler angles...
INFO: calculating cutting forces & moments...
INFO: gathering information on monitoring stations from response(s)...
INFO: searching min/max in time data at 32 monitoring stations and gathering loads (dyn2stat)...
INFO: --> Saving response(s).
INFO: --> Saving monstation(s).
INFO: --> Saving dyn2stat.
INFO: --> Done in 0:00:02 [h:mm:ss].
INFO: Loads Kernel finished.
INFO:
INFO: ( )
INFO: ( )
INFO:
INFO: ( )
INFO: ( )
INFO:
INFO: _|_
INFO: ---------O---------
INFO:
INFO:
Loads Compare#
To visualize the section loads interactively, the tool Loads Compare can be used. Similar to the Model Viewer, the Loads Compare tool can be launched from the command line with “loads-compare”. You can try that now or, alternatively, execute the following two lines.
Load the data via File -> Load Monstations. The GUI allows you to show the section loads in 2D envelopes, for example the wing root torsional moments My plotted over the bending moments Mx. Each dot in the plot corresponds to one load case or one time slice. You can also rename the dataset, change the color and load multiple datasets, which is handy to compare for example maneuver loads with gust loads or to identify differences in loads bewteen two sizing loops.
from loadscompare import compare
c = compare.Compare()
c.run()
Qt: Session management error: None of the authentication protocols specified are supported
Post Processing#
The post-processing is dedicated to the evaluation, visualization and export of the results. The sizing load cases are identified by the convex hull for the monitoring stations specified in the JCL. The automated plotting and creation of PDF documents allows for a fast control of the results and a quick detection of erroneous data by the user.
After the post-processing, you should see the following outputs:
The section loads are plotted at the monitoring stations and saved in a PDF document (if specified in the JCL).
The trim results are exported as a CSV file.
Three more CSV files simply list the failed, the sucessful and the critical trim cases.
The nodal forces acting on the structure are exported in MSC Nastran format using FORCE and MOMENT cards.
For further analyses or custom plots you can open the response file in Python, Matlab or your favorite tool that understands HDF5.
k = program_flow.Kernel(job_name='jcl_dc3_trim', pre=False, main=False, post=True,
path_input='./DC3_model/JCLs',
path_output='./DC3_results')
k.run()
INFO: This is the log for process 0.
INFO: Starting Loads Kernel with job: jcl_dc3_trim
INFO: User carn_fr on schwalbe (Linux-4.18.0-513.24.1.el8_9.x86_64-x86_64-with-glibc2.28)
INFO: pre: False
INFO: main: False
INFO: post: True
INFO: test: False
INFO: --> Reading parameters from JCL.
INFO: Generated list of 3 empty dicts.
INFO: --> Opening response(s).
INFO: --> Loading monstations(s).
INFO: --> Loading dyn2stat.
INFO: --> Drawing some standard plots.
INFO: start potato-plotting...
INFO: start plotting cutting forces along wing...
INFO: plots saved as ./DC3_results/monstations_jcl_dc3_trim.pdf
INFO: --> Saving auxiliary output data.
INFO: writing trim results to: ./DC3_results/trim_results_jcl_dc3_trim.csv
INFO: writing successful trimcases cases to: ./DC3_results/successful_trimcases_jcl_dc3_trim.csv
INFO: writing failed trimcases cases to: ./DC3_results/failed_trimcases_jcl_dc3_trim.csv
INFO: writing critical trimcases cases to: ./DC3_results/crit_trimcases_jcl_dc3_trim.csv
INFO: saving critical nodal loads as Nastarn cards...
INFO: Loads Kernel finished.
INFO:
INFO: ( )
INFO: ( )
INFO:
INFO: ( )
INFO: ( )
INFO:
INFO: _|_
INFO: ---------O---------
INFO:
INFO: