Howto:Modelling hydrodynamics in JSBSim: Difference between revisions

Jump to navigation Jump to search
→‎Generating hydrostatic buoyancy coefficients: A bit more information about the end result.
(→‎Generating hydrostatic buoyancy coefficients: A bit more information about the end result.)
Line 170: Line 170:
To make something float with the hydrodynamics system the buoyancy forces and moments need to be computed and then input to the generic part of the system as shown above. One way to compute these forces and moments is to generate buoyancy coefficients as functions of (read: tables indexed by) the position and orientation of the vessel/aircraft relative to the surface of the water it floats on.
To make something float with the hydrodynamics system the buoyancy forces and moments need to be computed and then input to the generic part of the system as shown above. One way to compute these forces and moments is to generate buoyancy coefficients as functions of (read: tables indexed by) the position and orientation of the vessel/aircraft relative to the surface of the water it floats on.


''''To be continued... for now, see [https://github.com/andgi/FlightGear-MFI-9/tree/master/dev/fdm/gerris the MFI-9B development repository]. ''''
Such tables can be generated by using the [http://gfs.sourceforge.net/wiki/index.php/Main_Page Gerris flow solver] (a case of using a sledgehammer on a roofing nail). My [https://github.com/andgi/FlightGear-MFI-9/tree/master/dev/fdm/gerris MFI-9B development repository] contain a short description and a set of scripts to do this. ''''This part will be extended later.''''


[[File:GfsView3d.jpg|thumb|600px|center|One Gerris buoyancy case for a float of the MFI-9B float-plane visualized in the Gerris gfsview3d tool. The water line is at the edge of the dark blue colour. It looks curved due to the various levels of cell refinement over the domain.]]
[[File:GfsView3d.jpg|thumb|600px|center|One Gerris buoyancy case for a float of the MFI-9B float-plane visualized in the Gerris gfsview3d tool. The water line is at the edge of the dark blue colour. It looks curved due to the various levels of cell refinement over the domain.]]
Out of Gerris and the scripts we get (not quite) dimensionless coefficients that can be used to compute forces and moments in a JSBSim hydrodynamics configuration.
As an example, take the buoyancy function for the left float on the MFI-9B aircraft, shown below. The coefficient table is indexed by the the position and orientation of the float relative to the surface of the water and encodes the shape and position of the float. It is redimensioned using the density of the fluid and the local gravitational acceleration, so it can e.g. be used in both fresh and sea water by adjusting the density property.
<syntaxhighlight lang="xml">
  <fcs_function name="hydro/buoyancy-lbs[0]">
  <description>
    Lift due to buoyancy.
    This data was computed in Gerris using the 3d model.
  </description>
  <function>
    <product>
    <value>1.0</value>
    <property>hydro/environment/rho-slug_ft3</property>
    <property>hydro/environment/gravity-ft_sec2</property>
    <table>
      <independentVar lookup="row">hydro/floats/pitch-deg[0]</independentVar>
      <independentVar lookup="column">hydro/floats/height-agl-ft[0]</independentVar>
      <tableData>
      0.0      0.5      1.0      1.5        2.0        2.5        3.0
-8  16.317    13.2014  8.0404    2.2106    0.0333578  0.0421991  0
-4  17.6619  13.1521  5.33223  0.456154  0.045529    0.0446028  0
-2  18.8259  12.8704  3.92246  0.138342  0.0473602  0.0459248  0
0    19.4423  11.7539  3.12018  0.0602531  0.0491747  0.0454018  0
2    19.1313  11.5822  2.64237  0.0470096  0.0461851  0.0452878  0
4    17.4748  11.5332  2.62089  0.0472367  0.04672    0.0445737  0
8    15.2858  10.4907  4.33869  0.0727965  0.0462562  0.0438382  0
12  12.89      9.50575  5.18165  1.47347    0.0481988  0.0413723  0
16  11.9824    8.9009  5.77791  3.0011    0.895087    0.0452297  0
      </tableData>
    </table>
    </product>
  </function>
  </fcs_function>
</syntaxhighlight>
''''To be continued... for now, see [https://github.com/andgi/FlightGear-MFI-9/tree/master/ the MFI-9B development repository]. ''''


== Modelling hydrodynamic coefficients ==
== Modelling hydrodynamic coefficients ==
789

edits

Navigation menu