# Known fields¶

Known fields can be used to specify boundary and initial conditions. If they are the same then one field can be used for both avoiding repeated definitions. Known fields can also be used to specify custom fields that cannot easily be described in C++, like the regular wave fields that are implemented. Known fields can also be used to specify damping zones in a domain.

name

Name of the field. Used to refer to the field from other places

type

The field type, one of

• AiryWaves

• BlendedField

• FreeSurfaceZone

• MaxField

• MinField

• RaschiiWaves

• ScalarField

• VectorField

• WaterBlock

• WaveOutflow

stationary

Set this to true/on (default is off) if you want to stop the field recomputing its value every time

plot

Most fields support plotting their value to a file which can be enabled by this setting

## AiryWaves¶

Standard linear waves. This field exposes the following functions:

• field_name/elevation

• field_name/c

• field_name/rho

• field_name/uhoriz

• field_name/uvert

• field_name/u - vector field, either [uhoriz, uvert] or [uhoriz, 0, uvert]

• field_name/pdyn

• field_name/pstat

• field_name/ptot

depth

The water depth

depth_above

Height of the air phase above the still water

still_water_position

The location of the the still water plane. It will be equal to the depth if the origin is at the bottom.

omegas, periods, wave_lengths, wave_numbers

List of numbers. You must specify one and only one of these

wave_phases

The phase of the waves, list of numbers, default is 0 for all waves

amplitudes

The wave amplitudes. List of numbers, no default values

current_speed, wind_speed

A superinposed current in the water phase / air phase respectively

ramp_time

Ramp up the amplitudes over a given time interval, default 0.

ramp_time

Ramp up the amplitudes over a given time interval, default 0.

colour_projection_degree

Project the colour function to DG0 using quadrature of this degree, default 6 (set degree to -1 to prevent this projection and just use interpolation instead)

## RaschiiWaves¶

Construct regular waves by use of the Rascii Python library to construct C++ code that describes the wave field

wave_model

The Raschii wave model to use, default is Fenton. Available models as of January 2019 are:

• Airy

• Fenton

• Stokes

air_model

The Raschii air model to use, default is FentonAir. Available models as of January 2019 are:

• ConstantAir

• FentonAir

wave_length, wave_height

Wave parameters

model_order

The order of the wave model, default is 5. Using 1 will always give Airy waves. Stokes waves are implemented up to order 5, Fenton waves can be calculated for arbitrary order, but order 10 is normally a good compromise between accuracy and speed.

depth, depth_above, ramp_time, still_water_position, current_speed

Same as for AiryWaves

blending_height

Distance used for blending water and air stream functions above the free surface in Raschii, see the Rascii documentation for more details.

## ScalarField¶

variable_name

The name of the scalar function that will be exposed, default phi.

polynomial_degree

The polynomial degree of the Continuous Lagrange function used to interpolate the field. Default 2

cpp_code

The field description. You can use the coordinate vector, x[i], the time, t, and any constants given in user_constants, see User constants and code.

## VectorField¶

Same as scalar field, but cpp_code must be a list of C++ expressions and the length of the list must be 2 in 2D and 3 in 3D.

## BlendedField¶

All variables, such as phi, are expressed as

$\phi = (1 - b) \phi_0 + b \phi_1$

where b is the scalar blending function with values [0, 1]

field0, field1

Names of the two known fields to be blended (not field functions, just the name of the field). All field functions of the respective fields are blended.

blending_function

The name of the scalar function used for blending

fields:
-   name: x squared
type: ScalarField
cpp_code: pow(x[0], 2)
stationary: true
-   name: t squared
type: ScalarField
cpp_code: pow(t, 2)
-   name: xt-blend
type: BlendedField
field0: x squared
field0: t squared
blending_function: x squared/phi


## MaxField and MinField¶

Return the max or min of two fields

field0, field1

Names of the two known field functions

## FreeSurfaceZone¶

A field that is 1.0 near the interface and 0.0 away from the interface

variable_name

The name of the scalar function that will be exposed, default phi.

radius

The resulting field will be 1.0 inside a distance radius from the free surface and 0.0 outside two times the radius. Between these points there will be a smooth transition

transition = 2 * r ** 3 - 9 * r ** 2 + 12 * r - 4

## WaterBlock¶

A block of water, projected to obtain the best representation of the colour field c given a mesh that does not conform to the block. Inside the block the field is 1.0, outside the block it is 0.0. The free surface is projected to be as sharp as possible

variable_name

The name of the scalar function that will be exposed, default c.

xmin, xmax, ymin, ymax, zmin, zmax

The extents of the block, all default to 0

polynomial_degree

The polynomial degree of the resulting field, default 0, which gives a piecewise constant field

colour_projection_degree

Project the colour function to DG0 using quadrature of this degree, default 6 (set degree to -1 to prevent this projection and just use interpolation instead)