Skip to content
Permalink
Browse files

Merge pull request #12986 from WilkAndy/pf_dirac_class_descript_12541

PorousFlow DiracKernels mention strain_at_nearest_qp
  • Loading branch information...
permcody committed Mar 5, 2019
2 parents e744a34 + f18e9ba commit 62a5555c3f26db7979825fe5cc7dd39b408d31e4
@@ -73,6 +73,9 @@ extract fluid at a given rate, and therefore in a simulation that
includes, the same sink multiplied by fluid enthalpy should be applied
to the temperature variable.

!alert warning
When using the PorousFlow Dirac Kernels in conjunction with [`PorousFlowPorosity`](porosity.md) that depends on volumetric strain (`mechanical = true`) you should set `strain_at_nearest_qp = true` in your GlobalParams block. This ensures the nodal Porosity Material uses the volumetric strain at the Dirac quadpoint(s). Otherwise, a nodal Porosity Material evaluated at node $i$ in an element will attempt to use the $i^{th}$ member of volumetric strain, but volumetric strain will only be of size equal to the number of Dirac points in the element.

## Polyline sinks as functions of porepressure and/or temperature

A [`PorousFlowPolyLineSink`](/PorousFlowPolyLineSink.md) is a special case of the general polyline sink. The function, $f$ in
@@ -56,9 +56,13 @@ validParams<PorousFlowPeacemanBorehole>()
"However, if this parameter is given as a positive number then this "
"number is used instead of the internal calculation. This speeds up "
"computation marginally. re_constant becomes irrelevant");
params.addClassDescription("Approximates a borehole in the mesh using the Peaceman approach, ie "
"using a number of point sinks with given radii whose positions are "
"read from a file");
params.addClassDescription(
"Approximates a borehole in the mesh using the Peaceman approach, ie "
"using a number of point sinks with given radii whose positions are "
"read from a file. NOTE: if you are using PorousFlowPorosity that depends on volumetric "
"strain, you should set strain_at_nearest_qp=true in your GlobalParams, to ensure the nodal "
"Porosity Material uses the volumetric strain at the Dirac quadpoints, and can therefore be "
"computed");
return params;
}

@@ -29,8 +29,12 @@ validParams<PorousFlowPolyLineSink>()
"quad-point pressure exceeds the final pressure value, the final flux value is "
"used. This flux is OUT of the medium: hence positive values of flux means this "
"will be a SINK, while negative values indicate this flux will be a SOURCE.");
params.addClassDescription("Approximates a polyline sink by using a number of point sinks with "
"given weighting whose positions are read from a file");
params.addClassDescription(
"Approximates a polyline sink by using a number of point sinks with "
"given weighting whose positions are read from a file. NOTE: if you are using "
"PorousFlowPorosity that depends on volumetric strain, you should set "
"strain_at_nearest_qp=true in your GlobalParams, to ensure the nodal Porosity Material uses "
"the volumetric strain at the Dirac quadpoints, and can therefore be computed");
return params;
}

@@ -0,0 +1,90 @@
# Demonstrates the correct usage of strain_at_nearest_qp when using a nodal PorousFlowPorosity
# For the PorousFlowPorosity Material to require the strain_at_nearest_qp=true flag, it must:
# - be a nodal Material
# - be coupled to solid mechanics (mechanical=true)
# - be part of a simulation with DiracKernels
# The reason for this requirement is that the volumetric strain is a standard Material (at_nodes=false)
# so that it is evaluated at the single Dirac quadpoint, and has size = 1 (assuming just one Dirac point).
# However, the PorousFlowPorosity Material will have size = 2 (number of nodes in the element containing the Dirac point).
# So when the PorousFlowPorosity Material is evaluated, it will use _vol_strain at 2 points.
# If strain_at_nearest_qp=false, then _vol_strain will be evaluated at two quadpoints, but it only has size=1, leading to a segfault
# If strain_at_nearest_qp=true, then _vol_strain will be evaluated correctly just at the single quadpoint
#
# This input file solves no useful physics: it is just illustrating the above point
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]

[GlobalParams]
PorousFlowDictator = dictator
strain_at_nearest_qp = true
[]

[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'disp_x'
number_fluid_phases = 1
number_fluid_components = 1
[../]
[./dummy_sum]
type = PorousFlowSumQuantity
[../]
[]

[Variables]
[./disp_x]
[../]
[]

[Kernels]
[./dummy]
type = Diffusion
variable = disp_x
[../]
[]

[DiracKernels]
[./line_sink]
type = PorousFlowPolyLineSink
function_of = temperature
SumQuantityUO = dummy_sum
point_file = strain_at_nearest_qp.bh
p_or_t_vals = '0'
fluxes = '0'
variable = disp_x
[../]
[]

[Materials]
[./temperature]
type = PorousFlowTemperature # needed because of the PorousFlowPolyLineSink
[../]
[./vol_strain]
type = PorousFlowVolumetricStrain
displacements = disp_x
[../]
[./porosity_at_nodes]
type = PorousFlowPorosity
mechanical = true # to ensure coupling with volumetric strain
at_nodes = true # to ensure evaluation at nodes
porosity_zero = 0
[../]
[]


[Preconditioning]
[./usual]
type = SMP
full = true
[../]
[]

[Executioner]
type = Transient
end_time = 1
dt = 1
solve_type = NEWTON
[]
@@ -345,4 +345,12 @@
design = 'PorousFlowPeacemanBorehole.md'
issues = '#7992 #8139'
[../]
[./strain_at_nearest_qp]
type = RunApp
input = strain_at_nearest_qp.i
threading = '!pthreads'
requirement = "If the strain at the nearest quadpoint is used when evaluating PorousFlowPorosity that is coupled to solid mechanics, all PorousFlow DiracKernels shall be usable"
issues = "#12541"
design = "sinks.md"
[../]
[]

0 comments on commit 62a5555

Please sign in to comment.
You can’t perform that action at this time.