forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mortar Assembly of scalar variable contributions.
- Adding mortar scalar wrapper class with standardized assembly - Adding example objects for penalty and Lagrange multiplier versions of PBC - Provide test cases of these mortar objects closes idaholab#22174
- Loading branch information
Showing
11 changed files
with
457 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
framework/doc/content/source/constraints/PeriodicSegmentalConstraint.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# PeriodicSegmentalConstraint | ||
|
||
The `PeriodicSegmentalConstraint` a periodic boundary condition between a microscale and | ||
macroscale field. Coupling is made between a scalar macro-gradient variable and the concentration field within | ||
the periodic domain. Only the macro to micro coupling terms are handled here. The micro-micro coupling terms | ||
are handled using the [EqualValueConstraint](/EqualValueConstraint.md) applied to the same | ||
primary/secondary pair. | ||
|
||
The applied macroscale conjugate gradient is applied as `kappa_aux` vector as an auxillary | ||
scalar. The computed macroscale gradient `kappa` is equal to this value for isotropic-unitary | ||
diffusivity. The volume integral of the gradient of the primary field will be equal to these | ||
imposed values. | ||
|
||
The microscale variable is specified using the `primary_variable` parameter. | ||
If the solution values to be matched are between different variables, the | ||
`secondary_variable` parameter can also be supplied. The enforcement takes place using Lagrange multipliers. | ||
|
||
!listing test/tests/mortar/periodic_segmental_constraint/periodic_simple2d.i block=Constraints | ||
|
||
!syntax description /Constraints/PeriodicSegmentalConstraint | ||
|
||
!syntax parameters /Constraints/PeriodicSegmentalConstraint | ||
|
||
!syntax inputs /Constraints/PeriodicSegmentalConstraint | ||
|
||
!syntax children /Constraints/PeriodicSegmentalConstraint | ||
|
||
!bibtex bibliography |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
framework/include/constraints/PeriodicSegmentalConstraint.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "MortarScalarBase.h" | ||
#include "DerivativeMaterialInterface.h" | ||
#include "MooseVariableScalar.h" | ||
#include "Assembly.h" | ||
|
||
/** | ||
* This class enforces a periodic boundary condition between a microscale and macroscale field. | ||
* Target example for the Diffusion equation with isotropic, unitary diffusivity. Coupling is | ||
* made between a scalar macro-gradient variable and the temperature/concentration field within | ||
* the periodic domain. Primary and secondary surfaces are on opposing sides of the domain. Only | ||
* the macro to micro coupling terms are handled here. The micro-micro coupling terms are | ||
* handled using the EqualValueConstraint applied to the same primary/secondary pair. | ||
* | ||
* The applied macroscale conjugate gradient is applied as `kappa_aux` vector as an auxillary | ||
* scalar. The computed macroscale gradient `kappa` is equal to this value for isotropic-unitary | ||
* diffusivity. The volume integral of the gradient of the primary field will be equal to these | ||
* imposed values. | ||
*/ | ||
|
||
class PeriodicSegmentalConstraint : public DerivativeMaterialInterface<MortarScalarBase> | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
PeriodicSegmentalConstraint(const InputParameters & parameters); | ||
|
||
protected: | ||
/** | ||
* Method for computing the residual at quadrature points | ||
*/ | ||
virtual Real computeQpResidual(Moose::MortarType mortar_type) override; | ||
Real computeQpJacobian(Moose::ConstraintJacobianType /*jacobian_type*/, | ||
unsigned int /*jvar*/) override | ||
{ | ||
return 0; | ||
}; | ||
|
||
/** | ||
* Method for computing the scalar part of residual at quadrature points | ||
*/ | ||
virtual Real computeScalarQpResidual() override; | ||
|
||
// using MortarScalarBase::computeOffDiagJacobianScalar; | ||
|
||
/** | ||
* Method for computing d-_var-residual / d-_kappa at quadrature points. | ||
*/ | ||
virtual Real computeQpOffDiagJacobianScalar(Moose::MortarType mortar_type, | ||
const unsigned int jvar) override; | ||
|
||
/** | ||
* Method for computing d-_kappa-residual / d-_var at quadrature points. | ||
*/ | ||
virtual Real computeScalarQpOffDiagJacobian(Moose::MortarType mortar_type, | ||
const unsigned int jvar) override; | ||
|
||
protected: | ||
/// The controlled scalar variable ID | ||
const unsigned int _kappa_aux_var; | ||
|
||
/// Order of the homogenization variable, used in several places | ||
const unsigned int _ka_order; | ||
|
||
/// The controlled scalar variable | ||
const VariableValue & _kappa_aux; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.