WeightProblem

class baseclasses.WeightProblem(name, units, **kwargs)[source]

Weight Problem Object:

This Weight Problem Object should contain all of the information required to estimate the weight of a particular component configuration.

Parameters:
namestr

A name for the configuration

unitsstr

Define the units that this weight problem will use. This set of units is transferred to all components when the are added to the weight problem. It is assumed that all user defined parameters provided to the components are in this unit system. Each component converts the user provided inputs from this unit system to the one used internally to perform calculations and then converts the output back to the user defined system.

evalFuncsiteratble object containing strings

The names of the functions the user wants evaluated for this weight problem

Initialize the mission problem

addComponents(components)[source]

Append a list of components to the interal component list

addConstraintsPyOpt(optProb=None)[source]

Add the linear constraints for each of the fuel cases.

Also add non-linear constraints that all of the fuel cases have a total TOW less than MTOW

Parameters:
optProbpyOpt_optimization class

Optimization problem definition to which variables are added

addFuelCases(cases)[source]

Append a list of fuel cases to the weight problem

addVariablesPyOpt(optProb)[source]

Add the current set of variables to the optProb object.

Parameters:
optProbpyOpt_optimization class

Optimization problem definition to which variables are added

getFuelCase(caseName)[source]

Get the fuel case object associated with the caseName.

Parameters:
caseNamestr

Name of the fuel case to return

getVarNames()[source]

Get the variable names associate with this weight problem

resetFuelCase()[source]

reset the fuel weight for this case.

setDVGeo(DVGeo)[source]

Set the DVGeometry object that will manipulate this object. Note that pyWeight_problem doesn’t strictly need a DVGeometry object set, but if optimization is desired it is required.

Parameters:
dvGeoA DVGeometry object.

Object responsible for manipulating the constraints that this object is responsible for.

Examples

>>> wp.setDVGeo(DVGeo)
setDesignVars(x)[source]

Set the variables in the x-dict for this object.

Parameters:
xdict

Dictionary of variables which may or may not contain the design variable names this object needs

setFuelCase(case)[source]

loop over the components and set the specified fuel case

Parameters:
casefuelCase object

The fuel case to set

setSurface(surf)[source]

Set the surface this configuratoin will use to perform projections for various components.

Parameters:
surfpyGeo object or list

This is the surface representation to use for projections. If available, a pyGeo surface object can be used OR a triangulated surface in the form [p0, v1, v2] can be used. This triangulated surface form can be supplied from pyADflow or from pyTrian.

Examples

>>> CFDsolver = ADFLOW(comm=comm, options=aeroOptions)
>>> surf = CFDsolver.getTriangulatedMeshSurface()
>>> wp.setSurface(surf)
>>> # Or using a pyGeo surface object:
>>> surf = pyGeo('iges',fileName='wing.igs')
>>> wp.setSurface(surf)
writeMassesTecplot(filename)[source]

Get a list of component keys based on inclusion and exclusion

Parameters:
filename: str

filename for writing the masses. This string will have the .dat suffix appended to it.

writeProblemData(fileName)[source]

Write the problem data to a file

writeSurfaceTecplot(fileName)[source]

Write the triangulated surface mesh used in the weight_problem object to a tecplot file for visualization.

Parameters:
fileNamestr

File name for tecplot file. Should have a .dat extension.

writeTecplot(fileName)[source]

This function writes a visualization file for the components that have coordinates. All currently added components with coords are written to a tecplot file. This is useful for publication purposes as well as determine if the constraints are actually what the user expects them to be.

Parameters:
fileNamestr

File name for tecplot file. Should have a .dat extension.