Personal tools

Difference between revisions of "New: MOHID Water Vectorial and Angle Properties"

From MohidWiki

Jump to: navigation, search
(Created page with "== Overview == This is a guide on configuring MOHID Water new way of defining vectorial properties. And a recall on angle properties computation. ==Old Way of definig vecto...")
 
Line 2: Line 2:
 
This is a guide on configuring [[MOHID Water]] new way of defining vectorial properties.
 
This is a guide on configuring [[MOHID Water]] new way of defining vectorial properties.
 
And a recall on angle properties computation.
 
And a recall on angle properties computation.
 +
 +
Vectorial properties in MOHID have a X (zonal component) and Y (meridian component).
 +
 +
Angle properties in MOHID in ModuleAtmosphere and ModuleWaves have nautical referential (0º is wind or wave from N towards S, 90º is from East towards West and so on).
  
  
Line 14: Line 18:
 
  DESCRIPTION              : wind velocity X
 
  DESCRIPTION              : wind velocity X
 
  INITIALIZATION_METHOD    : CONSTANT
 
  INITIALIZATION_METHOD    : CONSTANT
  DEFAULTVALUE              : 1.0
+
  DEFAULTVALUE              : -1.0
 
  REMAIN_CONSTANT          : 1
 
  REMAIN_CONSTANT          : 1
 
  OUTPUT_HDF                : 0
 
  OUTPUT_HDF                : 0
Line 24: Line 28:
 
  DESCRIPTION              : wind velocity Y
 
  DESCRIPTION              : wind velocity Y
 
  INITIALIZATION_METHOD    : CONSTANT
 
  INITIALIZATION_METHOD    : CONSTANT
  DEFAULTVALUE              : 1.0
+
  DEFAULTVALUE              : 0.0
 
  REMAIN_CONSTANT          : 1
 
  REMAIN_CONSTANT          : 1
 
  OUTPUT_HDF                : 0
 
  OUTPUT_HDF                : 0
Line 33: Line 37:
 
However it creates one problem: how to deal with vectorial transformation from user input referential to the MOHID cell referential (if grid rotation and distortion exists).
 
However it creates one problem: how to deal with vectorial transformation from user input referential to the MOHID cell referential (if grid rotation and distortion exists).
  
The solution used until now was that each module would do its own transformation what could lead to conversion errors or lack of convertions.
+
The solution used until now was that each module would do its own transformations what could lead to conversion errors or lack of convertions.  
 +
 
 +
The same issue occurs with angle properties where each module would do its own transformations what could lead to same problems.
 +
 
 +
 
 +
==The New Way of definig vectorial properties==
 +
The New age has arrived!
 +
 
 +
Only vectorial propeties have changed the input format. Angle properties are scalar properties so in terms of input there was no change.
 +
 
 +
In order to avoid the descentralization and repetition of the transformation process, the vectorial property concept was created in Module FillMatrix.
 +
 
 +
And both vectorial and angle tranformation are made inside Module FillMatrix and the resulting matrixes returned to modules are always in MOHID cell referential.
 +
 
 +
An example of the new vectorial input is in Module Atmosphere:
 +
 
 +
<beginproperty>
 +
NAME                      : wind velocity
 +
UNITS                    : m/s
 +
DESCRIPTION              : wind velocity
 +
DEFAULTVALUE              : -1.0 0.0
 +
REMAIN_CONSTANT          : 1
 +
OUTPUT_HDF                : 0
 +
<endproperty>
 +
 
 +
That replaces the two properties wind velocity X and wind velocity Y.
 +
 
 +
The keyword DEFAULTVALUE can now read two or three components (if 3D property) istead of only one.
 +
 
 +
 
 +
===What are the Input/Output conventions used by all Modules?===
 +
Basically user inputs vecorial properties in zonal/meridional components (vectorial) and angles in nautical referential (atmosphere and waves) and MOHID in all modules uses interannly MOHID cell referential given by Module FillMatrix (after transformation from user referential).
 +
 
 +
To write output each module call again Module FillMatrix to get the fields in user input referential. So input and output is always in the zonal/meridional components (vectorial) and angles in nautical referential (atmosphere and waves)
 +
 
 +
 
 +
===What vectorial properties does the new approach changes in terms of data file definition?===
 +
 
 +
Module Atmosphere
 +
#wind velocity X and wind velocity Y are now only defined by wind velocity property
 +
 
 +
 
 +
Module InterfaceWaterAir
 +
#wind stress X and wind stress Y are now only defined by wind stress property
 +
 
 +
Module Waves
 +
#radiation stress X and radiation stress Y are now only defined by radiation stress property
 +
 
 +
 
 +
===What kind of input type is allowed for the new vectorial properties?===
 +
for now only constant, timeserie, ascii_file and hdf inputs are allowed. However new developments are welcome for other types of input.
 +
 
 +
 
 +
===How does it work? (for code enthusiasts)===
 +
Module FillMatrix now behaves similarly as before but instead of each property can have only one field of type time serie, ascii file, hdf, now it can have more (two in 2D properties).
 +
