-
Notifications
You must be signed in to change notification settings - Fork 274
Enable different boundary conditions for different fields on different boundaries #6970
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
base: main
Are you sure you want to change the base?
Changes from 12 commits
c35cfed
a83baa6
d79e391
663c749
c702796
0d54ced
260bee1
7bb6abf
5e578f6
96cf059
6124bc2
8257c44
2b780fc
d4660ba
e077394
4a2e3e8
eca3d02
a5d45ba
db132e3
47b5f8a
968c13f
b352969
99f745f
79e0341
aabf5e4
6e994ac
22f70d3
9b48c2b
65af789
ab57126
2e09539
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -212,6 +212,27 @@ namespace aspect | |
| bool | ||
| allows_fixed_composition_on_outflow_boundaries() const; | ||
|
|
||
| /* | ||
| * Return whether on the given boundary the given field | ||
| * is fixed. | ||
| */ | ||
| bool | ||
| get_component_mask_for_field(const types::boundary_id boundary_id, | ||
| const unsigned int compositional_field) const; | ||
|
|
||
| /* | ||
| * Return whether there are boundaries where only a subset | ||
|
anne-glerum marked this conversation as resolved.
|
||
| * of fields is fixed. | ||
| */ | ||
| bool | ||
| boundaries_with_fixed_subset_of_fields_exist() const; | ||
|
|
||
| std::vector<unsigned int> | ||
| get_fixed_fields_on_boundary (const types::boundary_id boundary_id) const; | ||
|
anne-glerum marked this conversation as resolved.
|
||
|
|
||
| std::set<types::boundary_id> | ||
| get_fixed_boundaries_for_field (const unsigned int compositional_field) const; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We often use "prescribed" instead of "fixed" I think. Think about which one makes more sense?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like prescribed more, but in the prm file and in the original plugin interface, |
||
|
|
||
| /** | ||
| * For the current plugin subsystem, write a connection graph of all of the | ||
| * plugins we know about, in the format that the | ||
|
|
@@ -235,8 +256,28 @@ namespace aspect | |
| << arg1 | ||
| << "> among the names of registered boundary composition objects."); | ||
| private: | ||
|
|
||
| /** | ||
| * A list of enums of boundary composition operators that have been | ||
| * A list of boundary indicators that indicate for | ||
| * each plugin in the list of plugin_objects which boundary id | ||
| * it is responsible for. By default each plugin | ||
| * is active for all boundaries, but this list | ||
| * can be modified by derived classes to limit the application | ||
| * of plugins to specific boundaries. | ||
| */ | ||
| std::vector <std::vector<types::boundary_id>> boundary_indicators; | ||
|
|
||
|
|
||
| /** | ||
| * A list of masks that specify for each plugin object | ||
| * for each boundary it applies to which compositional fields | ||
| * are prescribed (true) and which are not (false). | ||
| */ | ||
| std::vector <std::vector<ComponentMask>> masks_fields; | ||
|
|
||
| /** | ||
| * A list of enums of boundary composition operators for each | ||
| * boundary composition plugin that has been | ||
| * requested in the parameter file. Each name is associated | ||
| * with a model_name, and is used to modify the composition | ||
| * boundary with the values from the current plugin. | ||
|
|
@@ -254,6 +295,12 @@ namespace aspect | |
| * where material flows out of the domain. | ||
| */ | ||
| bool allow_fixed_composition_on_outflow_boundaries; | ||
|
|
||
| /** | ||
| * Whether one or more boundaries only have fixed boundary conditions | ||
| * for a subset of fields. | ||
| */ | ||
| bool boundaries_with_fixed_subset_of_fields = false; | ||
| }; | ||
|
|
||
|
|
||
|
|
||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| # A test for specifying fixed compositions for only | ||
| # a subset of the compositional fields. The subset | ||
| # also use different boundary composition plugins to | ||
| # set the fixed values. | ||
|
|
||
| set Dimension = 2 | ||
| set Use years instead of seconds = true | ||
| set End time = 0 | ||
|
|
||
| subsection Geometry model | ||
| set Model name = box | ||
|
|
||
| subsection Box | ||
| set X extent = 660000 | ||
| set Y extent = 660000 | ||
| end | ||
| end | ||
|
|
||
| subsection Compositional fields | ||
| set Number of fields = 3 | ||
| set Names of fields = field1, field2, field3 | ||
| end | ||
|
|
||
| subsection Boundary composition model | ||
| set List of model names = box, function, initial composition | ||
| set List of model operators = maximum, subtract, add | ||
| set Fixed composition boundary indicators = top;field1:box,\ | ||
| top;field2:box|function,\ | ||
| left,\ | ||
| bottom;field1|field2|field3:box|function|initial composition,\ | ||
| right | ||
|
|
||
| subsection Box | ||
| set Left composition = 15, 15, 15 | ||
| set Right composition = 0, 0, 0 | ||
| set Top composition = 0, 0, 0 | ||
| set Bottom composition = 7, 7, 7 | ||
| end | ||
|
|
||
| subsection Function | ||
| set Function expression = if (x>500000,3,0); if (x>500000,3,0); if (x>500000,3,0); | ||
| end | ||
| end | ||
|
|
||
| subsection Initial composition model | ||
| set List of model names = function | ||
|
|
||
| subsection Function | ||
| set Function expression = if ((x-330000)*(x-330000)+(y-330000)*(y-330000) < 100000*100000,-1,1.5);\ | ||
| if ((x-330000)*(x-330000)+(y-330000)*(y-330000) < 100000*100000,-1,1.5);\ | ||
| if ((x-330000)*(x-330000)+(y-330000)*(y-330000) < 100000*100000,-1,1.5); | ||
| end | ||
| end | ||
|
|
||
| subsection Initial temperature model | ||
| set List of model names = function | ||
|
|
||
| subsection Function | ||
| set Function expression = if ((x-330000)*(x-330000)+(y-330000)*(y-330000) < 100000*100000,-1,1.5) | ||
| end | ||
| end | ||
|
|
||
| subsection Boundary temperature model | ||
| set List of model names = box, constant, function, initial temperature | ||
| set List of model operators = maximum, add, subtract, add | ||
| set Fixed temperature boundary indicators = top,left,bottom,right | ||
|
|
||
| subsection Box | ||
| set Left temperature = 15 | ||
| end | ||
|
|
||
| subsection Constant | ||
| set Boundary indicator to temperature mappings = bottom:7, left:0, top:0, right:0 | ||
| end | ||
|
|
||
| subsection Function | ||
| set Function expression = if (x>500000,3,0) | ||
| end | ||
| end | ||
|
|
||
| subsection Boundary velocity model | ||
| set Prescribed velocity boundary indicators = bottom:function,left:function,right:function,top:function | ||
|
|
||
| subsection Function | ||
| set Function expression = 1;0 | ||
| end | ||
| end | ||
|
|
||
| subsection Gravity model | ||
| set Model name = vertical | ||
|
|
||
| subsection Vertical | ||
| set Magnitude = 10 | ||
| end | ||
| end | ||
|
|
||
| subsection Material model | ||
| set Model name = simple | ||
|
|
||
| subsection Simple model | ||
| set Viscosity = 1e21 | ||
| end | ||
| end | ||
|
|
||
| subsection Mesh refinement | ||
| set Initial global refinement = 4 | ||
| set Initial adaptive refinement = 0 | ||
| set Time steps between mesh refinement = 0 | ||
| end | ||
|
|
||
| subsection Postprocess | ||
| set List of postprocessors = composition statistics | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
|
|
||
| Number of active cells: 256 (on 5 levels) | ||
| Number of degrees of freedom: 4,645 (2,178+289+1,089+1,089) | ||
|
|
||
| *** Timestep 0: t=0 years, dt=0 years | ||
| Solving temperature system... 0 iterations. | ||
| Solving C_1 system ... 0 iterations. | ||
| Solving Stokes system (GMG)... 14+0 iterations. | ||
|
|
||
| Postprocessing: | ||
| Compositions min/max/mass: -1.5/16.5/6.759e+11 | ||
|
|
||
| Termination requested by criterion: end time | ||
|
|
||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # 1: Time step number | ||
| # 2: Time (years) | ||
| # 3: Time step size (years) | ||
| # 4: Number of mesh cells | ||
| # 5: Number of Stokes degrees of freedom | ||
| # 6: Number of temperature degrees of freedom | ||
| # 7: Number of degrees of freedom for all compositions | ||
| # 8: Iterations for temperature solver | ||
| # 9: Iterations for composition solver 1 | ||
| # 10: Iterations for Stokes solver | ||
| # 11: Velocity iterations in Stokes preconditioner | ||
| # 12: Schur complement iterations in Stokes preconditioner | ||
| # 13: Minimal value for composition C_1 | ||
| # 14: Maximal value for composition C_1 | ||
| # 15: Global mass for composition C_1 | ||
| 0 0.000000000000e+00 0.000000000000e+00 256 2467 1089 1089 0 0 14 15 15 -1.50000000e+00 1.65000000e+01 6.75945703e+11 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # A test for specifying fixed compositions for only | ||
| # a subset of the compositional fields when the composition | ||
| # is also fixed on outflow boundaries. | ||
| include $ASPECT_SOURCE_DIR/tests/boundary_composition_plugin_per_boundary.prm | ||
|
|
||
| set Dimension = 2 | ||
|
|
||
| subsection Boundary composition model | ||
| # The right boundary experiences outflow | ||
| set Allow fixed composition on outflow boundaries = true | ||
| end | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
|
|
||
| Number of active cells: 256 (on 5 levels) | ||
| Number of degrees of freedom: 4,645 (2,178+289+1,089+1,089) | ||
|
|
||
| *** Timestep 0: t=0 years, dt=0 years | ||
| Solving temperature system... 0 iterations. | ||
| Solving C_1 system ... 0 iterations. | ||
| Solving Stokes system (GMG)... 14+0 iterations. | ||
|
|
||
| Postprocessing: | ||
| Compositions min/max/mass: -1.5/16.5/6.759e+11 | ||
|
|
||
| Termination requested by criterion: end time | ||
|
|
||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # 1: Time step number | ||
| # 2: Time (years) | ||
| # 3: Time step size (years) | ||
| # 4: Number of mesh cells | ||
| # 5: Number of Stokes degrees of freedom | ||
| # 6: Number of temperature degrees of freedom | ||
| # 7: Number of degrees of freedom for all compositions | ||
| # 8: Iterations for temperature solver | ||
| # 9: Iterations for composition solver 1 | ||
| # 10: Iterations for Stokes solver | ||
| # 11: Velocity iterations in Stokes preconditioner | ||
| # 12: Schur complement iterations in Stokes preconditioner | ||
| # 13: Minimal value for composition C_1 | ||
| # 14: Maximal value for composition C_1 | ||
| # 15: Global mass for composition C_1 | ||
| 0 0.000000000000e+00 0.000000000000e+00 256 2467 1089 1089 0 0 14 15 15 -1.50000000e+00 1.65000000e+01 6.75945703e+11 |
Uh oh!
There was an error while loading. Please reload this page.