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 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 25 of file PorousFlowSquarePulsePointSource.h.

## ◆ PorousFlowSquarePulsePointSource()

 PorousFlowSquarePulsePointSource::PorousFlowSquarePulsePointSource ( const InputParameters & parameters )

Definition at line 32 of file PorousFlowSquarePulsePointSource.C.

34  : DiracKernel(parameters),
35  _mass_flux(getParam<Real>("mass_flux")),
36  _p(getParam<Point>("point")),
37  _start_time(getParam<Real>("start_time")),
38  _end_time(getParam<Real>("end_time"))
39 {
40  // Sanity check to ensure that the end_time is greater than the start_time
41  if (_end_time <= _start_time)
42  mooseError(name(),
43  ": start time for PorousFlowSquarePulsePointSource is ",
45  " but it must be less than end time ",
46  _end_time);
47 }
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)
const std::string name
Definition: Setup.h:22

## Member Function Documentation

overridevirtual

Definition at line 50 of file PorousFlowSquarePulsePointSource.C.

51 {
53 }
const Point _p
The location of the point source (sink)

## ◆ computeQpResidual()

 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

Definition at line 56 of file PorousFlowSquarePulsePointSource.C.

57 {
58  Real factor = 0.0;
59
66  if (_t < _start_time || _t - _dt >= _end_time)
67  factor = 0.0;
68  else if (_t - _dt < _start_time)
69  {
70  if (_t <= _end_time)
71  factor = (_t - _start_time) / _dt;
72  else
73  factor = (_end_time - _start_time) / _dt;
74  }
75  else
76  {
77  if (_t <= _end_time)
78  factor = 1.0;
79  else
80  factor = (_end_time - (_t - _dt)) / _dt;
81  }
82
83  // Negative sign to make a positive mass_flux in the input file a source
84  return -_test[_i][_qp] * factor * _mass_flux;
85 }
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)

## ◆ _end_time

 const Real PorousFlowSquarePulsePointSource::_end_time
protected

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

Definition at line 44 of file PorousFlowSquarePulsePointSource.h.

Referenced by computeQpResidual(), and PorousFlowSquarePulsePointSource().

## ◆ _mass_flux

 const Real PorousFlowSquarePulsePointSource::_mass_flux
protected

The constant mass flux (kg/s)

Definition at line 35 of file PorousFlowSquarePulsePointSource.h.

Referenced by computeQpResidual().

## ◆ _p

 const Point PorousFlowSquarePulsePointSource::_p
protected

The location of the point source (sink)

Definition at line 38 of file PorousFlowSquarePulsePointSource.h.

## ◆ _start_time

 const Real PorousFlowSquarePulsePointSource::_start_time
protected

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

Definition at line 41 of file PorousFlowSquarePulsePointSource.h.

Referenced by computeQpResidual(), and PorousFlowSquarePulsePointSource().

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