带有Wingbox演练的OpenAeroStruct航空结构

时间:2019-01-15 19:38:01

标签: python optimization openmdao

我一直在OpenAeroStruct网站上进行演练,并尝试使用Wingbox演练代码运行Aerostructural。我收到此错误。

c:\users\bucke\openaerostruct\openaerostruct\structures\compute_nodes.py:53: ComplexWarning: Casting complex values to real discards the imaginary part
  data[:n] = 1 - w
c:\users\bucke\openaerostruct\openaerostruct\structures\compute_nodes.py:54: ComplexWarning: Casting complex values to real discards the imaginary part
  data[n:] = w
c:\users\bucke\openaerostruct\openaerostruct\transfer\load_transfer.py:57: ComplexWarning: Casting complex values to real discards the imaginary part
  self.fem_origin = np.float(fem_origin)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-bb874f64c6d4> in <module>()
    355 
    356 # Set up the problem
--> 357 prob.setup()
    358 
    359 # from openmdao.api import view_model

c:\windows\system32\openmdao\openmdao\core\problem.py in setup(self, vector_class, check, logger, mode, force_alloc_complex, distributed_vector_class, local_vector_class, derivatives)
    801 
    802         model._setup(model_comm, 'full', mode, distributed_vector_class, local_vector_class,
--> 803                      derivatives)
    804 
    805         # Cache all args for final setup.

c:\windows\system32\openmdao\openmdao\core\system.py in _setup(self, comm, setup_mode, mode, distributed_vector_class, local_vector_class, use_derivatives)
    678         self._setup_var_data(recurse=recurse)
    679         self._setup_vec_names(mode, self._vec_names, self._vois)
--> 680         self._setup_global_connections(recurse=recurse)
    681         self._setup_relevance(mode, self._relevant)
    682         self._setup_var_index_ranges(recurse=recurse)

c:\windows\system32\openmdao\openmdao\core\group.py in _setup_global_connections(self, recurse, conns)
    800                 raise NameError(
    801                     "Output '%s' does not exist for connection in '%s' from '%s' to '%s'." %
--> 802                     (prom_out, self.pathname, prom_out, prom_in))
    803 
    804             if (prom_in not in allprocs_prom2abs_list_in and

NameError: Output 'wing.element_mass' does not exist for connection in '' from 'wing.element_mass' to 'AS_point_0.coupled.wing.element_mass'.

任何解决此问题的帮助都将大有帮助。 链接到代码:Aerostructural with Wingbox Walkthrough code

1 个答案:

答案 0 :(得分:1)

您是否正在使用最新版本的OpenAeroStruct?最近的更改重命名了一些变量。网站上的代码与该新版本相对应。

尝试使用最新版本的OAS,可从以下网址获得:https://github.com/mdolab/OpenAeroStruct

该演练代码在我的计算机上本地运行,并在该新版本上远程运行。