Skip to content

Commit

Permalink
Merge pull request #148 from ImperialCollegeLondon/dev_setting_error
Browse files Browse the repository at this point in the history
Simulation settings check - Unrecognised settings raise Error
  • Loading branch information
ngoiz authored May 19, 2021
2 parents f9d04bc + 817c6b7 commit 536d8fd
Show file tree
Hide file tree
Showing 46 changed files with 14,280 additions and 14,998 deletions.
94 changes: 56 additions & 38 deletions cases/coupled/WindTurbine/generate_rotor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,32 @@

mstar = int(revs_in_wake*2.*np.pi/dphi)

rotor = template_wt.rotor_from_excel_type02(
chord_panels,
rotation_velocity,
pitch_deg,
excel_file_name = route + '../../../docs/source/content/example_notebooks/source/type02_db_NREL5MW_v02.xlsx',
excel_sheet_parameters = 'parameters',
excel_sheet_structural_blade = 'structural_blade',
excel_sheet_discretization_blade = 'discretization_blade',
excel_sheet_aero_blade = 'aero_blade',
excel_sheet_airfoil_info = 'airfoil_info',
excel_sheet_airfoil_coord = 'airfoil_coord',
m_distribution = 'uniform',
n_points_camber = 100,
tol_remove_points = 1e-8)
op_params = {'rotation_velocity': rotation_velocity,
'pitch_deg': pitch_deg,
'wsp': WSP,
'dt': dt}

geom_params = {'chord_panels':chord_panels,
'tol_remove_points': 1e-8,
'n_points_camber': 100,
'm_distribution': 'uniform'}

excel_description = {'excel_file_name': route + '../../../docs/source/content/example_notebooks/source/type02_db_NREL5MW_v02.xlsx',
'excel_sheet_parameters': 'parameters',
'excel_sheet_structural_blade': 'structural_blade',
'excel_sheet_discretization_blade': 'discretization_blade',
'excel_sheet_aero_blade': 'aero_blade',
'excel_sheet_airfoil_info': 'airfoil_info',
'excel_sheet_airfoil_chord': 'airfoil_coord'}

options = {'camber_effect_on_twist': False,
'user_defined_m_distribution_type': None,
'include_polars': False}

rotor = template_wt.rotor_from_excel_type03(op_params,
geom_params,
excel_description,
options)

######################################################################
###################### DEFINE SIMULATION ###########################
Expand All @@ -60,11 +72,12 @@

SimInfo.solvers['SHARPy']['flow'] = ['BeamLoader',
'AerogridLoader',
'StaticCoupledRBM',
'StaticCoupled',
'BeamPlot',
'AerogridPlot',
'DynamicCoupled',
'SaveData']

SimInfo.solvers['SHARPy']['case'] = case
SimInfo.solvers['SHARPy']['route'] = route
SimInfo.solvers['SHARPy']['write_log'] = True
Expand All @@ -80,39 +93,44 @@
SimInfo.solvers['AerogridLoader']['unsteady'] = 'on'
SimInfo.solvers['AerogridLoader']['mstar'] = mstar
SimInfo.solvers['AerogridLoader']['freestream_dir'] = np.array([0.,0.,0.])
SimInfo.solvers['AerogridLoader']['wake_shape_generator'] = 'HelicoidalWake'
SimInfo.solvers['AerogridLoader']['wake_shape_generator_input'] = {'u_inf': WSP,
'u_inf_direction': SimInfo.solvers['SteadyVelocityField']['u_inf_direction'],
'rotation_velocity': rotation_velocity*np.array([0., 0., 1.]),
'dt': dt,
'dphi1': dphi,
'ndphi1': mstar,
'r': 1.,
'dphimax': 10*deg2rad}

SimInfo.solvers['NonLinearStatic']['max_iterations'] = 200
SimInfo.solvers['NonLinearStatic']['num_load_steps'] = 1
SimInfo.solvers['NonLinearStatic']['min_delta'] = 1e-5

SimInfo.solvers['StaticCoupledRBM']['structural_solver'] = 'RigidDynamicPrescribedStep'
SimInfo.solvers['StaticCoupledRBM']['structural_solver_settings'] = SimInfo.solvers['RigidDynamicPrescribedStep']
SimInfo.solvers['StaticCoupledRBM']['structural_solver'] = 'NonLinearDynamicPrescribedStep'
SimInfo.solvers['StaticCoupledRBM']['structural_solver_settings'] = SimInfo.solvers['NonLinearDynamicPrescribedStep']
SimInfo.solvers['StaticCoupledRBM']['structural_solver'] = 'NonLinearStatic'
SimInfo.solvers['StaticCoupledRBM']['structural_solver_settings'] = SimInfo.solvers['NonLinearStatic']
SimInfo.solvers['StaticCoupledRBM']['aero_solver'] = 'SHWUvlm'
SimInfo.solvers['StaticCoupledRBM']['aero_solver_settings'] = SimInfo.solvers['SHWUvlm']

SimInfo.solvers['StaticCoupledRBM']['tolerance'] = 1e-6
SimInfo.solvers['StaticCoupledRBM']['n_load_steps'] = 0
SimInfo.solvers['StaticCoupledRBM']['relaxation_factor'] = 0.

