Personal tools

Difference between revisions of "Module LagrangianGlobal"

From MohidWiki

Jump to: navigation, search
Line 41: Line 41:
 
=== Goal 2 - Centralize all interpolation and particle location methods ===
 
=== Goal 2 - Centralize all interpolation and particle location methods ===
  
In the [[Module Lagrangian|Lagrangian module]] the interpolation and particle location methods were developed in a independent way of similar methods implemented in the [[Module HorizontalGrid|HorizontalGrid Module]] for the [[Module Hydrodynamic|hydrodynamic]] and [[Module WaterProperties|water properties]] nesting.   
+
In the [[Module Lagrangian|Lagrangian module]] the interpolation and particle location methods were developed in a independent way of similar methods implemented in the [[Module HorizontalGrid|HorizontalGrid Module]] for the [[Module Hydrodynamic|hydrodynamic]] and [[Module WaterProperties|water properties]] nesting. Now the lagrangian mdoule uses the same interpolation and location methods as the Eulerian modules. The subroutines from the HorizontalGrid Module used in the LagrangianGlobal Module are:
 +
 
 +
  - GetXYInsideDomain
 +
 
 +
Check if a location X,Y (eg. particle location) is inside a specific model domain;
 +
 
 +
- GetXYCellZ
 +
 
 +
For a location X,Y (eg. particle location) and a specific model domain returns the correspondent cell (i,j) and even the relative position of the location inside the cell;
 +
 
 +
- GetCellZ_XY
 +
 
 +
Do the inverse process ofsuborutine  GetXYCellZ
 +
 
 +
- InterpolXYPoint
 +
 
 +
Interpolate a generic property for a location X,Y.
 +
 
 +
All this subroutines work in all [[Grid|grid]] types support by Mohid (uniform variable and constant spatial step, uniform rotate and curvilinear).
 +
 
 +
 +
 
 
[[Relative position of a particle in a cell]]  
 
[[Relative position of a particle in a cell]]  
  

Revision as of 18:55, 21 March 2011

Overview

The LangrangianGlobal Module is a deep upgrade of the Lagrangian Module. These upgrade has three main goals:

1 - Run only one lagrangian model in a multi-nesting implementation. This way particles can go from grid to grid without any problems (see example of particles moving between grids). In the Lagrangian module particles are destroyed when they leave the grid where they were emitted. This is the reason way a lagrangian model is runned for each grid in the Lagrangian Module;

2 - Centralise all the interpolation and particle location (in a grid) methods in the HorizontalGrid Module and (see source code [1]);

3 - Avoid redundances in the particle origin definitions. This way is possible to compress the input file (Lagrangian_x.dat).


Related projects

This development was made by Hidromod in the framework of the follow projects:

- EASY - Interreg project - Hidromod subcontract by IST - Debry tracjetory forecast in ocean/coastal domains

- CoWaMa Hidromod subcontract by Clabsa and Lyonnaise-des-Eaux - Forecast of fecal contamination in beaches

- Lenvis - FP7 - Hidromod consortium member - Web model service focus in simulating the impact of emergency fecal contamination discharges;

- Argomarine - FP7 project - Hidromod subcontract by Algarve University - FP7 - Implementation of a oil spill forecast model in the Toscanny region (Italy)

- EASYCO - Interreg project - Hidromod subcontract by IST - Data analysis and oil spill modelling via web

Main upgrades

Goal 1 - Run only one Lagrangian Model

The LagrangianGlobal module is a module very similar to the Lagrangian module. The input data file keywords are exactly the same. The modules give the same lagrangian result if the user only runs one model (no nesting). In the case of the first module when are run several nesting levels. The user only define one lagrangian input data file in the data file of the first nesting level (first model in the tree.dat). Each lagrangian tracer will use the hydrodynamic field with the higher priority depending on the tracer position. By default the priority is define inverting the tree.dat order. The user can specify the oder using a block define in the lagrangian input file where the user can define the model priority:

<BeginModelPriority> 
Model name x
Model name y
<EndModelPriority>

The model are order by decreasing priority. If the mohid user wants to activate this module it needs in the mohid compilation process to predefined a preprocessor symbol called _LAGRANGIAN_GLOBAL_ in the compilation phase of the mohid.

Goal 2 - Centralize all interpolation and particle location methods

In the Lagrangian module the interpolation and particle location methods were developed in a independent way of similar methods implemented in the HorizontalGrid Module for the hydrodynamic and water properties nesting. Now the lagrangian mdoule uses the same interpolation and location methods as the Eulerian modules. The subroutines from the HorizontalGrid Module used in the LagrangianGlobal Module are:

- GetXYInsideDomain

Check if a location X,Y (eg. particle location) is inside a specific model domain;

- GetXYCellZ 

For a location X,Y (eg. particle location) and a specific model domain returns the correspondent cell (i,j) and even the relative position of the location inside the cell;

- GetCellZ_XY

Do the inverse process ofsuborutine GetXYCellZ

- InterpolXYPoint

Interpolate a generic property for a location X,Y.

All this subroutines work in all grid types support by Mohid (uniform variable and constant spatial step, uniform rotate and curvilinear).


Relative position of a particle in a cell


Goal 3 - Decrease redundances in Lagrangian_x.dat

To decrease this redundance the "clone origin" concept was created. There are several Lagrangian Origins options.

Ilustrative examples of new options

Clone Origin concept

Fecal contamination variable discharges - CoWaMa

