-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move CoupledGradientMaterial into framework and increase capabilities #30006
base: next
Are you sure you want to change the base?
Move CoupledGradientMaterial into framework and increase capabilities #30006
Conversation
Job Documentation, step Docs: sync website on 55b7155 wanted to post the following: View the site here This comment will be updated on new commits. |
Job Coverage, step Generate coverage on 55b7155 wanted to post the following: Framework coverage
Modules coverageCoverage did not change Full coverage reportsReports
This comment will be updated on new commits. |
#include "Material.h" | ||
|
||
/** | ||
* A material that optinally computes two properties, one corresponding to the value of the coupled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think it does two properties.
I think it only compute the gradient one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crap, those are comments from the original header.
GenericMaterialProperty<RealVectorValue, is_ad> & _grad_mat_prop; | ||
const GenericMaterialProperty<Real, is_ad> & _scalar_property; | ||
const GenericVariableGradient<is_ad> & _grad_u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GenericMaterialProperty<RealVectorValue, is_ad> & _grad_mat_prop; | |
const GenericMaterialProperty<Real, is_ad> & _scalar_property; | |
const GenericVariableGradient<is_ad> & _grad_u; | |
/// Material property computed, equal to the gradient of the variable | |
GenericMaterialProperty<RealVectorValue, is_ad> & _grad_mat_prop; | |
/// A scalar material property that acts as a factor in the computed property | |
const GenericMaterialProperty<Real, is_ad> & _scalar_property; | |
/// Gradient of the variable | |
const GenericVariableGradient<is_ad> & _grad_u; |
_scalar_property(getGenericMaterialProperty<Real, is_ad>("scalar_property")), | ||
_grad_u(coupledGenericGradient<is_ad>("u")) | ||
{ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if u is finite volume, and if so error because grad_u = 0 is not interesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm...whats the best way to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get a pointer to the variable and do:
if (var.isFV())
mooseError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, is that true? This was originally used in fvkernels/mms/grad-reconstruction.mat-rz
for a FV variable. If I replace the gradient with all zeros, it diffs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting! i didnt know this worked
CoupledGradientMaterialTempl<is_ad>::validParams() | ||
{ | ||
InputParameters params = Material::validParams(); | ||
params.addClassDescription("Create a gradient material coupled to a variable."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reword
# CoupledValueFunctionMaterial / ADCoupledGradientMaterial | ||
|
||
!syntax description /Materials/CoupledGradientMaterial | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add to the stub. ideally you would mention an example, maybe even how you are using it
params.addParam<MaterialPropertyName>( | ||
"scalar_property", | ||
1.0, | ||
"Scalar material property multiplied by the coupled variable value and gradient."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Scalar material property multiplied by the coupled variable value and gradient."); | |
"Scalar material property acting as a factor in the output gradient material property."); |
"times the scalar."); | ||
params.deprecateParam("grad_mat_prop", "gradient_material_name", "12/12/25"); | ||
params.addParam<MaterialPropertyName>( | ||
"scalar_property", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I d deprecate this name and call it scalar_property_factor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to deprecate this one, it is new. I'll change the name.
"scalar_property", | ||
1.0, | ||
"Scalar material property multiplied by the coupled variable value and gradient."); | ||
params.addRequiredCoupledVar("u", "The coupled variable"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params.addRequiredCoupledVar("u", "The coupled variable"); | |
params.addRequiredCoupledVar("u", "The coupled variable to take the gradient of"); |
4559867
to
b7b3363
Compare
b7b3363
to
1c4e8b4
Compare
Ref #15915