Skip to main content
Version: 0.3.0

Philote discipline

Philote is a standard for calling analysis disciplines over gRPC, so that a framework written in one language can use a discipline written in another. With the philote Cargo feature, Bora provides an explicit discipline that serves both function values and analytic partial derivatives. Any Philote client can then use Bora without linking Rust code, for example an OpenMDAO model through Philote-Python.

Run the server​

cargo run --release --features philote --bin bora_server

The server listens on localhost:50051. Pass a different address as the only argument:

cargo run --release --features philote --bin bora_server 0.0.0.0:50100

The build needs no system gRPC or protobuf installation; the philote-mdo crate that Bora builds on brings its own.

Variables​

Variable names keep NeuralFoil's capitalization (CL, Re, Top_Xtr), so a model written against Python NeuralFoil's output names needs no translation.

Inputs of the Philote discipline.
InputShapeUnitsCorresponds to
upper_weights8kulfan.upper_weights
lower_weights8kulfan.lower_weights
leading_edge_weight1kulfan.leading_edge_weight
TE_thickness1kulfan.te_thickness
alpha1degalpha
Re1re
n_crit1n_crit
xtr_upper1xtr_upper
xtr_lower1xtr_lower
mach1mach, with include_corrections
Outputs of the Philote discipline.
OutputShapePresent
CL, CD, CM1Always
Top_Xtr, Bot_Xtr1Always
analysis_confidence1Always
upper_theta, upper_H, upper_ue_over_vinf32With include_boundary_layer
lower_theta, lower_H, lower_ue_over_vinf32With include_boundary_layer
Cpmin, Cpmin_0, mach_crit, mach_dd1With include_corrections

Partials are declared for every output with respect to every input. Each is a row-major block of output size by input size with singleton dimensions dropped: the partial of CL with respect to upper_weights has shape 8, and that of upper_theta with respect to upper_weights has shape 32 by 8. The boundary layer does not depend on mach, so that pair is not declared.

Options​

Options of the Philote discipline.
OptionTypeDefaultMeaning
model_sizestr"xlarge"Network size name, see Choosing a network size
data_directorystremptyDirectory holding the weight files; empty uses the standard search
include_boundary_layerboolfalseAlso expose the boundary-layer outputs and their partials
include_correctionsboolfalseAdd the mach input and apply the corrections to the coefficients and transition locations
include_360_deg_effectsbooltrueWith include_corrections, blend into the post-stall model at large angles

Options are applied when the client sets them, and the model is reloaded at that point, so a bad size name or directory fails the options call rather than the first evaluation.

Leave include_boundary_layer off unless you need those outputs. Without it the discipline computes values with analyze_scalars and partials with the reverse-mode analyze_scalars_with_gradients, which is several times faster than the full calls it must use otherwise (see Gradients). The same holds for include_corrections, which needs the edge velocities and so always takes the full forward-mode path. The discipline has no control-surface inputs; use the Rust API for those.

For a complete OpenMDAO model that drives the server with IPOPT, see Multipoint optimization.

Embedding the discipline​

To serve the discipline from your own executable, or to combine it with others, construct bora::philote::BoraDiscipline and hand it to philote-mdo's ExplicitServer. The bora_server source (src/bin/bora_server.rs) is a complete example in about forty lines.