PointEnthalpySourceSinkFromFunction

Point source/sink that adds or removes heat energy at a variable mass flux rate and a variable temperature, switching between extraction (using the local solution temperature) and injection (using the prescribed temperature_function) based on the sign of mass_flux_function

Description

PointEnthalpySourceSinkFromFunction adds a point contribution to the energy (temperature) equation representing the heat carried by fluid that is either injected into, or extracted from, a single point, with the mass flux and (for injection) the inlet temperature given by two user-supplied functions of time: mass_flux_function and temperature_function.

At every residual evaluation the object inspects the signs of mass_flux_function(t) and temperature_function(t) to decide which of the two physical regimes applies:

  • extraction ( and ): the enthalpy is evaluated at the LOCAL solution temperature, i.e. fluid leaves at the current reservoir temperature, as for PointEnthalpySink;

  • injection ( and ): the enthalpy is evaluated at the function-supplied temperature , as for PointEnthalpySourceFromFunction.

Any other combination of signs (i.e. the two functions do not agree on whether the point is injecting or extracting at a given time) is considered a user input error, and the object calls mooseError reporting that "the functions of mass flux and temperature are not coordinated for injection and extraction". This is by design: the convention temperature_function <= 0 during extraction is how the object is told "there is no prescribed temperature; use the local value instead", so mass_flux_function and temperature_function must always be set up consistently by the user for a single point that switches between injection and production over time (e.g. for a push-pull or seasonal thermal storage cycle).

The residual contribution,

is accumulated (multiplied by the timestep size) into the SumQuantityUO PorousFlowSumQuantity user object every timestep, so that the total energy injected/extracted can be recovered with a PorousFlowPlotQuantity postprocessor.

Example Input Syntax

