Skip to content
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

InterfaceUserObject can NOT get MaterialProperty and NeighborMaterialProperty #14680

Closed
arovinelli opened this issue Feb 3, 2020 · 12 comments · Fixed by #14705
Closed

InterfaceUserObject can NOT get MaterialProperty and NeighborMaterialProperty #14680

arovinelli opened this issue Feb 3, 2020 · 12 comments · Fixed by #14705
Assignees
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: defect An anomaly, which is anything that deviates from expectations.

Comments

@arovinelli
Copy link
Contributor

arovinelli commented Feb 3, 2020

Bug Description

InterfaceUserObject can't properly get neighbor material property.
@lindsayad The introduction of the interface material should have granted this to work automatically but apparently it doesn't and I can't figure out where the problem is.

Steps to Reproduce

I prepared a branch here demonstrating the issue interfaceUO_neighbor_material
execute the /moose/test/tests/userobjects/interface_user_object/interface_material_value_user_object_QP.i test and see that _mp[qp] and _mp_neighbor[qp] are always 0, when they should be 10 and 4, respectively, after one step

Impact

This does prevent user to compute interface average values material properties, and yes does prevent some of my work to be done

@arovinelli arovinelli added the T: defect An anomaly, which is anything that deviates from expectations. label Feb 3, 2020
arovinelli pushed a commit to arovinelli/moose that referenced this issue Feb 3, 2020
@arovinelli arovinelli changed the title InterfaceUserObject can NOT get NeighborMaterialProperty InterfaceUserObject can NOT get MaterialProperty and NeighborMaterialProperty Feb 3, 2020
@arovinelli
Copy link
Contributor Author

@lindsayad I found something off in the execution of ComputeUserObjectsThread::onInterface

It seems that calls to swapback and reinit reset the material property to 0 before the UO is executed, which will picks a zero value.

here is what is going on printed out:

elem 1 side 3
elem 2 side 0
_diffusivity[_qp] 4 block 1
_diffusivity[_qp] 4 block 1
_diffusivity[_qp] 4 block 1
_diffusivity[_qp] 4 block 1
_diffusivity[_qp] 10 block 0
_diffusivity[_qp] 10 block 0
_diffusivity[_qp] 10 block 0
_diffusivity[_qp] 10 block 0


ComputeUserObjectsThread::onInterface LOOP BEGIN
LOOPS BEGIN prepare face and reinint neighbor 
LOOPS END prepare face and reinint neighbor 
LOOPS BEGIN swapback and reinit materials 
_diffusivity[_qp] 0 block 0
_diffusivity[_qp] 0 block 0
_diffusivity[_qp] 0 block 1
_diffusivity[_qp] 0 block 1
LOOPS END swapback and reinit materials 
LOOPS start UO execution 
 _current_elem->id() 1 _current_side 3
 _current_elem->id() 1 _current_side 3 QP 0 _mp[qp] 0 _mp_neighbor[qp] 0
 _current_elem->id() 1 _current_side 3 QP 1 _mp[qp] 0 _mp_neighbor[qp] 0
LOOPS end UO execution 
ComputeUserObjectsThread::onInterface LOOP END

@arovinelli
Copy link
Contributor Author

arovinelli commented Feb 3, 2020

some other insight.
If I use a boundary restricted MaterialRealAux I get the proper material property on on the master side. Adding an additional mirror boundary on the slave side an triggering a boundary material update with another MaterialRealAux doesn't do the trick. see test/tests/userobjects/interface_user_object/interface_material_value_user_object_QP_with_aux.i

So on the master side the problem is that the interface user object doesn't trigger updates for material properties on the boundary.
For the slave side I'm clueless.

@arovinelli
Copy link
Contributor Author

pinging @YaqiWang as I remember he was also interested in this at some point.

@lindsayad
Copy link
Member

@lindsayad The introduction of the interface material should have granted this to work automatically

Is this so? I didn't write the InterfaceUserObject so I don't know how it works as well as its maker 😄

@arovinelli
Copy link
Contributor Author

@lindsayad fair enough :) When I tested it with the fake interface material it was working nicely and I didn't had this problem. The structure of moose did change a lot since that time and now I'm trying to understand what's going on.
As mentioned before a call to an interface userobject should trigger an update of bulk material properties on boundaries for both sides, but as demonstrated it doesn't. So something is off in the loops.

@lindsayad The introduction of the interface material should have granted this to work automatically

Is this so? I didn't write the InterfaceUserObject so I don't know how it works as well as its maker smile

@lindsayad
Copy link
Member

Ok, when you're done sleuthing, I will look into it. I don't want to both be investigating the problem at the same time

@arovinelli
Copy link
Contributor Author

@lindsayad I'm done, as I don't have time to figure this out.
Hopefully what I posted will make your life easier.
Keep me posted please.

Andrea

@lindsayad
Copy link
Member

Haha @aeslaughter are you taking on some of @permcody's roles? Seems like we need to hire more people...

@permcody permcody added the P: normal A defect affecting operation with a low possibility of significantly affects. label Feb 5, 2020
lindsayad added a commit to lindsayad/moose that referenced this issue Feb 5, 2020
@lindsayad
Copy link
Member

lindsayad commented Feb 5, 2020

@arovinelli You know what your needs are, so you know what tests you need to create to make sure we don't regress on this capability. Can you cherry-pick lindsayad@d55c072, clean up your tests, and submit a pull request? I've verified that with lindsayad@d55c072 your values are correct in your user object. It's easier if you submit the pull request because I can then push additional commits to your PR, but we can't do it visa versa (e.g. you can't push commits to a pull request I open)

@YaqiWang
Copy link
Contributor

YaqiWang commented Feb 5, 2020

Do we have Material documented? Looks like it is empty here https://mooseframework.inl.gov/syntax/Materials/index.html. This is a super important system, we need to add documents asap imo. I also cannot find links for interface material...

@arovinelli
Copy link
Contributor Author

@lindsayad thanks for solving this so quickly. I'm working on it and making a few additional test to check if it works also for linear and nonlinear iteration.
Also I would like to restructure a bit a few files in the framework by adding a interfaceValueQPBaseUO that can then be subclassed to make one UO working on variables an another one on material properties. Do you want these changes in the same PR or one thing at a time?

@arovinelli You know what your needs are, so you know what tests you need to create to make sure we don't regress on this capability. Can you cherry-pick lindsayad@d55c072, clean up your tests, and submit a pull request? I've verified that with lindsayad@d55c072 your values are correct in your user object. It's easier if you submit the pull request because I can then push additional commits to your PR, but we can't do it visa versa (e.g. you can't push commits to a pull request I open)

@lindsayad
Copy link
Member

Do you want these changes in the same PR or one thing at a time?

I think that we can have both things in a single "expand InterfaceUserObject" PR

arovinelli pushed a commit to arovinelli/moose that referenced this issue Feb 8, 2020
arovinelli pushed a commit to arovinelli/moose that referenced this issue Feb 10, 2020
arovinelli pushed a commit to arovinelli/moose that referenced this issue Feb 14, 2020
arovinelli pushed a commit to arovinelli/moose that referenced this issue Feb 14, 2020
arovinelli pushed a commit to arovinelli/moose that referenced this issue Feb 14, 2020
arovinelli pushed a commit to arovinelli/moose that referenced this issue Feb 14, 2020
arovinelli pushed a commit to arovinelli/moose that referenced this issue Feb 14, 2020
arovinelli pushed a commit to arovinelli/moose that referenced this issue Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: defect An anomaly, which is anything that deviates from expectations.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants