PolarizedWaveMaker#

class fridom.nonhydro.modules.forcings.polarized_wave_maker.PolarizedWaveMaker(position: tuple[float | None], width: tuple[float | None], k: tuple[int], amplitude: float = 1.0)[source]#

Bases: Module

A wave maker that creates a polarized wave.

Description#

The source term is constructed from WavePackage initial condition (see fridom.nonhydro.initial_conditions.WavePackage):

\[S(\boldsymbol{x}, t) = A \sin(\omega t) \boldsymbol{z}_W(\boldsymbol{x})\]

where \(A\) is the amplitude, \(\omega\) is the frequency of the wave, that is computed from the dispersion relation (including discretization errors due to spatial and temporal discretization), and \(\boldsymbol{z}_W\) is the WavePackage initial condition. The source term is added to the state vector tendencies:

\[\partial_t \boldsymbol{z} \leftarrow \partial_t \boldsymbol{z} + S(\boldsymbol{x}, t)\]
__init__(position: tuple[float | None], width: tuple[float | None], k: tuple[int], amplitude: float = 1.0) None[source]#

Methods

__init__(position, width, k[, amplitude])

disable()

Disable the module.

enable()

Enable the module.

is_enabled()

Whether the module is enabled or not.

reset()

Stop and start the module.

setup(mset[, setup_mode])

Set the module up.

start()

Start the module.

stop()

Stop the module.

update(mz)

Update the model state.

Attributes

diff_module

The differentiation module to be used by this module.

grid

The grid of the model settings.

info

Return a dictionary with information about the time stepper.

interp_module

The interpolation module to be used by this module.

is_setup

Whether the module is set up.

mset

The model settings.

name

required_halo

The required halo points for this module.

Examples using fridom.nonhydro.modules.forcings.PolarizedWaveMaker#

Multiple Wave Makers

Multiple Wave Makers
name = 'Polarized Wave Maker'#
update(mz: ModelState) ModelState[source]#

Update the model state.

Description#

This method is called by the model at each time step. Child classes should overwrite this method to update the module. Make sure to decorate the method with the @module_method decorator.

Parameters#

mzfr.ModelState

The model state at the current time step.

Returns#

fr.ModelState

The updated model state.

property info: dict#

Return a dictionary with information about the time stepper.

Description#

This method should be overridden by the child class to return a dictionary with information about the time stepper. This information is used to print the time stepper in the __repr__ method.