|
TheBoussinesqModel
3.2.1
|
Go to the source code of this file.
Data Structures | |
| struct | PARAM |
| struct | FLAG |
| struct | OUTPUT_FILENAMES |
Functions | |
| double | t_st_operator_element (long i, DOUBLEVECTOR *eta) |
| double | t_st_operator_element_no_dirichlet (long i, DOUBLEVECTOR *eta) |
| double | t_st_operator_element_subs (long i, DOUBLEVECTOR *eta, double cond_dirichlet) |
| double | water_surface_elevation_mean (double eta1, double eta2) |
| double | b_smatrix_element (long i, DOUBLEVECTOR *x) |
| int | b_smatrix (DOUBLEVECTOR *y, DOUBLEVECTOR *x) |
| long | Newton_convergence (DOUBLEVECTOR *x_temp, DOUBLEVECTOR *be, DOUBLEVECTOR *be0) |
| int | time_loop (short print, int(*write_output)(void *v1, void *v2)) |
| int | write_map_results (void *output, void *time_string) |
| OUTPUT_FILENAMES * | new_output_filenames (short print) |
| void | free_OUTPUT_FILENAMES (OUTPUT_FILENAMES *fn) |
This file is part of Boussinesq.
Boussinesq is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Boussinesq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Boussinesq. If not, see http://www.gnu.org/licenses/.
Definition in file b_solver.h.
| int b_smatrix | ( | DOUBLEVECTOR * | y, |
| DOUBLEVECTOR * | x | ||
| ) |
| double b_smatrix_element | ( | long | i, |
| DOUBLEVECTOR * | x | ||
| ) |
| i | - index of the polygon at which t_st_operator_element is calculated |
| eta | - (DOUBLEVECTOR *) vector of the unknowns |
Function inverted and solved with a preconditioned conjugate gradient method obtained as follows:
\[ \left[ \mathbf{T} \cdot \eta^{n+1} \right]_{i}= -\Delta t^{n} \, \sum_{j \in S_i} \, K_S \, A_j(\eta^n_{i,m(i,j)})\frac{x_{m(i,j)}^{n+1}-x_{i}^{n+1}}{\delta_{i,m(i,j)}}+ Ws(^m\eta^{n+1})x_i \]
which is the t_st_operator_element() function plus x_i multiplied the wet area of the i-th pixel. This function has the same signature of t_st_operator_element() Please see the documentation in pdf with the algebraic passages for further details.
Definition at line 274 of file b_solver.c.
References PARAM::deta, MIN_T_DIAG_NEGATIVE_INDEX, PARAM::null_dirichlet, t_st_operator_element_no_dirichlet(), and wet_area().
Referenced by Newton_convergence().
| void free_OUTPUT_FILENAMES | ( | OUTPUT_FILENAMES * | fn) |
Definition at line 801 of file b_solver.c.
References OUTPUT_FILENAMES::file_error, and OUTPUT_FILENAMES::file_result.
Referenced by time_loop().
| OUTPUT_FILENAMES* new_output_filenames | ( | short | print) |
Definition at line 782 of file b_solver.c.
References copy_string(), OUTPUT_FILENAMES::file_error, OUTPUT_FILENAMES::file_result, O_COARSEMAP_WATERMASS_ERROR, O_COARSEMAP_WATERSURFACE_ELEVATION, and t_error().
Referenced by time_loop().
| long Newton_convergence | ( | DOUBLEVECTOR * | x_temp, |
| DOUBLEVECTOR * | be, | ||
| DOUBLEVECTOR * | be0 | ||
| ) |
| x_term | (DOUBLEVECTOR *) x_term - doublevector of residuals (unkowns) |
| be | (DOUBLEVECTOR *) be - known term of the equation in Newton Itaration Method (balance equation); |
| be0 | (DOUBLEVECTOR *) be - known term of the equation in .... (balance equation);
|
Definition at line 367 of file b_solver.c.
References b_smatrix_element(), free_doublevector(), jacobi_preconditioned_conjugate_gradient_search(), join_strings(), max_doublevector(), PARAM::max_errors, MIN_T_DIAG, MIN_T_DIAG_NEGATIVE_INDEX, new_doublevector(), DOUBLEVECTOR::nh, DOUBLEVECTOR::nl, PARAM::null_dirichlet, t_st_operator_element(), volume(), wpath, and PARAM::x_temp_adm.
Referenced by time_loop().
| double t_st_operator_element | ( | long | i, |
| DOUBLEVECTOR * | eta | ||
| ) |
Definition at line 75 of file b_solver.c.
References MAX_ELEVATION_VALUE, t_st_advection_operator_element(), and t_st_operator_element_subs().
Referenced by Newton_convergence(), and time_loop().
| double t_st_operator_element_no_dirichlet | ( | long | i, |
| DOUBLEVECTOR * | eta | ||
| ) |
Definition at line 87 of file b_solver.c.
References PARAM::null_dirichlet, t_st_advection_operator_element(), and t_st_operator_element_subs().
Referenced by b_smatrix_element(), and time_loop().
| double t_st_operator_element_subs | ( | long | i, |
| DOUBLEVECTOR * | eta, | ||
| double | cond_dirichlet | ||
| ) |
| i | - index of the polygon at which t_st_operator_element is calculated |
| eta | - (DOUBLEVECTOR *) vector of the unknowns |
| cond_dirichlet | - (double) (=MAX_ELEVATION_VALUE) in case dirichlet value are neglected or (=param->null_dirichlet) othrwise (added by ec on 20100517) |
This function calculates the i-th element of the following vector
where eta is the vector of the independent variables
\[ \left[ \mathbf{T} \cdot \eta^{n+1} \right]_{i}= -\Delta t^{n} \, \sum_{j \in S_i} \, K_S \, A_j(\eta^n_{i,m(i,j)})\frac{\eta_{m(i,j)}^{n+1}-\eta_{i}^{n+1}}{\delta_{i,m(i,j)}} \]
Please see the pdf documentation with the algebraic passages for major details.
Definition at line 99 of file b_solver.c.
References GRID::boundary_indicator, DOUBLE_GRID::coarse, polygon_connection_attributes::connections, polygon_connection_attributes::d_connections, PARAM::dt, POLYGON::edge_indices, POLYGONVECTOR::element, polygon_connection_attribute_array::element, PARAM::Ks, GRID::links, LONGVECTOR::nl, GRID::polygons, vertical_area_subs(), and water_surface_elevation_mean().
Referenced by t_st_operator_element(), and t_st_operator_element_no_dirichlet().
| int time_loop | ( | short | print, |
| int(*)(void *v1, void *v2) | write_output | ||
| ) |
| (short) | - print FLuidTurtle Parametesrs |
| int | (*write_output)(void *v1, void *v2) - function which writes the output for every requested time steps |
In this routin the discretized system equation:
\[ \mathbf{V}(\eta^{n+1})+\mathbf{T} \cdot \eta^{n+1} = \mathbf{b3} \]
is solved. Please see the meanings of the symbols in the pdf documentation with algebraic passages. The nonlinear equation system is solved with a Newtton-like
Definition at line 548 of file b_solver.c.
References POLYGON::area2D, b_advection(), DOUBLE_GRID::coarse, PARAM::dt, PARAM::dt_print, POLYGONVECTOR::element, free_doublevector(), free_OUTPUT_FILENAMES(), free_s_times(), get_diagonal(), get_dirichletsnode(), get_s_times(), get_sources(), I_DIRICHLETTIMES_FT_FILE, I_TIMES_FT_FILE, new_doublevector(), new_output_filenames(), Newton_convergence(), DOUBLEVECTOR::nh, DOUBLEVECTOR::nl, PARAM::null_dirichlet, GRID::polygons, q_discharge_from_outlet_cell(), PARAM::t, PARAM::t_end, t_st_operator_element(), t_st_operator_element_no_dirichlet(), PARAM::t_start, update_F1_wet_vert_area(), update_velocity(), volume(), and write_suffix().
Referenced by main().
| double water_surface_elevation_mean | ( | double | eta1, |
| double | eta2 | ||
| ) |
Definition at line 714 of file b_solver.c.
References FLAG::arithmetic_mean0.
Referenced by b_advection(), t_st_advection_operator_element(), t_st_operator_element_subs(), update_F1_wet_vert_area(), and update_velocity().
| int write_map_results | ( | void * | output, |
| void * | time_string | ||
| ) |
Definition at line 735 of file b_solver.c.
References DOUBLESQUARE_GRID::big, DOUBLERASTER_MAP::coarse, DTM_MASK, OUTPUT_FILENAMES::file_error, OUTPUT_FILENAMES::file_result, SQUARE_GRID::indices_pixel, join_strings(), RASTER_MAP::layer, RASTER_MAP::UV, write_doublevector_in_a_ascii_ft_format_single_file(), and write_raster_from_doublevector().
Referenced by main().