diff --git a/examples/tutorial_1_WaveBot.ipynb b/examples/tutorial_1_WaveBot.ipynb index 01dcc0b9..2c827c55 100644 --- a/examples/tutorial_1_WaveBot.ipynb +++ b/examples/tutorial_1_WaveBot.ipynb @@ -121,14 +121,10 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### BEM\n", - "With our Capytaine floating body created, we can now run the Boundary Element Method solver in Capytaine to get the hydrostatic and hydrodynamic coefficients of our WEC object. This is wrapped into the `wecopttool.run_bem` function.\n", - "\n", + "#### Frequency and mesh check\n", "We will analyze 50 frequencies with a spacing of 0.05 Hz. These frequencies will be used for the Fourier representation of both the wave and the desired PTO force in the pseudo-spectral problem. See the Theory section of the Documentation for more details on the pseudo-spectral problem formulation.\n", "\n", - "If you would like to save our BEM data to a NetCDF file for future use, see the `wecopttool.write_netcdf` function.\n", - "\n", - "The run_bem() function now calculates the hydrostatics and stores them as part of bem_data. The inertia and stiffness can still be defined manually as part of the `FloatingBody` if desired." + "The `fb.minimal_computable_wavelength` parameter checks the mesh to determine the minimum wavelength that can be reliably computed using Capytaine. This warning is ignored here because the BEM results have been validated, but can be used as a guide for mesh refinement to ensure accurate BEM results." ] }, { @@ -141,6 +137,32 @@ "nfreq = 50\n", "freq = wot.frequency(f1, nfreq, False) # False -> no zero frequency\n", "\n", + "min_computable_wavelength = fb.minimal_computable_wavelength\n", + "g = 9.81\n", + "min_period = 1/(f1*nfreq)\n", + "min_wavelength = (g*(min_period)**2)/(2*np.pi)\n", + "\n", + "if min_wavelength < min_computable_wavelength:\n", + " print(f'Warning: Minimum wavelength in frequency spectrum ({min_wavelength}) is smaller'\n", + " f' than the minimum computable wavelength ({min_computable_wavelength}).')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### BEM\n", + "With our Capytaine floating body created, we can now run the Boundary Element Method solver in Capytaine to get the hydrostatic and hydrodynamic coefficients of our WEC object. This is wrapped into the `wecopttool.run_bem` function.\n", + "\n", + "If you would like to save our BEM data to a NetCDF file for future use, see the `wecopttool.write_netcdf` function." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "bem_data = wot.run_bem(fb, freq)" ] },