The Module FillMatrix searches how many components it has and does the same old process on all of them, saving the results in different fields (e.g. component X and Y).
 +
 
 +
The modules that ask properties fields to fillmatrix also save information in different matrixes and calls to fillmatrix are very similar with one more field (the second component).
 +
 
 +
 
 +
 
 +
==Examples==
 +
 
 +
===Atmosphere wind velocity defined by ASCII grid===~
 +
In case of ascii grid the user needs to provide two different files and two default values for x and y component (in this order).
 +
<beginproperty>
 +
NAME                      : wind velocity
 +
UNITS                    : m/s
 +
DESCRIPTION              : wind velocity
 +
INITIALIZATION_METHOD    : ASCII_FILE
 +
FILENAME_X                : ..\General Data\Boundary Conditions\ASCIIGrid_-1.dat
 +
FILENAME_Y                : ..\General Data\Boundary Conditions\ASCIIGrid_0.dat
 +
DEFAULTVALUE              : -1.0 0.0
 +
REMAIN_CONSTANT          : 1
 +
TIME_SERIE                : 1
 +
OUTPUT_HDF                : 1
 +
<endproperty>
 +
 
 +
===Atmosphere wind velocity defined by time series===
 +
In case of time serie the user can
 +
 
 +
1) provide one file but two different collumns and two default values for x and y component (in this order).
 +
<beginproperty>
 +
NAME                      : wind velocity
 +
UNITS                    : m/s
 +
DESCRIPTION              : wind velocity
 +
FILE_IN_TIME              : TIMESERIE
 +
FILENAME                  : ..\General Data\Boundary Conditions\Velocity.srm
 +
DATA_COLUMN_X            : 2
 +
DATA_COLUMN_Y            : 3
 +
DEFAULTVALUE              : -1.0 0.0
 +
REMAIN_CONSTANT          : 1
 +
TIME_SERIE                : 1
 +
OUTPUT_HDF                : 1
 +
<endproperty>
 +
 
 +
OR
 +
2) can provide two files and respectve collumns and two default values for x and y component (in this order).
 +
<beginproperty>
 +
NAME                      : wind velocity
 +
UNITS                    : m/s
 +
DESCRIPTION              : wind velocity
 +
FILE_IN_TIME              : TIMESERIE
 +
FILENAME_X                : ..\General Data\Boundary Conditions\VelX.srm
 +
FILENAME_Y                : ..\General Data\Boundary Conditions\VelY.srm
 +
DATA_COLUMN_X            : 2
 +
DATA_COLUMN_Y            : 2
 +
DEFAULTVALUE              : -1.0 0.0
 +
REMAIN_CONSTANT          : 1
 +
TIME_SERIE                : 1
 +
OUTPUT_HDF                : 1
 +
<endproperty>
  
The same issue occurs with angle properties
+
<beginproperty>
 +
NAME                      : wind velocity
 +
UNITS                    : m/s
 +
DESCRIPTION              : solar radiation
 +
FILE_IN_TIME              : HDF
 +
FILENAME_X                : ..\General Data\Boundary Conditions\Atmosphere_11.hdf5
 +
FILENAME_Y                : ..\General Data\Boundary Conditions\Atmosphere_11.hdf5
 +
HDF_FIELD_NAME_X          : wind velocity X
 +
HDF_FIELD_NAME_Y          : wind velocity Y
 +
DEFAULTVALUE              : -1.0 0.0
 +
REMAIN_CONSTANT          : 1
 +
TIME_SERIE                : 1
 +
OUTPUT_HDF                : 1
 +
<endproperty>

Revision as of 02:11, 18 December 2015

Overview

This is a guide on configuring MOHID Water new way of defining vectorial properties. And a recall on angle properties computation.

Vectorial properties in MOHID have a X (zonal component) and Y (meridian component).

Angle properties in MOHID in ModuleAtmosphere and ModuleWaves have nautical referential (0º is wind or wave from N towards S, 90º is from East towards West and so on).


Old Way of definig vectorial properties and angle propeties

MOHID treated until now (Dez 2015) vectorial properties as two scalar properties, defined separately.

This an example of wind velocity X and wind velocity Y in Atmosphere_X.dat file:

<beginproperty>
NAME                      : wind velocity X
UNITS                     : m/s
DESCRIPTION               : wind velocity X
INITIALIZATION_METHOD     : CONSTANT
DEFAULTVALUE              : -1.0
REMAIN_CONSTANT           : 1
OUTPUT_HDF                : 0
<endproperty>

<beginproperty>
NAME                      : wind velocity Y
UNITS                     : m/s
DESCRIPTION               : wind velocity Y
INITIALIZATION_METHOD     : CONSTANT
DEFAULTVALUE              : 0.0
REMAIN_CONSTANT           : 1
OUTPUT_HDF                : 0
<endproperty>

This approach is straightforward to implement as Module FillMatrix treats all properties the same, reads the options fills the matrix and returns to calling modules.

However it creates one problem: how to deal with vectorial transformation from user input referential to the MOHID cell referential (if grid rotation and distortion exists).

