Skip to content

Commit

Permalink
temp commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cticenhour authored and csdechant committed Oct 3, 2024
1 parent 0d47fbf commit baeda98
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
12 changes: 10 additions & 2 deletions GEC_2D/EM_HPhi_sheath_test.i
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@

[AuxVariables]
[./em]
initial_condition = 23.0259
#initial_condition = 18.42068 #1e8
#initial_condition = 20.72327 #1e9
#initial_condition = 23.0259 #1e10
#initial_condition = 25.32844 #1e11
initial_condition = 27.63102 #1e12
#initial_condition = 36.8414 # exp(36.8414) = ~10^16 m^-3 = ~10^10 cm^-3
block = 1
[../]
Expand Down Expand Up @@ -173,6 +177,10 @@
[]

[Outputs]
exodus = true
#exodus = true
[./exodus]
type = Exodus
file_base = 'out_1e12'
[../]
perf_graph = true
[]
Binary file added GEC_2D/HPhi_initial_VV_no_sheath_data.xlsx
Binary file not shown.
20 changes: 20 additions & 0 deletions doNothing_fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The root of this problem is the way the user-specified parameters are initialized within the body of the constructor. Regardless of the definition of `use_material_props`, the constructor body is always executed *in full* because there is nothing to tell the code to disregard this when the params are not specified:

https://github.com/shannon-lab/zapdos/blob/b53be0d7acd77084e9c4c38ae1ccccc978a6b1b7/src/bcs/DriftDiffusionDoNothingBC.C#L50-L66

So, the original error comes from the fact that we "get"/retrieve the params before they were set (because they weren't set), and this happens *every time* the code is run. A possible fix is to institute a check to see if the params are defined before trying to "get" them. Leveraging the MOOSE function `isParamSetByUser`, we could do something like:

``` c++
bool diff_set = parameters.isParamSetByUser("diff");
bool mu_set = parameters.isParamSetByUser("mu");
bool sign_set = parameters.isParamSetByUser("sign");

if ( diff_set && mu_set && sign_set)
{
<insert_previous Lines 53 - 66>
}
else
{
mooseError("In ", _name, ", some user-defined parameters (diff, mu, sign) were set but not all! Please check your input.");
}
```

0 comments on commit baeda98

Please sign in to comment.