SimInfo.solvers['SHWUvlm']['convection_scheme'] = 2
SimInfo.solvers['SHWUvlm']['num_cores'] = 15
SimInfo.solvers['SHWUvlm']['rot_vel'] = rotation_velocity
SimInfo.solvers['SHWUvlm']['rot_axis'] = np.array([0.,0.,1.])
SimInfo.solvers['SHWUvlm']['rot_center'] = np.zeros((3),)

# SimInfo.solvers['StaticCoupledRBM']['newmark_damp'] = 0.1
SimInfo.solvers['StaticUvlm']['horseshoe'] = False
SimInfo.solvers['StaticUvlm']['num_cores'] = 8
SimInfo.solvers['StaticUvlm']['n_rollup'] = 0
SimInfo.solvers['StaticUvlm']['rollup_dt'] = dt
SimInfo.solvers['StaticUvlm']['rollup_aic_refresh'] = 1
SimInfo.solvers['StaticUvlm']['rollup_tolerance'] = 1e-8
SimInfo.solvers['StaticUvlm']['velocity_field_generator'] = 'SteadyVelocityField'
SimInfo.solvers['StaticUvlm']['velocity_field_input'] = SimInfo.solvers['SteadyVelocityField']

SimInfo.solvers['StaticCoupled']['structural_solver'] = 'NonLinearStatic'
SimInfo.solvers['StaticCoupled']['structural_solver_settings'] = SimInfo.solvers['NonLinearStatic']
SimInfo.solvers['StaticCoupled']['aero_solver'] = 'StaticUvlm'
SimInfo.solvers['StaticCoupled']['aero_solver_settings'] = SimInfo.solvers['StaticUvlm']

SimInfo.solvers['StaticCoupled']['tolerance'] = 1e-6
SimInfo.solvers['StaticCoupled']['n_load_steps'] = 0
SimInfo.solvers['StaticCoupled']['relaxation_factor'] = 0.

SimInfo.solvers['StepUvlm']['convection_scheme'] = 2
SimInfo.solvers['StepUvlm']['num_cores'] = 15
SimInfo.solvers['StepUvlm']['num_cores'] = 8

SimInfo.solvers['WriteVariablesTime']['FoR_variables'] = ['total_forces',]
SimInfo.solvers['WriteVariablesTime']['FoR_number'] = [0,]

# SimInfo.solvers['DynamicCoupled']['structural_solver'] = 'NonLinearDynamicMultibody'
# SimInfo.solvers['DynamicCoupled']['structural_solver_settings'] = SimInfo.solvers['NonLinearDynamicMultibody']
SimInfo.solvers['DynamicCoupled']['structural_solver'] = 'RigidDynamicPrescribedStep'
SimInfo.solvers['DynamicCoupled']['structural_solver_settings'] = SimInfo.solvers['RigidDynamicPrescribedStep']
SimInfo.solvers['DynamicCoupled']['aero_solver'] = 'StepUvlm'
Expand Down
18 changes: 5 additions & 13 deletions cases/coupled/X-HALE/generate_xhale.py
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,6 @@ def generate_solver_file():
'num_load_steps': 1,
'delta_curved': 1e-1,
'min_delta': tolerance,
'balancing': 'off',
'gravity_on': gravity,
'gravity': gravity_value}

Expand Down Expand Up @@ -1750,23 +1749,18 @@ def generate_solver_file():
'thrust_nodes': thrust_nodes}

settings['StepUvlm'] = {'print_info': 'off',
'horseshoe': horseshoe,
'num_cores': 6,
'n_rollup': 0,
'convection_scheme': 2,
'rollup_dt': dt,
'rollup_aic_refresh': 1,
'rollup_tolerance': 1e-4,
'gamma_dot_filtering': 6,
# this is where the gust is input.
'velocity_field_generator': 'GustVelocityField',
'velocity_field_input': {'u_inf': u_inf,
'u_inf_direction': [1., 0, 0],
'gust_shape': gust_shape,
'gust_length': gust_length,
'gust_intensity': gust_intensity*u_inf,
'offset': -space_offset,
'span': span_main},
'gust_parameters': {
'gust_length': gust_length,
'gust_intensity': gust_intensity * u_inf},
'offset': -space_offset},
'rho': rho,
'n_time_steps': n_tstep,
'dt': dt}
Expand Down Expand Up @@ -1847,13 +1841,11 @@ def generate_solver_file():
'NumLambda': 100,
'write_modes_vtk': 'on',
'print_matrices': 'on',
'write_data': 'on',
'continuous_eigenvalues': 'off',
'dt': dt,
'plot_eigenvalues': 'on'}
settings['BeamPlot'] = {'include_rbm': 'on',
'include_applied_forces': 'on',
'include_forward_motion': 'off'}
'include_applied_forces': 'on'}

settings['AerogridPlot'] = {'include_rbm': 'on',
'include_forward_motion': 'off',
Expand Down
Loading

0 comments on commit 536d8fd

Please sign in to comment.