The solution used until now was that each module would do its own transformations what could lead to conversion errors or lack of convertions.

The same issue occurs with angle properties where each module would do its own transformations what could lead to same problems.


The New Way of definig vectorial properties

The New age has arrived!

Only vectorial propeties have changed the input format. Angle properties are scalar properties so in terms of input there was no change.

In order to avoid the descentralization and repetition of the transformation process, the vectorial property concept was created in Module FillMatrix.

And both vectorial and angle tranformation are made inside Module FillMatrix and the resulting matrixes returned to modules are always in MOHID cell referential.

An example of the new vectorial input is in Module Atmosphere:

<beginproperty>
NAME                      : wind velocity
UNITS                     : m/s
DESCRIPTION               : wind velocity
DEFAULTVALUE              : -1.0 0.0
REMAIN_CONSTANT           : 1
OUTPUT_HDF                : 0
<endproperty>

That replaces the two properties wind velocity X and wind velocity Y.

The keyword DEFAULTVALUE can now read two or three components (if 3D property) istead of only one.


What are the Input/Output conventions used by all Modules?

Basically user inputs vecorial properties in zonal/meridional components (vectorial) and angles in nautical referential (atmosphere and waves) and MOHID in all modules uses interannly MOHID cell referential given by Module FillMatrix (after transformation from user referential).

To write output each module call again Module FillMatrix to get the fields in user input referential. So input and output is always in the zonal/meridional components (vectorial) and angles in nautical referential (atmosphere and waves)


What vectorial properties does the new approach changes in terms of data file definition?

Module Atmosphere

  1. wind velocity X and wind velocity Y are now only defined by wind velocity property


Module InterfaceWaterAir

  1. wind stress X and wind stress Y are now only defined by wind stress property

Module Waves

  1. radiation stress X and radiation stress Y are now only defined by radiation stress property


What kind of input type is allowed for the new vectorial properties?

for now only constant, timeserie, ascii_file and hdf inputs are allowed. However new developments are welcome for other types of input.


How does it work? (for code enthusiasts)

Module FillMatrix now behaves similarly as before but instead of each property can have only one field of type time serie, ascii file, hdf, now it can have more (two in 2D properties). The Module FillMatrix searches how many components it has and does the same old process on all of them, saving the results in different fields (e.g. component X and Y).

The modules that ask properties fields to fillmatrix also save information in different matrixes and calls to fillmatrix are very similar with one more field (the second component).


Examples

===Atmosphere wind velocity defined by ASCII grid===~ In case of ascii grid the user needs to provide two different files and two default values for x and y component (in this order).

<beginproperty>
NAME                      : wind velocity
UNITS                     : m/s
DESCRIPTION               : wind velocity
INITIALIZATION_METHOD     : ASCII_FILE
FILENAME_X                : ..\General Data\Boundary Conditions\ASCIIGrid_-1.dat
FILENAME_Y                : ..\General Data\Boundary Conditions\ASCIIGrid_0.dat
DEFAULTVALUE              : -1.0 0.0
REMAIN_CONSTANT           : 1
TIME_SERIE                : 1
OUTPUT_HDF                : 1
<endproperty>

Atmosphere wind velocity defined by time series

In case of time serie the user can

1) provide one file but two different collumns and two default values for x and y component (in this order).

<beginproperty>
NAME                      : wind velocity
UNITS                     : m/s
DESCRIPTION               : wind velocity
FILE_IN_TIME              : TIMESERIE
FILENAME                  : ..\General Data\Boundary Conditions\Velocity.srm
DATA_COLUMN_X             : 2
DATA_COLUMN_Y             : 3
DEFAULTVALUE              : -1.0 0.0
REMAIN_CONSTANT           : 1
TIME_SERIE                : 1
OUTPUT_HDF                : 1
<endproperty>

OR 2) can provide two files and respectve collumns and two default values for x and y component (in this order).

<beginproperty>
NAME                      : wind velocity
UNITS                     : m/s
DESCRIPTION               : wind velocity
FILE_IN_TIME              : TIMESERIE
FILENAME_X                : ..\General Data\Boundary Conditions\VelX.srm
FILENAME_Y                : ..\General Data\Boundary Conditions\VelY.srm
DATA_COLUMN_X             : 2
DATA_COLUMN_Y             : 2
DEFAULTVALUE              : -1.0 0.0
REMAIN_CONSTANT           : 1
TIME_SERIE                : 1
OUTPUT_HDF                : 1
<endproperty>

<beginproperty> NAME  : wind velocity UNITS  : m/s DESCRIPTION  : solar radiation FILE_IN_TIME  : HDF FILENAME_X  : ..\General Data\Boundary Conditions\Atmosphere_11.hdf5 FILENAME_Y  : ..\General Data\Boundary Conditions\Atmosphere_11.hdf5 HDF_FIELD_NAME_X  : wind velocity X HDF_FIELD_NAME_Y  : wind velocity Y DEFAULTVALUE  : -1.0 0.0 REMAIN_CONSTANT  : 1 TIME_SERIE  : 1 OUTPUT_HDF  : 1 <endproperty>