tem_temporal_module Module

This module gathers different temporal effect treatments. like: constant, lua function and predefined Fortran function. \n Currently supports:

  • const: data is a constant value
  • lua_fun: data is a lua function
  • linear: data is ramped linearly
  • smooth: data is ramped with a smooth function
  • cos: oscillation as a cosine function
  • from_file: data is read from file (supports periodicity)

Note

Boundaries can be defined with superposed conditions in space and time. Therefore the function defined here acts as a factor applied to the overall boundary value.



Derived Types

type, public ::  tem_temporal_type

defines different temporal types like const, lua func or predefined func

Components

Type Visibility Attributes Name Initial
character(len=LabelLen), public :: kind

temporal kind

real(kind=rk), public :: const

constant value

integer, public :: lua_fun_ref = 0

Reference to the Lua function if the temporal function is defined as a Lua function.

type(flu_State), public :: conf

Handle to the Lua script for the Lua function

type(tem_linear_type), public :: linear

contains information for predefined functions

type(tem_from_file_temporal_type), public :: from_file

contains information for reading the data from file

real(kind=rk), public :: freq

frequency of oscillation Load in routine: load_temporal_cos

real(kind=rk), public :: phi

initial phase

real(kind=rk), public :: offset

offset

type, private ::  tem_linear_type

contains information for predefined temporal functions

Components

Type Visibility Attributes Name Initial
real(kind=rk), public :: from_time

start time

real(kind=rk), public :: to_time

end time

real(kind=rk), public :: min_factor

minimum factor at start time

real(kind=rk), public :: max_factor

maximum factor at end time

type, private ::  tem_from_file_temporal_type

contains information for loading inlet velocities from a datafile The data has to be stored as tuples (time,velocity) columnwise. t1 v1 t2 v2 ... tn vn and v1 .eq. vn has to be fullfilled. The data has to be provided in the format '(e15.8)'

Components

Type Visibility Attributes Name Initial
character(len=PathLen), public :: datafile

filename of the data

character(len=LabelLen), public :: intp

interpolate linearly between the data

type(grw_real2darray_type), public :: signal

growing array of tuples (time, velocity)

logical, public :: ramp = .false.

ramping active?

real(kind=rk), public :: rampVal

ramping value at the end of rampT

real(kind=rk), public :: rampT

ramping time

real(kind=rk), public :: fac

factor to multiply data with

logical, public :: periodic

is the data periodic?


Functions

public function tem_temporal_for(temporal, time) result(res)

This function invokes the type of the boundary such as constant, lua or predefined Fortran function.

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_temporal_type) :: temporal

boundary state

type(tem_time_type), intent(in) :: time

timer object incl. the current time information

Return Value real(kind=rk)

return value of a function

private pure function temporal_linear_for(me, t) result(res)

This function returns value of linear function which is defined by from_time, to_time, min_factor and max_factor

Arguments

Type IntentOptional Attributes Name
type(tem_linear_type), intent(in) :: me

temporal linear type

real(kind=rk), intent(in) :: t

current time

Return Value real(kind=rk)

return value of a function

private pure function temporal_smooth_for(me, t) result(res)

This function returns value of smooth sin function which is defined by from_time, to_time, min_factor and max_factor

Arguments

Type IntentOptional Attributes Name
type(tem_linear_type), intent(in) :: me

temporal smooth type

real(kind=rk), intent(in) :: t

current time

Return Value real(kind=rk)

return value of a function

private function temporal_lua_for(fun_ref, time, conf) result(res)

This function evaluate lua function and return its result

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fun_ref

Lua reference to the function to evaluate.

type(tem_time_type), intent(in) :: time

timer object incl. the current time information

type(flu_State) :: conf

optional lua state

Return Value real(kind=rk)

return value

private function temporal_from_file_periodic_for(me, time) result(res)

This function searches for the right values in the periodic data read from file and interpolates them if needed.

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_from_file_temporal_type) :: me

datatype incl. the data read from file

type(tem_time_type), intent(in) :: time

timer object incl. the current time information

Return Value real(kind=rk)

return value


Subroutines

public subroutine tem_load_temporal(me, conf, parent, key)

This subroutine load temporal table defined for a boundary.\n

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_temporal_type), intent(out) :: me

boundary temporal type

type(flu_State) :: conf

lua state

integer, intent(in) :: parent

parent handle contains temporal table

character(len=*), intent(in), optional :: key

state variable key string defined in lua

private subroutine load_temporal_linear(me, conf, thandle)

This subroutine load standard temporal function variables from LUA file.

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_linear_type), intent(inout) :: me

temporal predefined fun type

type(flu_State) :: conf

lua state type

integer, intent(in) :: thandle

aotus parent handle

private subroutine load_temporal_from_file(me, conf, thandle)

This subroutine loads the information needed to read data from a file.

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_from_file_temporal_type), intent(inout) :: me

temporal predefined from_file type

type(flu_State) :: conf

lua state type

integer, intent(in) :: thandle

aotus parent handle

private subroutine load_temporal_cos(freq, phi, offset, conf, thandle)

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(inout) :: freq

temporal predefined fun type

real(kind=rk), intent(inout) :: phi

temporal predefined fun type

real(kind=rk), intent(inout) :: offset

temporal predefined fun type

type(flu_State) :: conf

lua state type

integer, intent(in) :: thandle

aotus parent handle

private subroutine load_datafile(me)

This subroutine reads the data from disc and stores it in the tem_from_file_temporal_type.

Arguments

Type IntentOptional Attributes Name
type(tem_from_file_temporal_type), intent(inout) :: me

temporal predefined from_file type