Flow123d
JS_before_hm-1008-g3dab983
|
#include <transport.h>
Classes | |
class | EqData |
Public Types | |
typedef ConcentrationTransportBase | FactoryBaseType |
Public Types inherited from ConcentrationTransportBase | |
typedef std::vector< std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > > | FieldFEScalarVec |
Public Member Functions | |
ConvectionTransport (Mesh &init_mesh, const Input::Record in_rec) | |
virtual | ~ConvectionTransport () |
void | initialize () override |
void | zero_time_step () override |
bool | evaluate_time_constraint (double &time_constraint) override |
void | update_solution () override |
void | compute_p0_interpolation () override |
void | update_after_reactions (bool) override |
Not used in this class. More... | |
void | set_target_time (double target_time) override |
void | set_balance_object (std::shared_ptr< Balance > balance) override |
const vector< unsigned int > & | get_subst_idx () override |
Return substance indices used in balance. More... | |
virtual void | output_data () override |
Write computed fields. More... | |
void | set_output_stream (std::shared_ptr< OutputTime > stream) override |
Setter for output stream. More... | |
std::shared_ptr< OutputTime > | output_stream () override |
FieldFEScalarVec & | get_p0_interpolation () override |
Getter for P0 interpolation by FieldFE. More... | |
Vec | get_component_vec (unsigned int sbi) override |
Return PETSc vector with solution for sbi-th substance. More... | |
void | get_par_info (LongIdx *&el_4_loc, Distribution *&el_ds) override |
Return array of indices of local elements and parallel distribution of elements. More... | |
LongIdx * | get_row_4_el () override |
Return global array of order of elements within parallel vector. More... | |
unsigned int | n_substances () override |
Returns number of transported substances. More... | |
SubstanceList & | substances () override |
Returns reference to the vector of substance names. More... | |
Public Member Functions inherited from ConcentrationTransportBase | |
ConcentrationTransportBase (Mesh &init_mesh, const Input::Record in_rec) | |
Public Member Functions inherited from EquationBase | |
EquationBase () | |
EquationBase (Mesh &mesh, const Input::Record in_rec) | |
virtual | ~EquationBase () |
virtual void | choose_next_time () |
virtual void | set_time_upper_constraint (double dt, std::string message) |
virtual void | set_time_lower_constraint (double dt, std::string message) |
TimeGovernor & | time () |
virtual void | set_time_governor (TimeGovernor &time) |
double | planned_time () |
double | solved_time () |
Mesh & | mesh () |
std::shared_ptr< Balance > | balance () const |
TimeMark::Type | mark_type () |
FieldSet & | data () |
Static Public Member Functions | |
static const Input::Type::Record & | get_input_type () |
static const IT::Selection & | get_output_selection () |
Static Public Member Functions inherited from ConcentrationTransportBase | |
static Input::Type::Abstract & | get_input_type () |
Common specification of the input record for secondary equations. More... | |
Static Public Member Functions inherited from EquationBase | |
static Input::Type::Record & | record_template () |
Template Record with common keys for derived equations. More... | |
Private Member Functions | |
void | create_transport_matrix_mpi () |
void | create_mass_matrix () |
void | make_transport_partitioning () |
void | set_initial_condition () |
void | read_concentration_sources () |
void | set_boundary_conditions () |
void | compute_concentration_sources () |
Assembles concentration sources for each substance. note: the source of concentration is multiplied by time interval (gives the mass, not the flow like before) More... | |
void | transport_matrix_step_mpi (double time_step) |
void | alloc_transport_vectors () |
void | alloc_transport_structs_mpi () |
double | side_flux (const DHCellSide &cell_side) |
Wrapper of following method, call side_flux with correct template parameter. More... | |
template<unsigned int dim> | |
double | calculate_side_flux (const DHCellSide &cell) |
Calculate flux on side of given element specified by dimension. More... | |
Private Attributes | |
EqData | data_ |
double ** | sources_corr |
Vec * | v_sources_corr |
TimeMark::Type | target_mark_type |
TimeMark type for time marks denoting end of every time interval where transport matrix remains constant. More... | |
double | cfl_max_step |
Time step constraint coming from CFL condition. More... | |
Vec | vcfl_flow_ |
Parallel vector for flow contribution to CFL condition. More... | |
Vec | vcfl_source_ |
Parallel vector for source term contribution to CFL condition. More... | |
double * | cfl_flow_ |
double * | cfl_source_ |
VecScatter | vconc_out_scatter |
Mat | tm |
Vec | mass_diag |
Vec | vpmass_diag |
Vec * | v_tm_diag |
double ** | tm_diag |
double | transport_matrix_time |
double | transport_bc_time |
Time of the last update of the boundary condition terms. More... | |
Vec * | vpconc |
Vec * | bcvcorr |
Vec * | vcumulative_corr |
double ** | cumulative_corr |
const Input::Record | input_rec |
Record with input specification. More... | |
std::shared_ptr< OutputTime > | output_stream_ |
LongIdx * | row_4_el |
LongIdx * | el_4_loc |
Distribution * | el_ds |
SubstanceList | substances_ |
Transported substances. More... | |
std::shared_ptr< DOFHandlerMultiDim > | dh_ |
vector< unsigned int > | subst_idx |
List of indices used to call balance methods for a set of quantities. More... | |
FETransportObjects | feo_ |
Finite element objects. More... | |
bool | is_convection_matrix_scaled |
bool | is_src_term_scaled |
bool | is_bc_term_scaled |
bool | is_mass_diag_changed |
Flag indicates that porosity or cross_section changed during last time. More... | |
Static Private Attributes | |
static const int | registrar |
Registrar of class to factory. More... | |
Friends | |
class | TransportOperatorSplitting |
Additional Inherited Members | |
Protected Attributes inherited from EquationBase | |
bool | equation_empty_ |
flag is true if only default constructor was called More... | |
Mesh * | mesh_ |
TimeGovernor * | time_ |
Input::Record | input_record_ |
FieldSet * | eq_data_ |
std::shared_ptr< Balance > | balance_ |
object for calculation and writing the mass balance to file. More... | |
Class that implements explicit finite volumes scheme with upwind. The timestep is given by CFL condition.
Definition at line 118 of file transport.h.
Definition at line 149 of file transport.h.
ConvectionTransport::ConvectionTransport | ( | Mesh & | init_mesh, |
const Input::Record | in_rec | ||
) |
Constructor.
Definition at line 158 of file transport.cc.
|
virtual |
TODO: destructor
Definition at line 256 of file transport.cc.
|
private |
|
private |
|
private |
Calculate flux on side of given element specified by dimension.
Definition at line 899 of file transport.cc.
|
private |
Assembles concentration sources for each substance. note: the source of concentration is multiplied by time interval (gives the mass, not the flow like before)
Definition at line 457 of file transport.cc.
|
inlineoverridevirtual |
Compute P0 interpolation of the solution (used reaction term). Empty - solution is already P0 interpolation.
Implements ConcentrationTransportBase.
Definition at line 185 of file transport.h.
|
private |
|
private |
Assembly convection term part of the matrix and boundary matrix for application of boundary conditions.
Discretization of the convection term use explicit time scheme and finite volumes with full upwinding. We count on with exchange between dimensions and mixing on edges where more then two elements connect (can happen for 2D and 1D elements in 3D embedding space)
In order to get multiplication matrix for explicit transport one have to scale the convection part by the acctual time step and add time term, i. e. unit matrix (see. transport_matrix_step_mpi)
Updates CFL time step constrain.
Definition at line 770 of file transport.cc.
|
overridevirtual |
Evaluates CFL condition. Assembles the transport matrix and vector (including sources, bc terms).
time_constraint | is the value CFL constraint (return parameter) |
Implements ConcentrationTransportBase.
Definition at line 541 of file transport.cc.
|
overridevirtual |
Return PETSc vector with solution for sbi-th substance.
Implements ConcentrationTransportBase.
Definition at line 220 of file transport.cc.
|
static |
Definition at line 73 of file transport.cc.
|
static |
|
overridevirtual |
Getter for P0 interpolation by FieldFE.
Implements ConcentrationTransportBase.
Definition at line 853 of file transport.cc.
|
overridevirtual |
Return array of indices of local elements and parallel distribution of elements.
Implements ConcentrationTransportBase.
Definition at line 857 of file transport.cc.
|
overridevirtual |
Return global array of order of elements within parallel vector.
Implements ConcentrationTransportBase.
Definition at line 867 of file transport.cc.
|
inlineoverridevirtual |
Return substance indices used in balance.
Implements ConcentrationTransportBase.
Definition at line 213 of file transport.h.
|
overridevirtual |
This method should initialize fields of the equation. All members (e.g. number of components) that are necessary for the field initialization must be set between construction and call of initialize. After this method the upper level coupling may set sharing of some fields between equations.
Reimplemented from EquationBase.
Definition at line 181 of file transport.cc.
|
private |
|
inlineoverridevirtual |
Returns number of transported substances.
Implements ConcentrationTransportBase.
Definition at line 241 of file transport.h.
|
overridevirtual |
Write computed fields.
Reimplemented from EquationBase.
Definition at line 873 of file transport.cc.
|
inlineoverridevirtual |
|
private |
|
overridevirtual |
Use Balance object from upstream equation (e.g. in various couplings) instead of own instance.
Implements ConcentrationTransportBase.
Definition at line 885 of file transport.cc.
|
private |
|
private |
|
inlineoverridevirtual |
Setter for output stream.
Implements ConcentrationTransportBase.
Definition at line 221 of file transport.h.
|
overridevirtual |
Set time interval which is considered as one time step by TransportOperatorSplitting. In particular the velocity field doesn't change over this interval.
Dependencies:
velocity, porosity -> matrix, source_vector matrix -> time_step
data_read_times -> time_step (not necessary if we won't stick to jump times) data -> source_vector time_step -> scaling
Implements ConcentrationTransportBase.
Definition at line 711 of file transport.cc.
|
private |
Wrapper of following method, call side_flux with correct template parameter.
Definition at line 891 of file transport.cc.
|
inlineoverridevirtual |
Returns reference to the vector of substance names.
Implements ConcentrationTransportBase.
Definition at line 245 of file transport.h.
|
private |
Finish explicit transport matrix (time step scaling)
|
inlineoverridevirtual |
Not used in this class.
Implements ConcentrationTransportBase.
Definition at line 188 of file transport.h.
|
overridevirtual |
Calculates one time step of explicit transport.
Reimplemented from EquationBase.
Definition at line 608 of file transport.cc.
|
overridevirtual |
Initialize solution at zero time.
Reimplemented from EquationBase.
Definition at line 516 of file transport.cc.
|
friend |
Definition at line 373 of file transport.h.
|
private |
Definition at line 343 of file transport.h.
|
private |
Definition at line 325 of file transport.h.
|
private |
Time step constraint coming from CFL condition.
Definition at line 321 of file transport.h.
|
private |
Definition at line 325 of file transport.h.
|
private |
Definition at line 345 of file transport.h.
|
private |
Parameters of the equation, some are shared with other implementations since EqData is derived from TransportBase::TransportEqData
Definition at line 302 of file transport.h.
|
private |
Temporary solution how to pass velocity field form the flow model. TODO: introduce FieldDiscrete -containing true DOFHandler and data vector and pass such object together with other data. Possibly make more general set_data method, allowing setting data given by name. needs support from EqDataBase.
Definition at line 365 of file transport.h.
|
private |
Definition at line 354 of file transport.h.
|
private |
Definition at line 355 of file transport.h.
|
private |
Finite element objects.
Definition at line 371 of file transport.h.
|
private |
Record with input specification.
Definition at line 348 of file transport.h.
|
private |
Definition at line 310 of file transport.h.
|
private |
Flag indicates the state of object (transport matrix or source or boundary term). If false, the object is freshly assembled and not rescaled. If true, the object is scaled (not necessarily with the current time step).
Definition at line 310 of file transport.h.
|
private |
Flag indicates that porosity or cross_section changed during last time.
Definition at line 313 of file transport.h.
|
private |
Definition at line 310 of file transport.h.
|
private |
Definition at line 330 of file transport.h.
|
private |
Definition at line 350 of file transport.h.
|
staticprivate |
Registrar of class to factory.
Definition at line 297 of file transport.h.
|
private |
Definition at line 353 of file transport.h.
|
private |
Definition at line 316 of file transport.h.
|
private |
List of indices used to call balance methods for a set of quantities.
Definition at line 368 of file transport.h.
|
private |
Transported substances.
Definition at line 358 of file transport.h.
|
private |
TimeMark type for time marks denoting end of every time interval where transport matrix remains constant.
Definition at line 320 of file transport.h.
|
private |
Definition at line 329 of file transport.h.
|
private |
Definition at line 333 of file transport.h.
|
private |
Time of the last update of the boundary condition terms.
Definition at line 339 of file transport.h.
|
private |
Time when the transport matrix was created. TODO: when we have our own classes for LA objects, we can use lazy dependence to check necessity for matrix update
Definition at line 338 of file transport.h.
|
private |
Definition at line 317 of file transport.h.
|
private |
Definition at line 332 of file transport.h.
|
private |
Parallel vector for flow contribution to CFL condition.
Definition at line 323 of file transport.h.
|
private |
Parallel vector for source term contribution to CFL condition.
Definition at line 323 of file transport.h.
|
private |
Definition at line 328 of file transport.h.
|
private |
Definition at line 344 of file transport.h.
|
private |
Definition at line 342 of file transport.h.
|
private |
Definition at line 331 of file transport.h.