www.mooseframework.org
PorousFlowAdvectiveFluxCalculatorBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
13 #include "PorousFlowDictator.h"
14 
28 {
29 public:
31 
33 
39  const std::map<dof_id_type, std::vector<Real>> & getdFluxOut_dvars(unsigned node_id) const;
40 
41 protected:
42  virtual void timestepSetup() override;
43  virtual void initialize() override;
44  virtual void execute() override;
45  virtual void finalize() override;
46  virtual void threadJoin(const UserObject & uo) override;
47 
48  virtual Real computeVelocity(unsigned i, unsigned j, unsigned qp) const override;
49 
50  virtual void executeOnElement(dof_id_type global_i,
51  dof_id_type global_j,
52  unsigned local_i,
53  unsigned local_j,
54  unsigned qp) override;
55 
61  virtual Real computedU_dvar(unsigned i, unsigned pvar) const = 0;
62 
68  const std::map<dof_id_type, std::vector<Real>> & getdK_dvar(dof_id_type node_i,
69  dof_id_type node_j) const;
70 
71  virtual void buildCommLists() override;
72  virtual void exchangeGhostedInfo() override;
73 
76 
78  const unsigned _num_vars;
79 
82 
84  const unsigned int _phase;
85 
88 
91 
94 
97 
100 
103 
106 
109 
111  const FEType _fe_type;
112 
115 
118 
120  std::vector<std::vector<Real>> _du_dvar;
121 
123  std::vector<bool> _du_dvar_computed_by_thread;
124 
130  std::vector<std::vector<std::map<dof_id_type, std::vector<Real>>>> _dkij_dvar;
131 
133  std::vector<std::map<dof_id_type, std::vector<Real>>> _dflux_out_dvars;
134 
144  std::map<processor_id_type, std::vector<dof_id_type>> _triples_to_receive;
145 
155  std::map<processor_id_type, std::vector<dof_id_type>> _triples_to_send;
156 
158  const bool _perm_derivs;
159 };
virtual Real computedU_dvar(unsigned i, unsigned pvar) const =0
Compute d(u)/d(porous_flow_variable)
virtual void buildCommLists() override
When using multiple processors, other processors will compute:
const bool _perm_derivs
Flag to check whether permeabiity derivatives are non-zero.
const MaterialProperty< RealTensorValue > & _permeability
Permeability of porous material.
const VariablePhiGradient & _grad_phi
grad(Kuzmin-Turek shape function)
virtual void executeOnElement(dof_id_type global_i, dof_id_type global_j, unsigned local_i, unsigned local_j, unsigned qp) override
This is called by multiple times in execute() in a double loop over _current_elem&#39;s nodes (local_i an...
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dpermeability_dgradvar
d(permeabiity)/d(grad(PorousFlow variable))
OutputTools< Real >::VariablePhiValue VariablePhiValue
const std::map< dof_id_type, std::vector< Real > > & getdFluxOut_dvars(unsigned node_id) const
Returns d(flux_out)/d(porous_flow_variables.
const VariablePhiValue & _phi
Kuzmin-Turek shape function.
const MaterialProperty< std::vector< RealTensorValue > > & _dpermeability_dvar
d(permeabiity)/d(PorousFlow variable)
Base class to compute the advective flux of fluid in PorousFlow situations using the Kuzmin-Turek FEM...
const MaterialProperty< std::vector< RealGradient > > & _grad_p
Gradient of the pore pressure in each phase.
std::map< processor_id_type, std::vector< dof_id_type > > _triples_to_receive
_triples_to_receive[proc_id] indicates the dk(i, j)/du_nodal information that we will receive from pr...
PorousFlowAdvectiveFluxCalculatorBase(const InputParameters &parameters)
virtual Real computeVelocity(unsigned i, unsigned j, unsigned qp) const override
Computes the transfer velocity between current node i and current node j at the current qp in the cur...
virtual void threadJoin(const UserObject &uo) override
virtual void exchangeGhostedInfo() override
Sends and receives multi-processor information regarding u_nodal and k_ij.
std::vector< bool > _du_dvar_computed_by_thread
Whether _du_dvar has been computed by the local thread.
const MaterialProperty< std::vector< Real > > & _fluid_density_qp
Fluid density for each phase (at the qp)
std::vector< std::map< dof_id_type, std::vector< Real > > > _dflux_out_dvars
_dflux_out_dvars[sequential_i][global_j][pvar] = d(flux_out[global version of sequential_i])/d(porous...
Base class to compute Advective fluxes.
const MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_density_qp_dvar
Derivative of the fluid density for each phase wrt PorousFlow variables (at the qp) ...
std::vector< std::vector< Real > > _du_dvar
_du_dvar[sequential_i][a] = d(u[global version of sequential node i])/d(porous_flow_variable[a]) ...
std::map< processor_id_type, std::vector< dof_id_type > > _triples_to_send
_triples_to_send[proc_id] indicates the dk(i, j)/du_nodal information that we will send to proc_id...
const MaterialProperty< std::vector< std::vector< Real > > > & _dgrad_p_dgrad_var
Derivative of Grad porepressure in each phase wrt grad(PorousFlow variables)
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
const unsigned _num_vars
Number of PorousFlow variables.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const MaterialProperty< std::vector< std::vector< RealGradient > > > & _dgrad_p_dvar
Derivative of Grad porepressure in each phase wrt PorousFlow variables.
const InputParameters & parameters() const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::vector< std::vector< std::map< dof_id_type, std::vector< Real > > > > _dkij_dvar
_dkij_dvar[sequential_i][j][global_k][a] = d(K[sequential_i][j])/d(porous_flow_variable[global_k][por...
const std::map< dof_id_type, std::vector< Real > > & getdK_dvar(dof_id_type node_i, dof_id_type node_j) const
Returns, r, where r[global node k][a] = d(K[node_i][node_j])/d(porous_flow_variable[global node k][po...
uint8_t dof_id_type