<BeginGeneralKeywords>
OUTPUT_TIME                    : 0 3600
RESTART_FILE_OUTPUT_TIME       : 0 3600
RESTART_FILE_OVERWRITE         : 0
DT_PARTIC                      : 100
PARTIC_BOX                     : ..\..\LEVEL1_VALIDATIONECOLI\..\Lagrangian\Level2Validation\data\BOXRESTARTFILE_Lagrangian.dat
TIME_SERIE_LOCATION            : ..\..\LEVEL1_VALIDATIONECOLI\..\Lagrangian\Level2Validation\data\TimeSeriesLocationLag.dat
OUTPUT_CONC                    : 2
LW_PERCENTAGE                  : .4
LW_EXTINCTION_COEF             : .3333333
SW_PERCENTAGE                  : .6
SW_EXTINCTION_TYPE             : 3
IGNORE_ON                      : 1
<EndGeneralKeywords>
<BeginModelPriority>
Level3ValidationEcoli
Level2Validation
<EndModelPriority> 
<BeginOrigin>
GROUP_ID                       : 1
ORIGIN_NAME                    : Default
DEFAULT                        : 1
EMISSION_SPATIAL               : Point
EMISSION_TEMPORAL              : Continuous
EMISSION_ON                    : 1
OLD                            : 0
POSITION_COORDINATES           : 0. 0.
MOVEMENT                       : SullivanAllen
VARVELHX                       : 0.2
VARVELH                        : 0.1
TURB_V                         : Constant
VARVELVX                       : 0.02
VARVELV                        : 0.01
DT_EMIT                        : 100
TVOL200                        : 7200.
VOLFAC                         : 100.
DEPTH_METERS                   : 0.
NBR_PARTIC                     : 1
POINT_VOLUME                   : 1
ESTIMATE_MIN_VOL               : 1
MAX_PART                       : 1000
FLOW                           : -9e16
FLOW_VARIABLE                  : 1
FLOW_COLUMN                    : 2
DISCHARGE_FILE                 : *****.***
!    T90_VAR_METHOD =  Canteras             = 1
!    T90_VAR_METHOD =  Chapra               = 2
!    T90_VAR_METHOD =  TimeSerie            = 3
<<BeginProperty>>
NAME                           : fecal coliforms
UNITS                          : MPN/100ml
CONCENTRATION                  : 0
CONC_VARIABLE                  : 1
CONC_COLUMN                    : 2
DISCHARGE_FILE                 : *****.***
T90_VARIABLE                   : 0
T90_VAR_METHOD                 : 0
T90                            : 10800
T90_FILE                       : T902.dat
T90_COLUMN                     : 2
OUTPUT_HDF                     : 1
TIME_SERIE                     : 0
<<EndProperty>>
<<BeginProperty>>
NAME                           : escherichia coli
UNITS                          : MPN/100ml
CONCENTRATION                  : 0
CONC_VARIABLE                  : 1
CONC_COLUMN                    : 2
DISCHARGE_FILE                 : *****.***
T90_VARIABLE                   : 0
T90_VAR_METHOD                 : 3
T90                            : 10800
T90_FILE                       : ..\..\LEVEL1_VALIDATIONECOLI\..\Lagrangian\Level2Validation\data\DailyT90.srw
T90_COLUMN                     : 2
OUTPUT_HDF                     : 1
TIME_SERIE                     : 0
<<EndProperty>>
<<BeginProperty>>
NAME                           : temperature
UNITS                          : ?C Summer temperature
CONCENTRATION                  : 0
OUTPUT_HDF                     : 1
TIME_SERIE                     : 0
<<EndProperty>>
<<BeginProperty>>
NAME                           : salinity
UNITS                          : ppm
CONCENTRATION                  : 0
OUTPUT_HDF                     : 1
TIME_SERIE                     : 0
<<EndProperty>>
<<BeginProperty>>
NAME                           : cohesive sediment
UNITS                          : mg/l
CONCENTRATION                  : 0
OUTPUT_HDF                     : 1
TIME_SERIE                     : 0
<<EndProperty>>
<EndOrigin>
<BeginOrigin_Clone>
CLONE                          : Default
DEFAULT                        : 0
GROUP_ID                       : 1
ORIGIN_NAME                    : Discharge 1
EMISSION_SPATIAL               : Point
EMISSION_TEMPORAL              : Continuous
DISCHARGE_FILE                 : ..\..\LEVEL1_VALIDATIONECOLI\..\Lagrangian\Level2Validation\data\DISCHARGE_Discharge 1.dat
POSITION_COORDINATES           : 1.3 41.11
OLD                            : 0
DEPTH_METERS                   : 1000000
<<BeginProperty>>
NAME                           : salinity
UNITS                          : PSU
CONCENTRATION                  : 0.2
<<EndProperty>>
<<BeginProperty>>
NAME                           : temperature
UNITS                          : ºC
CONCENTRATION                  : 19.5
<<EndProperty>>
<<BeginProperty>>
NAME                           : cohesive sediment
UNITS                          : mg/l
CONCENTRATION                  : 100
<<EndProperty>>
<<BeginProperty>>
NAME                           : fecal coliforms
UNITS                          : MPN/100ml
CONCENTRATION                  : 100000
DISCHARGE_FILE                 : ..\..\LEVEL1_VALIDATIONECOLI\..\Lagrangian\Level2Validation\data\DISCHARGE_FECAL_COLIFORMSDischarge 1.dat
<<EndProperty>>
<<BeginProperty>>
NAME                           : escherichia coli
UNITS                          : MPN/100ml
CONCENTRATION                  : 100000
DISCHARGE_FILE                 : ..\..\LEVEL1_VALIDATIONECOLI\..\Lagrangian\Level2Validation\data\DISCHARGE_E_COLIDischarge 1.dat
<<EndProperty>>
<EndOrigin_Clone>