[DiracKernels<<<{"href": "../../syntax/DiracKernels/index.html"}>>>]
  [source_h]
    type = PointEnthalpySourceSinkFromFunction<<<{"description": "Point source/sink that adds or removes heat energy at a variable mass flux rate and a variable temperature, switching between extraction (using the local solution temperature) and injection (using the prescribed temperature_function) based on the sign of mass_flux_function", "href": "PointEnthalpySourceSinkFromFunction.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = temperature
    SumQuantityUO<<<{"description": "User Object of type=PorousFlowSumQuantity in which to place the total outflow from the line sink for each time step."}>>> = outflow_uo
    mass_flux_function<<<{"description": "The function holding the mass flux at this point in kg/s. Per computeQpResidual, mass_flux_function >= 0 (paired with temperature_function <= 0) means extraction, and mass_flux_function <= 0 (paired with temperature_function > 0) means injection -- the two functions must be coordinated this way or a mooseError is raised."}>>> = mass_flux_fn
    temperature_function<<<{"description": "The function holding the temperature (K) of the injected fluid. Function value must be <= 0 if the fluid is extracted (see mass_flux_function)"}>>> = temperature_fn
    pressure<<<{"description": "Pressure used to calculate the injected/extracted fluid enthalpy (measured in Pa)"}>>> = pressure
    fp<<<{"description": "The name of the user object used to calculate the fluid properties of the injected/extracted fluid"}>>> = simple_fluid
    point<<<{"description": "The x,y,z coordinates of the point source"}>>> = '0.5 0.5 0'
  []
[]
(test/tests/dirackernels/point_enthalpy_source_sink_from_function/inp.i)

Input Parameters

  • SumQuantityUOUser Object of type=PorousFlowSumQuantity in which to place the total outflow from the line sink for each time step.

    C++ Type:UserObjectName

    Controllable:No

    Description:User Object of type=PorousFlowSumQuantity in which to place the total outflow from the line sink for each time step.

  • fpThe name of the user object used to calculate the fluid properties of the injected/extracted fluid

    C++ Type:UserObjectName

    Controllable:No

    Description:The name of the user object used to calculate the fluid properties of the injected/extracted fluid

  • mass_flux_functionThe function holding the mass flux at this point in kg/s. Per computeQpResidual, mass_flux_function >= 0 (paired with temperature_function <= 0) means extraction, and mass_flux_function <= 0 (paired with temperature_function > 0) means injection -- the two functions must be coordinated this way or a mooseError is raised.

    C++ Type:FunctionName

    Unit:(no unit assumed)

    Controllable:No

    Description:The function holding the mass flux at this point in kg/s. Per computeQpResidual, mass_flux_function >= 0 (paired with temperature_function <= 0) means extraction, and mass_flux_function <= 0 (paired with temperature_function > 0) means injection -- the two functions must be coordinated this way or a mooseError is raised.

  • pointThe x,y,z coordinates of the point source

    C++ Type:libMesh::Point

    Controllable:No

    Description:The x,y,z coordinates of the point source

  • pressurePressure used to calculate the injected/extracted fluid enthalpy (measured in Pa)

    C++ Type:std::vector<VariableName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Pressure used to calculate the injected/extracted fluid enthalpy (measured in Pa)

  • temperature_functionThe function holding the temperature (K) of the injected fluid. Function value must be <= 0 if the fluid is extracted (see mass_flux_function)

    C++ Type:FunctionName

    Unit:(no unit assumed)

    Controllable:No

    Description:The function holding the temperature (K) of the injected fluid. Function value must be <= 0 if the fluid is extracted (see mass_flux_function)

  • variableThe name of the variable that this residual object operates on

    C++ Type:NonlinearVariableName

    Unit:(no unit assumed)

    Controllable:No

    Description:The name of the variable that this residual object operates on

Required Parameters

  • allow_moving_sourcesFalseIf true, allow Dirac sources to move, even if the mesh does not move, during the simulation.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:If true, allow Dirac sources to move, even if the mesh does not move, during the simulation.

  • blockThe list of blocks (ids or names) that this object will be applied

    C++ Type:std::vector<SubdomainName>

    Controllable:No

    Description:The list of blocks (ids or names) that this object will be applied

  • point_not_found_behaviorIGNOREBy default (IGNORE), it is ignored if an added point cannot be located in the specified subdomains. If this option is set to ERROR, this situation will result in an error. If this option is set to WARNING, then a warning will be issued.

    Default:IGNORE

    C++ Type:MooseEnum

    Options:ERROR, WARNING, IGNORE

    Controllable:No

    Description:By default (IGNORE), it is ignored if an added point cannot be located in the specified subdomains. If this option is set to ERROR, this situation will result in an error. If this option is set to WARNING, then a warning will be issued.

Optional Parameters

  • absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution

    C++ Type:std::vector<TagName>

    Controllable:No

    Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution

  • extra_matrix_tagsThe extra tags for the matrices this Kernel should fill

    C++ Type:std::vector<TagName>

    Controllable:No

    Description:The extra tags for the matrices this Kernel should fill

  • extra_vector_tagsThe extra tags for the vectors this Kernel should fill

    C++ Type:std::vector<TagName>

    Controllable:No

    Description:The extra tags for the vectors this Kernel should fill

  • matrix_onlyFalseWhether this object is only doing assembly to matrices (no vectors)

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether this object is only doing assembly to matrices (no vectors)

  • matrix_tagssystemThe tag for the matrices this Kernel should fill

    Default:system

    C++ Type:MultiMooseEnum

    Options:nontime, system

    Controllable:No

    Description:The tag for the matrices this Kernel should fill

  • vector_tagsnontimeThe tag for the vectors this Kernel should fill

    Default:nontime

    C++ Type:MultiMooseEnum

    Options:nontime, time

    Controllable:No

    Description:The tag for the vectors this Kernel should fill

Contribution To Tagged Field Data Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • drop_duplicate_pointsTrueBy default points added to a DiracKernel are dropped if a point at the same locationhas been added before. If this option is set to false duplicate points are retainedand contribute to residual and Jacobian.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:By default points added to a DiracKernel are dropped if a point at the same locationhas been added before. If this option is set to false duplicate points are retainedand contribute to residual and Jacobian.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Controllable:Yes

    Description:Set the enabled status of the MooseObject.

  • implicitTrueDetermines whether this object is calculated using an implicit or explicit form

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Determines whether this object is calculated using an implicit or explicit form

  • search_methodnearest_node_connected_sidesChoice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).

    Default:nearest_node_connected_sides

    C++ Type:MooseEnum

    Options:nearest_node_connected_sides, all_proximate_sides

    Controllable:No

    Description:Choice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).

  • seed0The seed for the master random number generator

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:The seed for the master random number generator

  • use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

Advanced Parameters

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Unit:(no unit assumed)

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

Material Property Retrieval Parameters

Input Files