Ejemplo n.º 1
0
    def __init__(self):
        print('start')

        # cruise conditions
        self.v_inf = 171.5                  # freestream velocity [m/s]
        self.rho = 0.01841                  # freestream density [kg/m^3]
        self.cruise_q = 12092.5527126               # dynamic pressure [N/m^2]
        self.grav = 9.81                            # gravity acc. [m/s^2]
        self.thermal_scale = 0.5 * self.rho * (self.v_inf)**3

        # Set up the communicators
        n_tacs_procs = 1

        comm = MPI.COMM_WORLD
        self.comm = comm
        self.tacs_comm = comm

        # world_rank = comm.Get_rank()
        # if world_rank < n_tacs_procs:
        #     color = 55
        #     key = world_rank
        # else:
        #     color = MPI.UNDEFINED
        #     key = world_rank
        # self.tacs_comm = comm.Split(color, key)

        # Set up the FUNtoFEM model for the TOGW problem
        self._build_model()

        self.ndv = len(self.model.get_variables())

        # instantiate TACS on the master
        solvers = {}
        solvers['flow'] = FakeSolver(self.comm, self.model)
        solvers['structural'] = wedgeTACS(self.comm, self.tacs_comm, self.model, n_tacs_procs)

        # L&D transfer options
        transfer_options = {
            'analysis_type': 'aerothermal',
            'scheme': 'meld',
            'thermal_scheme': 'meld',
            'npts': 5}

        # instantiate the driver
        self.driver = FUNtoFEMnlbgs(solvers, self.comm, self.tacs_comm, 0, self.comm, 0,
            transfer_options, model=self.model)

        # Set up some variables and constants related to the problem
        self.cruise_lift = None
        self.cruise_drag = None
        self.num_con = 1
        self.mass = None

        self.var_scale = np.ones(self.ndv,dtype=TransferScheme.dtype)
        self.struct_tacs = solvers['structural'].assembler
Ejemplo n.º 2
0
    def __init__(self):

        # steady conditions
        self.v_inf = 1962.44/6.6*0.5 # 148.67 Mach 0.5   # freestream velocity [m/s]
        self.rho = 0.01037                  # freestream density [kg/m^3]
        self.grav = 9.81                            # gravity acc. [m/s^2]
        self.steady_q      = 0.5 * self.rho * (self.v_inf)**2 # dynamic pressure [N/m^2]
        self.thermal_scale = 0.5 * self.rho * (self.v_inf)**3 # heat flux * area [J/s]

        self.steps = 100

        self.maximum_mass = 40.0 #mass = 45 at t=1.0
        self.num_tacs_dvs = 10 # need for number of tacs dvs to add to model, before tacs created
        # Set up the communicators
        n_tacs_procs = 1

        comm = MPI.COMM_WORLD
        self.comm = comm
        self.tacs_proc = False

        world_rank = comm.Get_rank()
        if world_rank < n_tacs_procs:
            color = 55
            key = world_rank
            self.tacs_proc = True
        else:
            color = MPI.UNDEFINED
            key = world_rank
        self.tacs_comm = comm.Split(color,key)

        # Set up the FUNtoFEM model for the TOGW problem
        self._build_model()

        self.ndv = len(self.model.get_variables())

        # FUN3D adjoint options (none is default)
        flow_adj_options={'getgrad':True,'outer_loop_krylov':True}

        # instantiate TACS on the master
        solvers = {}
        solvers['flow'] = Fun3dInterface(self.comm,self.model,adjoint_options=flow_adj_options)
        solvers['structural'] = wedgeTACS(self.comm,self.tacs_comm,self.model,n_tacs_procs)

        # L&D transfer options
        transfer_options = {'analysis_type': 'aerothermoelastic','scheme': 'meld', 'thermal_scheme': 'meld'}
        transfer_options['isym'] = -1
        transfer_options['beta'] = 10.0
        transfer_options['npts'] = 10

        # instantiate the driver
        self.driver = FUNtoFEMnlbgs_aerothermoelastic(solvers,self.comm,self.tacs_comm,0,self.comm,0,transfer_options,model=self.model)

        # Set up some variables and constants related to the problem
        self.temperature   = None
        self.mass          = None
        self.steady_lift   = None
        self.steady_drag   = None
        
        self.num_con = 1

        self.var_scale = np.ones(self.ndv,dtype=TransferScheme.dtype)
        self.assembler = solvers['structural'].assembler