• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

WISDEM / WEIS / 14981693098

12 May 2025 08:14PM UTC coverage: 57.483% (-3.0%) from 60.437%
14981693098

push

github

web-flow
Overhaul of readthedocs for User Manual milestone (#379)

* fix bug of args parse while running app

* delete unnecessary prints

* change horizontal subplots to vertical ones

* initial documentation

* delete readme file

* minor changes on graph layout

* update on kestrel set up

* merge weis viz docs into existing weis docs

* delete initial weis viz documentation

* update on docs after changing opt type setting

* build infrastructure for loading/viewing stl file

* Revise documentation

* add viz utils for windio - random mesh rendering

* initial attempt to load geometry variables and render cylinder

* update environment for geometry representation

* set interface to playaround meshes

* backup from hpc

* basic function to visualize single airfoil shape and polars

* allow multiple geom files and set the airfoil name with filename as dict keys

* add latex capabilities

* match color across plots and add symbols

* add re

* set same xy-ratio for airfoils shape and split airfoil polar plots

* add import page to upload weis input files

* update home page with card layout

* link airfoils loading func with import table

* add data preprocess function for 3d and make it accessible across pages

* change nickname into label

* init dev of windio blades

* import table update with deletion and handling error

* add LE/TE

* add tower page

* test tower cylinder with real geom parameters

* layout UI + render multiple towers from scratch

* move import page to home page

* update OpenFAST UI

* solve nonexistent object errors + dynamic card creation for OpenFast

* working blades

* debug nonexistent objects error + test with RAFT, OF opts

* polish layout and mathjax

* moving meshing to different file

* reconfig 3d layout

* show multiple comps multiple geoms combination at once

* show single global grids, removing duplicated cubedAxes

* add wt_options data to access whole data per file

* working 3d viz

* initial commit for viz github w... (continued)

9 of 10 new or added lines in 4 files covered. (90.0%)

402 existing lines in 8 files now uncovered.

7628 of 13270 relevant lines covered (57.48%)

0.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.16
/weis/glue_code/gc_RunTools.py
1
import os
1✔
2
import matplotlib.pyplot as plt
1✔
3
import openmdao.api as om
1✔
4
import numpy as np
1✔
5
from openmdao.utils.mpi import MPI
1✔
6

7
class Outputs_2_Screen(om.ExplicitComponent):
1✔
8
    # Class to print outputs on screen
9
    def initialize(self):
1✔
10
        self.options.declare('modeling_options')
1✔
11
        self.options.declare('opt_options')
1✔
12

13
    def setup(self):
1✔
14
        modeling_options = self.options['modeling_options']
1✔
15
        n_te_flaps = modeling_options['WISDEM']['RotorSE']['n_te_flaps']
1✔
16

17
        self.add_input('aep',           val=0.0, units = 'GW * h')
1✔
18
        self.add_input('blade_mass',    val=0.0, units = 'kg')
1✔
19
        self.add_input('lcoe',          val=0.0, units = 'USD/MW/h')
1✔
20
        self.add_input('DEL_RootMyb',   val=0.0, units = 'N*m')
1✔
21
        self.add_input('DEL_TwrBsMyt',  val=0.0, units = 'N*m')
1✔
22
        self.add_input('Std_PtfmPitch', val=0.0, units = 'deg')
1✔
23
        if modeling_options['ROSCO']['linmodel_tuning']['type'] == 'robust':
1✔
24
            n_PC = 1
×
25
        else:
26
            n_PC = len(modeling_options['ROSCO']['U_pc'])
1✔
27
        self.add_input('omega_pc',      val=np.zeros(n_PC), units = 'rad/s')
1✔
28
        self.add_input('zeta_pc',       val=np.zeros(n_PC))
1✔
29
        self.add_input('Kp_float',      val=0.0, units = 's')
1✔
30
        self.add_input('ptfm_freq',     val=0.0, units = 'rad/s')
1✔
31
        self.add_input('omega_vs',      val=0.0, units='rad/s')
1✔
32
        self.add_input('zeta_vs',       val=0.0)
1✔
33
        self.add_input('flp_kp_norm',   val=0.0)
1✔
34
        self.add_input('flp_tau',       val=0.0, units='s')
1✔
35
        self.add_input('IPC_Kp1p',      val=0.0, units='s')
1✔
36
        self.add_input('IPC_Ki1p',      val=0.0,)
1✔
37
        self.add_input('tip_deflection',val=0.0, units='m')
1✔
38
        self.add_input('te_flap_end'   ,val=np.zeros(n_te_flaps))
1✔
39
        self.add_input('rotor_overspeed',val=0.0)
1✔
40
        self.add_input('Max_PtfmPitch',val=0.0)
1✔
41
        if modeling_options['OL2CL']['flag']:
1✔
42
            self.add_input('OL2CL_pitch',   val=0.0, units = 'deg')
×
43

44
    def compute(self, inputs, outputs):
1✔
45
        print('########################################')
1✔
46
        print('Objectives')
1✔
47
        print('Turbine AEP: {:<8.10f} GWh'.format(inputs['aep'][0]))
1✔
48
        print('Blade Mass:  {:<8.10f} kg'.format(inputs['blade_mass'][0]))
1✔
49
        print('LCOE:        {:<8.10f} USD/MWh'.format(inputs['lcoe'][0]))
1✔
50
        print('Tip Defl.:   {:<8.10f} m'.format(inputs['tip_deflection'][0]))
1✔
51
        
52
        # OpenFAST simulation summary
53
        if self.options['modeling_options']['OpenFAST']['flag']: 
1✔
54
            # Print optimization variables
55
            
56
            # Pitch control params
57
            if self.options['opt_options']['design_variables']['control']['servo']['pitch_control']['omega']['flag'] or self.options['opt_options']['design_variables']['control']['servo']['pitch_control']['zeta']['flag']:
1✔
58
                print('Pitch PI gain inputs: omega_pc[0] = {:2.3f}, zeta_pc[0] = {:2.3f}'.format(inputs['omega_pc'][0], inputs['zeta_pc'][0]))
1✔
59
            
60
            # Torque control params
61
            if self.options['opt_options']['design_variables']['control']['servo']['torque_control']['omega']['flag'] or self.options['opt_options']['design_variables']['control']['servo']['torque_control']['zeta']['flag']:
1✔
62
                print('Torque PI gain inputs: omega_vs = {:2.3f}, zeta_vs = {:2.3f}'.format(inputs['omega_vs'][0], inputs['zeta_vs'][0]))
×
63
            
64
            # Floating feedback
65
            if self.options['opt_options']['design_variables']['control']['servo']['pitch_control']['Kp_float']['flag'] or self.options['opt_options']['design_variables']['control']['servo']['pitch_control']['ptfm_freq']['flag'] :
1✔
66
                print('Floating Feedback: Kp_float = {:2.3f}, ptfm_freq = {:2.3f}'.format(inputs['Kp_float'][0], inputs['ptfm_freq'][0]))
1✔
67
            
68
            # Flap control
69
            if self.options['opt_options']['design_variables']['control']['servo']['flap_control']['flp_kp_norm']['flag'] or self.options['opt_options']['design_variables']['control']['servo']['flap_control']['flp_kp_norm']['flag']:
1✔
70
                print('Flap PI gain inputs: flp_kp_norm = {:2.3f}, flp_tau = {:2.3f}'.format(inputs['flp_kp_norm'][0], inputs['flp_tau'][0]))
×
71
            
72
            # IPC
73
            if self.options['opt_options']['design_variables']['control']['servo']['ipc_control']['Kp']:
1✔
74
                print('IPC Ki1p = {:2.3e}'.format(inputs['IPC_Kp1p'][0]))
1✔
75
            if self.options['opt_options']['design_variables']['control']['servo']['ipc_control']['Ki']:
1✔
76
                print('IPC Ki1p = {:2.3e}'.format(inputs['IPC_Ki1p'][0]))
1✔
77
           
78
            # Flaps
79
            if self.options['opt_options']['design_variables']['control']['flaps']['te_flap_end']['flag']:
1✔
80
                print('Trailing-edge flap end = {:2.3f}%'.format(inputs['te_flap_end'][0]*100.))
×
81
            # Print merit figure
82
            if self.options['opt_options']['merit_figure'] == 'DEL_TwrBsMyt':
1✔
83
                print('DEL(TwrBsMyt): {:<8.10f} Nm'.format(inputs['DEL_TwrBsMyt'][0]))
1✔
84
            if self.options['opt_options']['merit_figure'] == 'DEL_RootMyb':
1✔
85
                print('Max DEL(RootMyb): {:<8.10f} Nm'.format(inputs['DEL_RootMyb'][0]))
×
86
            if self.options['opt_options']['merit_figure'] == 'rotor_overspeed':
1✔
87
                print('rotor_overspeed: {:<8.10f} %'.format(inputs['rotor_overspeed'][0]*100))
×
88
            if self.options['opt_options']['merit_figure'] == 'Std_PtfmPitch':
1✔
UNCOV
89
                print('Std_PtfmPitch: {:<8.10f} deg.'.format(inputs['Std_PtfmPitch'][0]))
×
90
            if self.options['opt_options']['merit_figure'] == 'OL2CL_pitch':
1✔
91
                print('RMS Pitch Error (OL2CL): {:<8.10f} deg.'.format(inputs['OL2CL_pitch'][0]))
×
92
            # Print constraints
93
            if self.options['opt_options']['constraints']['control']['rotor_overspeed']['flag']:
1✔
94
                print('rotor_overspeed: {:<8.10f} %'.format(inputs['rotor_overspeed'][0]*100))
1✔
95
            if self.options['opt_options']['constraints']['control']['Max_PtfmPitch']['flag']:
1✔
96
                print('Max_PtfmPitch: {:<8.10f} deg.'.format(inputs['Max_PtfmPitch'][0]))
1✔
97
            if self.options['opt_options']['constraints']['control']['Std_PtfmPitch']['flag']:
1✔
98
                print('Std_PtfmPitch: {:<8.10f} deg.'.format(inputs['Std_PtfmPitch'][0]))
1✔
99
        
100
        print('########################################')
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc