VLM_prescribed_wake_solver_eel_1

Module Contents

Classes

ODEProblemTest

UVLMSolver

This class generates the solver for the prescribed VLM.

class VLM_prescribed_wake_solver_eel_1.ODEProblemTest(method, approach, num_times, display='default', error_tolerance=1e-07, visualization=None, dictionary_inputs=None, num_checkpoints=None, implicit_solver_jvp='direct', implicit_solver_fwd='direct')

Bases: ozone.api.ODEProblem

setup()

Must be defined by the user. Tells the class how the ODE is defined. The following methods must/may be called within this method: - self.add_state() : REQUIRED, called once per state variable , define a state variable - self.add_times() : REQUIRED, called once , define the time domain - self.set_ode_system() : REQUIRED, called once , define the ODE function

  • self.add_parameter() : OPTIONAL, called once per parameter variable , define a parameter variable

  • self.add_field_output() : OPTIONAL, called once per field output , define a field output

  • self.add_profile_output() : OPTIONAL, called once per profile output , define a profile output

  • self.set_profile_system() : OPTIONAL, called once if atleast one profile output , define the profile function

See examples.

class VLM_prescribed_wake_solver_eel_1.UVLMSolver(**kwargs)

Bases: csdl.Model

This class generates the solver for the prescribed VLM.

define()

User defined method to define runtime behavior. Note: the user never _calls_ this method. Only the Simulator class constructor calls this method.

Example

```py class Example(Model):

def define(self):

self.create_input(‘x’) m = 5 b = 3 y = m*x + b self.register_output(‘y’, y)

# compile using Simulator imported from back end… sim = Simulator(Example()) sim[‘x’] = -3/5 sim.run() print(sim[‘y’]) # expect 0 ```

initialize()

User defined method to declare parameter values. Parameters are compile time constants (neither inputs nor outputs to the model) and cannot be updated at runtime. Parameters are intended to make a Model subclass definition generic, and therefore reusable. The example below shows how a Model subclass definition uses parameters and how the user can set parameters when constructing the example Model subclass.

Example

```py class Example(Model):

def initialize(self):

self.parameters.declare(‘num_times’, types=int) self.parameters.declare(‘step_size’, types=float) self.parameters.declare(‘surface’, types=dict)

def define(self):

num_times = self.parameters[‘num_times’] step_size = self.parameters[‘step_size’] surface = self.parameters[‘surface’] name = surface[‘name’] # str symmetry = surface[‘symmetry’] # bool mesh = surface[‘mesh’] # numpy array

# define runtime behavior…

surface = {

‘name’: ‘wing’, ‘symmetry’: False, ‘mesh’: mesh,

}

# compile using Simulator imported from back end… sim = Simulator(

Example(

num_times=100, step_size=0.1, surface=surface,

),

)

```