Personal tools

Difference between revisions of "Module LagrangianGlobal"

From MohidWiki

Jump to: navigation, search
Line 8: Line 8:
 
3 - Avoid redundances in the particle origin definitions. This way is possible to compress the input file (Lagrangian_x.dat).
 
3 - Avoid redundances in the particle origin definitions. This way is possible to compress the input file (Lagrangian_x.dat).
  
 
+
=== Goal 1 - Run only one Lagrangian Model ===
 
 
  
 
The LagrangianGlobal module is a module very similar to the [[Module Lagrangian|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).  
 
The LagrangianGlobal module is a module very similar to the [[Module Lagrangian|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).  
Line 24: Line 23:
 
If the mohid user wants to activate this module it needs to predefined a preprocessor symbol called _LAGRANGIAN_GLOBAL_ in the compilation phase of the mohid.
 
If the mohid user wants to activate this module it needs to predefined a preprocessor symbol called _LAGRANGIAN_GLOBAL_ in the compilation phase of the mohid.
  
 +
=== Goal 2 - Centralize all interpolation and particle location methods ===
  
  
 +
=== Goal 3 - Decrease redundances in Lagrangian_x.dat ===
  
== Relative position of tracer in a generic cell ==
+
To decrease this redundance the "clone origin" concept was created.  
 
 
A fundamental in the "MOHID system" lagrangian approach is to know the relative position of the tracer in the hydrodynamic cell to speed up the interpolation procedure. This is quite easy for square cells however this not the case for cells of curvilinear grids . In this case was develop a subroutine that is able to compute the generic position of a tracer in a generic cell (see subroutine RelativePosition4VertPolygon in module functions). The algorithm used is described below.
 
 
 
[[Image:FromGenericToSquare.jpg|850px|thumb|center|'''Relative position of tracer in a generic cell''']]
 
 
 
 
<math> y_1  = a_1  + b_1 x_1  \wedge a_1  = {{x_d y_c  - x_c y_d } \over {x_d  - x_c }} \wedge b_1  = {{y_d  - y{}_c} \over {x_d  - x_c }} </math>
 
 
 
<math> y_2  = a_2  + b_2 x_2  \wedge a_2  = {{x_b y_a  - x_a y_b } \over {x_b  - x_a }} \wedge b_2  = {{y_b  - y{}_a} \over {x_b  - x_a }} </math>
 
 
 
<math> y_3  = a_3  + b_3 x_3  \wedge a_3  = {{x_a y_c  - x_c y_a } \over {x_a  - x_c }} \wedge b_3  = {{x_a  - x_c } \over {y_a  - y{}_c}} </math>
 
 
 
<math> y_4  = a_4  + b_4 x_4  \wedge a_4  = {{x_b y_d  - x_d y_b } \over {x_b  - x_d }} \wedge b_4  = {{x_b  - x_d } \over {y_b  - y{}_d}} </math>
 
 
 
 
 
<math> y_g  = {{a_3  - a_4 } \over {b_4  - b_3 }} \wedge x_g  = a_3  + b_3 y_g </math>
 
 
 
if (b1==b2) then
 
<math> tg\alpha  = b_2</math> 
 
else
 
<math> x_f  = {{a_1  - a_2 } \over {b_2  - b_1 }} \wedge y_f  = a_1  + b_1 x_f </math>
 
<math> tg\alpha  = {{y_e  - y_f } \over {x_e  - x_f }} </math>
 
endif
 
 
 
<math> y_h  = {{y_e  + \left( {a_3  - x_e } \right)Tg\alpha } \over {1 - b_3 Tg\alpha }} \wedge x_h  = a_3  + b_3 y_h </math>
 
 
 
if (b3==b4) then
 
<math> tg\beta  = b_3 </math> 
 
else
 
<math> x_g  = {{a_3  - a_4 } \over {b_4  - b_3 }} \wedge y_g  = a_3  + b_3 x_g </math> 
 
<math> tg\beta  = {{y_e  - y_g } \over {x_e  - x_g }} </math>
 
endif
 
 
 
<math> y_i  = {{y_e  + \left( {a_1  - x_e } \right)Tg\beta } \over {1 - b_1 Tg\beta }} \wedge x_i  = a_1  + b_1 y_i </math>
 
 
 
 
 
<math> seg\_ac = \sqrt {\left( {x_a  - x_c } \right)^2  + \left( {y_a  - y_c } \right)^2 } </math>
 
 
 
<math> seg\_dc = \sqrt {\left( {x_d  - x_c } \right)^2  + \left( {y_d  - y_c } \right)^2 } </math>
 
 
 
<math> seg\_ic = \sqrt {\left( {x_i  - x_c } \right)^2  + \left( {y_i  - y_c } \right)^2 } </math>
 
 
 
<math> seg\_hc = \sqrt {\left( {x_h  - x_c } \right)^2  + \left( {y_h  - y_c } \right)^2 } </math>
 
 
 
<math> x_e^'  = {{Seg\_ic} \over {Seg\_dc}} </math>
 
  
<math> y_e^'  = {{Seg\_hc} \over {Seg\_ac}} </math>
 
  
 
[[Category:Modules]]
 
[[Category:Modules]]
 
[[Category:MOHID Water]]
 
[[Category:MOHID Water]]

Revision as of 15:08, 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 (Media:SideBySideCloud.gif). 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 Module HorizontalGrid 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).

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 first model are the one with the higher priority.

If the mohid user wants to activate this module it needs to predefined a preprocessor symbol called _LAGRANGIAN_GLOBAL_ in the compilation phase of the mohid.

Goal 2 - Centralize all interpolation and particle location methods

Goal 3 - Decrease redundances in Lagrangian_x.dat

To decrease this redundance the "clone origin" concept was created.