Merge lp:~fluidity-core/fluidity/sediment into lp:fluidity
- sediment
- Merge into dev-trunk
Status: | Merged |
---|---|
Merged at revision: | 4107 |
Proposed branch: | lp:~fluidity-core/fluidity/sediment |
Merge into: | lp:fluidity |
Diff against target: |
458 lines (+183/-78) 7 files modified
schemas/fluidity_options.rnc (+18/-9) schemas/fluidity_options.rng (+26/-13) schemas/prognostic_field_options.rnc (+5/-0) schemas/prognostic_field_options.rng (+7/-0) sediments/Sediment.F90 (+12/-19) sediments/Sediment_Diagnostics.F90 (+11/-27) tests/mms_sediment/MMS_X.flml (+104/-10) |
To merge this branch: | bzr merge lp:~fluidity-core/fluidity/sediment |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jon Hill | Approve | ||
Review via email:
|
Commit message
Description of the change
Changed bedload field to prognostic. I think it is a prognostic field really despite being trivial to solve and this way:
A) it can be checkpointed
B) we can start with an abritrary initial condition
I know you said you didn't like this solution but it seems the simplest option. What do you think?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jon Hill (jon-hill) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Samuel Parkinson (s-parkinson11) wrote : | # |
Thanks again Jon. Yes I agree that perhaps this isn't the nicest way to do this. I am not totally sure what you mean by an options check for a CV field, can you elaborate at all?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jon Hill (jon-hill) wrote : | # |
The schema says:
No solver settings are required as the sediment model only works
for p1 CG or DG fields where the mass matrix can be easily inverted.
So if you have a CV field this won't work. You should check which discretisation has been set and error if CV.
- 3488. By Samuel Parkinson
-
fixed error in schema description
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Samuel Parkinson (s-parkinson11) wrote : | # |
This was actually an error in the description. It will work for CV just not for >P1 discretisations
- 3489. By Samuel Parkinson
-
changed mms test schema so that bedload is not calculated
- 3490. By Samuel Parkinson
-
merge with trunk
- 3491. By Samuel Parkinson
-
merge with trunk
- 3492. By Samuel Parkinson
-
removed some multiphase compatibility due to bug in flredecomp
- 3493. By Samuel Parkinson
-
merge with trunk
Preview Diff
1 | === modified file 'schemas/fluidity_options.rnc' | |||
2 | --- schemas/fluidity_options.rnc 2012-09-25 06:55:02 +0000 | |||
3 | +++ schemas/fluidity_options.rnc 2012-10-24 15:56:21 +0000 | |||
4 | @@ -1829,24 +1829,33 @@ | |||
5 | 1829 | ## deposited through the prescribed boundary. | 1829 | ## deposited through the prescribed boundary. |
6 | 1830 | ## | 1830 | ## |
7 | 1831 | ## The units are in unit distances as a depth of sediment. | 1831 | ## The units are in unit distances as a depth of sediment. |
8 | 1832 | ## | ||
9 | 1833 | ## - The equation type must be set to SedimentBedload | ||
10 | 1834 | ## | ||
11 | 1835 | ## - Spatial discretisation should be as the parent sediment class | ||
12 | 1836 | ## | ||
13 | 1837 | ## - Initial conditions can be set as normal | ||
14 | 1838 | ## | ||
15 | 1839 | ## - Most other settings are irrelevant | ||
16 | 1840 | ## - No solver settings are required as the sediment model only works | ||
17 | 1841 | ## for p1 discretisations where the mass matrix can be easily inverted. | ||
18 | 1842 | ## - The bedload is always calculated completely explicitly | ||
19 | 1843 | ## - You cannot apply Source or Absorbtion terms to the bedload | ||
20 | 1844 | ## - There is no diffusion of the bedload | ||
21 | 1832 | element scalar_field { | 1845 | element scalar_field { |
22 | 1833 | attribute rank { "0" }, | 1846 | attribute rank { "0" }, |
23 | 1834 | attribute name { "Bedload" }, | 1847 | attribute name { "Bedload" }, |
24 | 1835 | ## Field type | 1848 | ## Field type |
25 | 1836 | ( | 1849 | ( |
27 | 1837 | element diagnostic { | 1850 | element prognostic { |
28 | 1838 | ## Surface ids over which to calculate the bedload: | 1851 | ## Surface ids over which to calculate the bedload: |
29 | 1839 | element surface_ids { | 1852 | element surface_ids { |
30 | 1840 | integer_vector | 1853 | integer_vector |
31 | 1841 | }, | 1854 | }, |
40 | 1842 | diagnostic_scalar_field | 1855 | prognostic_scalar_field, |
41 | 1843 | }| | 1856 | ## Disables calculation of change to bedload due to |
42 | 1844 | element prescribed { | 1857 | ## erosion/deposition (generally only used for mms testing): |
43 | 1845 | ## Surface ids over which to calculate the bedload deposition: | 1858 | element disable_calculation { empty }? |
36 | 1846 | element surface_ids { | ||
37 | 1847 | integer_vector | ||
38 | 1848 | }, | ||
39 | 1849 | prescribed_scalar_field | ||
44 | 1850 | } | 1859 | } |
45 | 1851 | ) | 1860 | ) |
46 | 1852 | }, | 1861 | }, |
47 | 1853 | 1862 | ||
48 | === modified file 'schemas/fluidity_options.rng' | |||
49 | --- schemas/fluidity_options.rng 2012-09-25 06:55:02 +0000 | |||
50 | +++ schemas/fluidity_options.rng 2012-10-24 15:56:21 +0000 | |||
51 | @@ -2562,30 +2562,43 @@ | |||
52 | 2562 | <a:documentation>Sediment bedload diagnostic which records the sediment | 2562 | <a:documentation>Sediment bedload diagnostic which records the sediment |
53 | 2563 | deposited through the prescribed boundary. | 2563 | deposited through the prescribed boundary. |
54 | 2564 | 2564 | ||
56 | 2565 | The units are in unit distances as a depth of sediment.</a:documentation> | 2565 | The units are in unit distances as a depth of sediment. |
57 | 2566 | |||
58 | 2567 | - The equation type must be set to SedimentBedload | ||
59 | 2568 | |||
60 | 2569 | - Spatial discretisation should be as the parent sediment class | ||
61 | 2570 | |||
62 | 2571 | - Initial conditions can be set as normal | ||
63 | 2572 | |||
64 | 2573 | - Most other settings are irrelevant | ||
65 | 2574 | - No solver settings are required as the sediment model only works | ||
66 | 2575 | for p1 CG or DG fields where the mass matrix can be easily inverted. | ||
67 | 2576 | - The bedload is always calculated completely explicitly | ||
68 | 2577 | - You cannot apply Source or Absorbtion terms to the bedload | ||
69 | 2578 | - There is no diffusion of the bedload</a:documentation> | ||
70 | 2566 | <attribute name="rank"> | 2579 | <attribute name="rank"> |
71 | 2567 | <value>0</value> | 2580 | <value>0</value> |
72 | 2568 | </attribute> | 2581 | </attribute> |
73 | 2569 | <attribute name="name"> | 2582 | <attribute name="name"> |
74 | 2570 | <value>Bedload</value> | 2583 | <value>Bedload</value> |
75 | 2571 | </attribute> | 2584 | </attribute> |
77 | 2572 | <choice> | 2585 | <group> |
78 | 2573 | <a:documentation>Field type</a:documentation> | 2586 | <a:documentation>Field type</a:documentation> |
80 | 2574 | <element name="diagnostic"> | 2587 | <element name="prognostic"> |
81 | 2575 | <element name="surface_ids"> | 2588 | <element name="surface_ids"> |
82 | 2576 | <a:documentation>Surface ids over which to calculate the bedload:</a:documentation> | 2589 | <a:documentation>Surface ids over which to calculate the bedload:</a:documentation> |
83 | 2577 | <ref name="integer_vector"/> | 2590 | <ref name="integer_vector"/> |
84 | 2578 | </element> | 2591 | </element> |
95 | 2579 | <ref name="diagnostic_scalar_field"/> | 2592 | <ref name="prognostic_scalar_field"/> |
96 | 2580 | </element> | 2593 | <optional> |
97 | 2581 | <element name="prescribed"> | 2594 | <element name="disable_calculation"> |
98 | 2582 | <element name="surface_ids"> | 2595 | <a:documentation>Disables calculation of change to bedload due to |
99 | 2583 | <a:documentation>Surface ids over which to calculate the bedload deposition:</a:documentation> | 2596 | erosion/deposition (generally only used for mms testing):</a:documentation> |
100 | 2584 | <ref name="integer_vector"/> | 2597 | <empty/> |
101 | 2585 | </element> | 2598 | </element> |
102 | 2586 | <ref name="prescribed_scalar_field"/> | 2599 | </optional> |
103 | 2587 | </element> | 2600 | </element> |
104 | 2588 | </choice> | 2601 | </group> |
105 | 2589 | </element> | 2602 | </element> |
106 | 2590 | <element name="scalar_field"> | 2603 | <element name="scalar_field"> |
107 | 2591 | <a:documentation>Sediment bedload diagnostic which records the sediment | 2604 | <a:documentation>Sediment bedload diagnostic which records the sediment |
108 | 2592 | 2605 | ||
109 | === modified file 'schemas/prognostic_field_options.rnc' | |||
110 | --- schemas/prognostic_field_options.rnc 2012-09-18 08:03:27 +0000 | |||
111 | +++ schemas/prognostic_field_options.rnc 2012-10-24 15:56:21 +0000 | |||
112 | @@ -2068,6 +2068,11 @@ | |||
113 | 2068 | ## Note: Only works for continuous galerkin or control volume discretisations. | 2068 | ## Note: Only works for continuous galerkin or control volume discretisations. |
114 | 2069 | element equation { | 2069 | element equation { |
115 | 2070 | attribute name { "KEpsilon" } | 2070 | attribute name { "KEpsilon" } |
116 | 2071 | }| | ||
117 | 2072 | ## Equation type for the sediment bedload fields. | ||
118 | 2073 | ## Note: Only works for P1 discretisations. | ||
119 | 2074 | element equation { | ||
120 | 2075 | attribute name { "SedimentBedload" } | ||
121 | 2071 | } | 2076 | } |
122 | 2072 | ) | 2077 | ) |
123 | 2073 | ) | 2078 | ) |
124 | 2074 | 2079 | ||
125 | === modified file 'schemas/prognostic_field_options.rng' | |||
126 | --- schemas/prognostic_field_options.rng 2012-09-18 08:03:27 +0000 | |||
127 | +++ schemas/prognostic_field_options.rng 2012-10-24 15:56:21 +0000 | |||
128 | @@ -2553,6 +2553,13 @@ | |||
129 | 2553 | <value>KEpsilon</value> | 2553 | <value>KEpsilon</value> |
130 | 2554 | </attribute> | 2554 | </attribute> |
131 | 2555 | </element> | 2555 | </element> |
132 | 2556 | <element name="equation"> | ||
133 | 2557 | <a:documentation>Equation type for the sediment bedload fields. | ||
134 | 2558 | Note: Only works for P1 discretisations.</a:documentation> | ||
135 | 2559 | <attribute name="name"> | ||
136 | 2560 | <value>SedimentBedload</value> | ||
137 | 2561 | </attribute> | ||
138 | 2562 | </element> | ||
139 | 2556 | </choice> | 2563 | </choice> |
140 | 2557 | </define> | 2564 | </define> |
141 | 2558 | <define name="equation_coefficients"> | 2565 | <define name="equation_coefficients"> |
142 | 2559 | 2566 | ||
143 | === modified file 'sediments/Sediment.F90' | |||
144 | --- sediments/Sediment.F90 2012-09-17 13:35:07 +0000 | |||
145 | +++ sediments/Sediment.F90 2012-10-24 15:56:21 +0000 | |||
146 | @@ -81,7 +81,8 @@ | |||
147 | 81 | integer, intent(out), optional :: stat | 81 | integer, intent(out), optional :: stat |
148 | 82 | character(len=FIELD_NAME_LEN) :: name | 82 | character(len=FIELD_NAME_LEN) :: name |
149 | 83 | 83 | ||
151 | 84 | call get_option(trim(state%option_path)//'/sediment/scalar_field['//int2str(i_field -& | 84 | ! had to remove trim(state%option_path)// as this didn't work with flredecomp |
152 | 85 | call get_option('/material_phase[0]/sediment/scalar_field['//int2str(i_field -& | ||
153 | 85 | & 1)//']/name', name) | 86 | & 1)//']/name', name) |
154 | 86 | item => extract_scalar_field(state, trim(name), stat) | 87 | item => extract_scalar_field(state, trim(name), stat) |
155 | 87 | 88 | ||
156 | @@ -95,7 +96,8 @@ | |||
157 | 95 | character(len=FIELD_NAME_LEN), intent(out) :: item | 96 | character(len=FIELD_NAME_LEN), intent(out) :: item |
158 | 96 | integer, intent(out), optional :: stat | 97 | integer, intent(out), optional :: stat |
159 | 97 | 98 | ||
161 | 98 | call get_option(trim(state%option_path)//'/sediment/scalar_field['//int2str(i_field -& | 99 | ! had to remove trim(state%option_path)// as this didn't work with flredecomp |
162 | 100 | call get_option('/material_phase[0]/sediment/scalar_field['//int2str(i_field -& | ||
163 | 99 | & 1)//']/name', item, stat=stat) | 101 | & 1)//']/name', item, stat=stat) |
164 | 100 | 102 | ||
165 | 101 | end subroutine get_sediment_field_name | 103 | end subroutine get_sediment_field_name |
166 | @@ -109,7 +111,8 @@ | |||
167 | 109 | character(len=FIELD_NAME_LEN), intent(out) :: item | 111 | character(len=FIELD_NAME_LEN), intent(out) :: item |
168 | 110 | integer, intent(out), optional :: stat | 112 | integer, intent(out), optional :: stat |
169 | 111 | 113 | ||
171 | 112 | call get_option(trim(state%option_path)//'/sediment/scalar_field['//int2str(i_field -& | 114 | ! had to remove trim(state%option_path)// as this didn't work with flredecomp |
172 | 115 | call get_option('/material_phase[0]/sediment/scalar_field['//int2str(i_field -& | ||
173 | 113 | & 1)//']/prognostic/'//option, item, stat=stat) | 116 | & 1)//']/prognostic/'//option, item, stat=stat) |
174 | 114 | 117 | ||
175 | 115 | end subroutine get_sediment_option_string | 118 | end subroutine get_sediment_option_string |
176 | @@ -124,7 +127,8 @@ | |||
177 | 124 | integer, intent(out), optional :: stat | 127 | integer, intent(out), optional :: stat |
178 | 125 | real, intent(in), optional :: default | 128 | real, intent(in), optional :: default |
179 | 126 | 129 | ||
181 | 127 | call get_option(trim(state%option_path)//'/sediment/scalar_field['//int2str(i_field -& | 130 | ! had to remove trim(state%option_path)// as this didn't work with flredecomp |
182 | 131 | call get_option('/material_phase[0]/sediment/scalar_field['//int2str(i_field -& | ||
183 | 128 | & 1)//']/prognostic/'//option, item, stat = stat, default = default) | 132 | & 1)//']/prognostic/'//option, item, stat = stat, default = default) |
184 | 129 | 133 | ||
185 | 130 | end subroutine get_sediment_option_real | 134 | end subroutine get_sediment_option_real |
186 | @@ -140,7 +144,8 @@ | |||
187 | 140 | 144 | ||
188 | 141 | character(len=FIELD_NAME_LEN) :: field_name | 145 | character(len=FIELD_NAME_LEN) :: field_name |
189 | 142 | 146 | ||
191 | 143 | call get_option(trim(state%option_path)//'/sediment/scalar_field['//int2str(i_field -& | 147 | ! had to remove trim(state%option_path)// as this didn't work with flredecomp |
192 | 148 | call get_option('/material_phase[0]/sediment/scalar_field['//int2str(i_field -& | ||
193 | 144 | & 1)//']/name', field_name) | 149 | & 1)//']/name', field_name) |
194 | 145 | item => extract_scalar_field(state, trim(field_name)//option, stat) | 150 | item => extract_scalar_field(state, trim(field_name)//option, stat) |
195 | 146 | 151 | ||
196 | @@ -499,7 +504,6 @@ | |||
197 | 499 | 504 | ||
198 | 500 | character(len=FIELD_NAME_LEN) :: field_mesh, sediment_mesh, bc_type | 505 | character(len=FIELD_NAME_LEN) :: field_mesh, sediment_mesh, bc_type |
199 | 501 | character(len=OPTION_PATH_LEN) :: field_option_path | 506 | character(len=OPTION_PATH_LEN) :: field_option_path |
200 | 502 | character(len=10) :: type | ||
201 | 503 | integer :: i_field, i_bc, i_bc_surf, i_bedload_surf,& | 507 | integer :: i_field, i_bc, i_bc_surf, i_bedload_surf,& |
202 | 504 | & n_sediment_fields, nbcs | 508 | & n_sediment_fields, nbcs |
203 | 505 | integer, dimension(2) :: bc_surface_id_count, bedload_surface_id_count | 509 | integer, dimension(2) :: bc_surface_id_count, bedload_surface_id_count |
204 | @@ -536,10 +540,6 @@ | |||
205 | 536 | ! Loop over boundary conditions for field | 540 | ! Loop over boundary conditions for field |
206 | 537 | boundary_conditions: do i_bc=0, nbcs-1 | 541 | boundary_conditions: do i_bc=0, nbcs-1 |
207 | 538 | 542 | ||
208 | 539 | ! get name and type of boundary condition | ||
209 | 540 | call get_option(trim(field_option_path)//'/boundary_conditions['//int2str(i_bc)//& | ||
210 | 541 | &']/type[0]/name', bc_type) | ||
211 | 542 | |||
212 | 543 | ! check whether this is a reentrainment boundary | 543 | ! check whether this is a reentrainment boundary |
213 | 544 | if (.not. (trim(bc_type) .eq. "sediment_reentrainment")) then | 544 | if (.not. (trim(bc_type) .eq. "sediment_reentrainment")) then |
214 | 545 | cycle boundary_conditions | 545 | cycle boundary_conditions |
215 | @@ -549,22 +549,15 @@ | |||
216 | 549 | if (.not.(have_option('/material_phase[0]/vector_field::BedShearStress'))) then | 549 | if (.not.(have_option('/material_phase[0]/vector_field::BedShearStress'))) then |
217 | 550 | FLExit("Reentrainment boundary condition requires a BedShearStress field") | 550 | FLExit("Reentrainment boundary condition requires a BedShearStress field") |
218 | 551 | end if | 551 | end if |
219 | 552 | |||
220 | 553 | ! warn if bedload field is prescribed | ||
221 | 554 | type = 'diagnostic' | ||
222 | 555 | if (have_option(trim(field_option_path)//'/scalar_field::Bedload/prescribed')) then | ||
223 | 556 | ewrite(0,*) 'WARNING: Bedload field is prescribed' | ||
224 | 557 | type = 'prescribed' | ||
225 | 558 | end if | ||
226 | 559 | 552 | ||
227 | 560 | ! check boundary id's are the same for re-entrainment and bedload | 553 | ! check boundary id's are the same for re-entrainment and bedload |
228 | 561 | 554 | ||
229 | 562 | ! get bedload surface ids | 555 | ! get bedload surface ids |
230 | 563 | bedload_surface_id_count=option_shape(trim(field_option_path)// & | 556 | bedload_surface_id_count=option_shape(trim(field_option_path)// & |
232 | 564 | '/scalar_field::Bedload/'//type//'/surface_ids') | 557 | '/scalar_field::Bedload/prognostic/surface_ids') |
233 | 565 | allocate(bedload_surface_ids(bedload_surface_id_count(1))) | 558 | allocate(bedload_surface_ids(bedload_surface_id_count(1))) |
234 | 566 | call get_option(trim(field_option_path)// & | 559 | call get_option(trim(field_option_path)// & |
236 | 567 | '/scalar_field::Bedload/'//type//'/surface_ids', bedload_surface_ids) | 560 | '/scalar_field::Bedload/prognostic/surface_ids', bedload_surface_ids) |
237 | 568 | 561 | ||
238 | 569 | ! get reentrainment surface ids | 562 | ! get reentrainment surface ids |
239 | 570 | bc_surface_id_count=option_shape(trim(field_option_path)//'/boundary_conditions['& | 563 | bc_surface_id_count=option_shape(trim(field_option_path)//'/boundary_conditions['& |
240 | 571 | 564 | ||
241 | === modified file 'sediments/Sediment_Diagnostics.F90' | |||
242 | --- sediments/Sediment_Diagnostics.F90 2012-10-22 19:47:09 +0000 | |||
243 | +++ sediments/Sediment_Diagnostics.F90 2012-10-24 15:56:21 +0000 | |||
244 | @@ -173,19 +173,11 @@ | |||
245 | 173 | end if | 173 | end if |
246 | 174 | 174 | ||
247 | 175 | ! obtain surface ids over which to record deposition | 175 | ! obtain surface ids over which to record deposition |
261 | 176 | if (have_option(trim(bedload_field%option_path)//"/diagnostic")) then | 176 | surface_id_count=option_shape(trim(bedload_field%option_path)//& |
262 | 177 | surface_id_count=option_shape(trim(bedload_field%option_path)//& | 177 | &"/prognostic/surface_ids") |
263 | 178 | &"/diagnostic/surface_ids") | 178 | allocate(surface_ids(surface_id_count(1))) |
264 | 179 | allocate(surface_ids(surface_id_count(1))) | 179 | call get_option(trim(bedload_field%option_path)//"/prognostic/surface_ids", & |
265 | 180 | call get_option(trim(bedload_field%option_path)//"/diagnostic/surface_ids", & | 180 | & surface_ids) |
253 | 181 | & surface_ids) | ||
254 | 182 | else | ||
255 | 183 | surface_id_count=option_shape(trim(bedload_field%option_path)//& | ||
256 | 184 | &"/prescribed/surface_ids") | ||
257 | 185 | allocate(surface_ids(surface_id_count(1))) | ||
258 | 186 | call get_option(trim(bedload_field%option_path)//"/prescribed/surface_ids", & | ||
259 | 187 | & surface_ids) | ||
260 | 188 | end if | ||
266 | 189 | 181 | ||
267 | 190 | ! loop through elements in surface field | 182 | ! loop through elements in surface field |
268 | 191 | elements: do ele=1,element_count(deposited_sediment(i_field)) | 183 | elements: do ele=1,element_count(deposited_sediment(i_field)) |
269 | @@ -243,7 +235,7 @@ | |||
270 | 243 | call scale(diagnostic_field, 1./dt) | 235 | call scale(diagnostic_field, 1./dt) |
271 | 244 | end if | 236 | end if |
272 | 245 | 237 | ||
274 | 246 | if (.not. have_option(trim(bedload_field%option_path)//'/prescribed')) then | 238 | if (.not. have_option(trim(bedload_field%option_path)//'/prognostic/disable_calculation')) then |
275 | 247 | ! Add on sediment falling in and subtract sediment coming out | 239 | ! Add on sediment falling in and subtract sediment coming out |
276 | 248 | do i_node = 1, node_count(surface_mesh(i_field)) | 240 | do i_node = 1, node_count(surface_mesh(i_field)) |
277 | 249 | ! add deposited sediment | 241 | ! add deposited sediment |
278 | @@ -687,19 +679,11 @@ | |||
279 | 687 | end if | 679 | end if |
280 | 688 | 680 | ||
281 | 689 | ! obtain sediment bedload surface ids | 681 | ! obtain sediment bedload surface ids |
295 | 690 | if (have_option(trim(bedload%option_path)//"/diagnostic")) then | 682 | surface_id_count=option_shape(trim(bedload%option_path)//& |
296 | 691 | surface_id_count=option_shape(trim(bedload%option_path)//& | 683 | &"/prognostic/surface_ids") |
297 | 692 | &"/diagnostic/surface_ids") | 684 | allocate(surface_ids(surface_id_count(1))) |
298 | 693 | allocate(surface_ids(surface_id_count(1))) | 685 | call get_option(trim(bedload%option_path)//"/prognostic/surface_ids", & |
299 | 694 | call get_option(trim(bedload%option_path)//"/diagnostic/surface_ids", & | 686 | & surface_ids) |
287 | 695 | & surface_ids) | ||
288 | 696 | else | ||
289 | 697 | surface_id_count=option_shape(trim(bedload%option_path)//& | ||
290 | 698 | &"/prescribed/surface_ids") | ||
291 | 699 | allocate(surface_ids(surface_id_count(1))) | ||
292 | 700 | call get_option(trim(bedload%option_path)//"/prescribed/surface_ids", & | ||
293 | 701 | & surface_ids) | ||
294 | 702 | end if | ||
300 | 703 | 687 | ||
301 | 704 | ! loop through elements in surface field | 688 | ! loop through elements in surface field |
302 | 705 | elements: do i_ele=1, element_count(volume_fraction_surface) | 689 | elements: do i_ele=1, element_count(volume_fraction_surface) |
303 | 706 | 690 | ||
304 | === modified file 'tests/mms_sediment/MMS_X.flml' | |||
305 | --- tests/mms_sediment/MMS_X.flml 2012-08-30 10:34:23 +0000 | |||
306 | +++ tests/mms_sediment/MMS_X.flml 2012-10-24 15:56:21 +0000 | |||
307 | @@ -1215,23 +1215,70 @@ | |||
308 | 1215 | </steady_state> | 1215 | </steady_state> |
309 | 1216 | <consistent_interpolation/> | 1216 | <consistent_interpolation/> |
310 | 1217 | <scalar_field name="Bedload" rank="0"> | 1217 | <scalar_field name="Bedload" rank="0"> |
312 | 1218 | <prescribed> | 1218 | <prognostic> |
313 | 1219 | <surface_ids> | 1219 | <surface_ids> |
314 | 1220 | <integer_value shape="1" rank="1">2</integer_value> | 1220 | <integer_value shape="1" rank="1">2</integer_value> |
315 | 1221 | </surface_ids> | 1221 | </surface_ids> |
317 | 1222 | <value name="WholeMesh"> | 1222 | <equation name="AdvectionDiffusion"/> |
318 | 1223 | <spatial_discretisation> | ||
319 | 1224 | <continuous_galerkin> | ||
320 | 1225 | <stabilisation> | ||
321 | 1226 | <no_stabilisation/> | ||
322 | 1227 | </stabilisation> | ||
323 | 1228 | <advection_terms/> | ||
324 | 1229 | <mass_terms/> | ||
325 | 1230 | </continuous_galerkin> | ||
326 | 1231 | <conservative_advection> | ||
327 | 1232 | <real_value rank="0">0.0</real_value> | ||
328 | 1233 | </conservative_advection> | ||
329 | 1234 | </spatial_discretisation> | ||
330 | 1235 | <temporal_discretisation> | ||
331 | 1236 | <theta> | ||
332 | 1237 | <real_value rank="0">0.5</real_value> | ||
333 | 1238 | </theta> | ||
334 | 1239 | </temporal_discretisation> | ||
335 | 1240 | <solver> | ||
336 | 1241 | <iterative_method name="gmres"> | ||
337 | 1242 | <restart> | ||
338 | 1243 | <integer_value rank="0">30</integer_value> | ||
339 | 1244 | </restart> | ||
340 | 1245 | </iterative_method> | ||
341 | 1246 | <preconditioner name="sor"/> | ||
342 | 1247 | <relative_error> | ||
343 | 1248 | <real_value rank="0">1e-6</real_value> | ||
344 | 1249 | </relative_error> | ||
345 | 1250 | <absolute_error> | ||
346 | 1251 | <real_value rank="0">1e-15</real_value> | ||
347 | 1252 | </absolute_error> | ||
348 | 1253 | <max_iterations> | ||
349 | 1254 | <integer_value rank="0">1000</integer_value> | ||
350 | 1255 | </max_iterations> | ||
351 | 1256 | <never_ignore_solver_failures/> | ||
352 | 1257 | <diagnostics> | ||
353 | 1258 | <monitors/> | ||
354 | 1259 | </diagnostics> | ||
355 | 1260 | </solver> | ||
356 | 1261 | <initial_condition name="WholeMesh"> | ||
357 | 1223 | <python> | 1262 | <python> |
358 | 1224 | <string_value lines="20" type="code" language="python">def val(X,t): | 1263 | <string_value lines="20" type="code" language="python">def val(X,t): |
359 | 1225 | import mms_sediment_tools as k | 1264 | import mms_sediment_tools as k |
360 | 1226 | return k.s1_d(X)</string_value> | 1265 | return k.s1_d(X)</string_value> |
361 | 1227 | </python> | 1266 | </python> |
363 | 1228 | </value> | 1267 | </initial_condition> |
364 | 1229 | <output/> | 1268 | <output/> |
365 | 1230 | <stat/> | 1269 | <stat/> |
366 | 1270 | <convergence> | ||
367 | 1271 | <include_in_convergence/> | ||
368 | 1272 | </convergence> | ||
369 | 1231 | <detectors> | 1273 | <detectors> |
371 | 1232 | <exclude_from_detectors/> | 1274 | <include_in_detectors/> |
372 | 1233 | </detectors> | 1275 | </detectors> |
374 | 1234 | </prescribed> | 1276 | <steady_state> |
375 | 1277 | <include_in_steady_state/> | ||
376 | 1278 | </steady_state> | ||
377 | 1279 | <consistent_interpolation/> | ||
378 | 1280 | <disable_calculation/> | ||
379 | 1281 | </prognostic> | ||
380 | 1235 | </scalar_field> | 1282 | </scalar_field> |
381 | 1236 | <scalar_field name="BedloadVolumeFraction" rank="0"> | 1283 | <scalar_field name="BedloadVolumeFraction" rank="0"> |
382 | 1237 | <diagnostic> | 1284 | <diagnostic> |
383 | @@ -1424,23 +1471,70 @@ | |||
384 | 1424 | </steady_state> | 1471 | </steady_state> |
385 | 1425 | <consistent_interpolation/> | 1472 | <consistent_interpolation/> |
386 | 1426 | <scalar_field name="Bedload" rank="0"> | 1473 | <scalar_field name="Bedload" rank="0"> |
388 | 1427 | <prescribed> | 1474 | <prognostic> |
389 | 1428 | <surface_ids> | 1475 | <surface_ids> |
390 | 1429 | <integer_value shape="1" rank="1">2</integer_value> | 1476 | <integer_value shape="1" rank="1">2</integer_value> |
391 | 1430 | </surface_ids> | 1477 | </surface_ids> |
393 | 1431 | <value name="WholeMesh"> | 1478 | <equation name="AdvectionDiffusion"/> |
394 | 1479 | <spatial_discretisation> | ||
395 | 1480 | <continuous_galerkin> | ||
396 | 1481 | <stabilisation> | ||
397 | 1482 | <no_stabilisation/> | ||
398 | 1483 | </stabilisation> | ||
399 | 1484 | <advection_terms/> | ||
400 | 1485 | <mass_terms/> | ||
401 | 1486 | </continuous_galerkin> | ||
402 | 1487 | <conservative_advection> | ||
403 | 1488 | <real_value rank="0">0.0</real_value> | ||
404 | 1489 | </conservative_advection> | ||
405 | 1490 | </spatial_discretisation> | ||
406 | 1491 | <temporal_discretisation> | ||
407 | 1492 | <theta> | ||
408 | 1493 | <real_value rank="0">0.5</real_value> | ||
409 | 1494 | </theta> | ||
410 | 1495 | </temporal_discretisation> | ||
411 | 1496 | <solver> | ||
412 | 1497 | <iterative_method name="gmres"> | ||
413 | 1498 | <restart> | ||
414 | 1499 | <integer_value rank="0">30</integer_value> | ||
415 | 1500 | </restart> | ||
416 | 1501 | </iterative_method> | ||
417 | 1502 | <preconditioner name="sor"/> | ||
418 | 1503 | <relative_error> | ||
419 | 1504 | <real_value rank="0">1e-6</real_value> | ||
420 | 1505 | </relative_error> | ||
421 | 1506 | <absolute_error> | ||
422 | 1507 | <real_value rank="0">1e-15</real_value> | ||
423 | 1508 | </absolute_error> | ||
424 | 1509 | <max_iterations> | ||
425 | 1510 | <integer_value rank="0">1000</integer_value> | ||
426 | 1511 | </max_iterations> | ||
427 | 1512 | <never_ignore_solver_failures/> | ||
428 | 1513 | <diagnostics> | ||
429 | 1514 | <monitors/> | ||
430 | 1515 | </diagnostics> | ||
431 | 1516 | </solver> | ||
432 | 1517 | <initial_condition name="WholeMesh"> | ||
433 | 1432 | <python> | 1518 | <python> |
434 | 1433 | <string_value lines="20" type="code" language="python">def val(X,t): | 1519 | <string_value lines="20" type="code" language="python">def val(X,t): |
435 | 1434 | import mms_sediment_tools as k | 1520 | import mms_sediment_tools as k |
436 | 1435 | return k.s2_d(X)</string_value> | 1521 | return k.s2_d(X)</string_value> |
437 | 1436 | </python> | 1522 | </python> |
439 | 1437 | </value> | 1523 | </initial_condition> |
440 | 1438 | <output/> | 1524 | <output/> |
441 | 1439 | <stat/> | 1525 | <stat/> |
442 | 1526 | <convergence> | ||
443 | 1527 | <include_in_convergence/> | ||
444 | 1528 | </convergence> | ||
445 | 1440 | <detectors> | 1529 | <detectors> |
447 | 1441 | <exclude_from_detectors/> | 1530 | <include_in_detectors/> |
448 | 1442 | </detectors> | 1531 | </detectors> |
450 | 1443 | </prescribed> | 1532 | <steady_state> |
451 | 1533 | <include_in_steady_state/> | ||
452 | 1534 | </steady_state> | ||
453 | 1535 | <consistent_interpolation/> | ||
454 | 1536 | <disable_calculation/> | ||
455 | 1537 | </prognostic> | ||
456 | 1444 | </scalar_field> | 1538 | </scalar_field> |
457 | 1445 | <scalar_field name="BedloadVolumeFraction" rank="0"> | 1539 | <scalar_field name="BedloadVolumeFraction" rank="0"> |
458 | 1446 | <diagnostic> | 1540 | <diagnostic> |
Approve, but grudgingly. The checkpointing *should* work, but I agree that an abritrary initial condition is required here.
There might be a better way in the long term.
An options check for a CV field would be useful though. Can this be added?