www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
PorousFlowSquarePulsePointSource Class Reference

Point source (or sink) that adds (removes) fluid at a constant mass flux rate for times between the specified start and end times. More...

#include <PorousFlowSquarePulsePointSource.h>

Inheritance diagram for PorousFlowSquarePulsePointSource:
[legend]

Public Member Functions

 PorousFlowSquarePulsePointSource (const InputParameters &parameters)
 
virtual void addPoints () override
 
virtual Real computeQpResidual () override
 

Protected Attributes

const Real _mass_flux
 The constant mass flux (kg/s) More...
 
const Point _p
 The location of the point source (sink) More...
 
const Real _start_time
 The time at which the point source (sink) starts operating. More...
 
const Real _end_time
 The time at which the point source (sink) stops operating. More...
 

Detailed Description

Point source (or sink) that adds (removes) fluid at a constant mass flux rate for times between the specified start and end times.

If no start and end times are specified, the source (sink) starts at the start of the simulation and continues to act indefinitely

Definition at line 23 of file PorousFlowSquarePulsePointSource.h.

Constructor & Destructor Documentation

PorousFlowSquarePulsePointSource::PorousFlowSquarePulsePointSource ( const InputParameters &  parameters)

Sanity check to ensure that the end_time is greater than the start_time

Definition at line 28 of file PorousFlowSquarePulsePointSource.C.

30  : DiracKernel(parameters),
31  _mass_flux(getParam<Real>("mass_flux")),
32  _p(getParam<Point>("point")),
33  _start_time(getParam<Real>("start_time")),
34  _end_time(getParam<Real>("end_time"))
35 {
37  if (_end_time <= _start_time)
38  mooseError("Start time for PorousFlowSquarePulsePointSource is ",
40  " but it must be less than end time ",
41  _end_time);
42 }
const Real _end_time
The time at which the point source (sink) stops operating.
const Real _start_time
The time at which the point source (sink) starts operating.
const Real _mass_flux
The constant mass flux (kg/s)
const Point _p
The location of the point source (sink)

Member Function Documentation

void PorousFlowSquarePulsePointSource::addPoints ( )
overridevirtual

Definition at line 45 of file PorousFlowSquarePulsePointSource.C.

46 {
47  addPoint(_p, 0);
48 }
const Point _p
The location of the point source (sink)
Real PorousFlowSquarePulsePointSource::computeQpResidual ( )
overridevirtual

There are six cases for the start and end time in relation to t-dt and t. If the interval (t-dt,t) is only partly but not fully within the (start,end) interval, then the mass_flux is scaled so that the total mass added (or removed) is correct

Negative sign to make a positive mass_flux in the input file a source

Definition at line 51 of file PorousFlowSquarePulsePointSource.C.

52 {
53  Real factor = 0.0;
54 
61  if (_t < _start_time || _t - _dt >= _end_time)
62  factor = 0.0;
63  else if (_t - _dt < _start_time)
64  {
65  if (_t <= _end_time)
66  factor = (_t - _start_time) / _dt;
67  else
68  factor = (_end_time - _start_time) / _dt;
69  }
70  else
71  {
72  if (_t <= _end_time)
73  factor = 1.0;
74  else
75  factor = (_end_time - (_t - _dt)) / _dt;
76  }
77 
79  return -_test[_i][_qp] * factor * _mass_flux;
80 }
const Real _end_time
The time at which the point source (sink) stops operating.
const Real _start_time
The time at which the point source (sink) starts operating.
const Real _mass_flux
The constant mass flux (kg/s)

Member Data Documentation

const Real PorousFlowSquarePulsePointSource::_end_time
protected

The time at which the point source (sink) stops operating.

Definition at line 42 of file PorousFlowSquarePulsePointSource.h.

Referenced by computeQpResidual(), and PorousFlowSquarePulsePointSource().

const Real PorousFlowSquarePulsePointSource::_mass_flux
protected

The constant mass flux (kg/s)

Definition at line 33 of file PorousFlowSquarePulsePointSource.h.

Referenced by computeQpResidual().

const Point PorousFlowSquarePulsePointSource::_p
protected

The location of the point source (sink)

Definition at line 36 of file PorousFlowSquarePulsePointSource.h.

Referenced by addPoints().

const Real PorousFlowSquarePulsePointSource::_start_time
protected

The time at which the point source (sink) starts operating.

Definition at line 39 of file PorousFlowSquarePulsePointSource.h.

Referenced by computeQpResidual(), and PorousFlowSquarePulsePointSource().


The documentation for this class was generated from the following files: