Merge lp:~btollit/fluidity/pressure_CV_weak_pressure_BC into lp:fluidity
- pressure_CV_weak_pressure_BC
- Merge into dev-trunk
Status: | Merged |
---|---|
Approved by: | Cian Wilson |
Approved revision: | 3873 |
Merged at revision: | 3882 |
Proposed branch: | lp:~btollit/fluidity/pressure_CV_weak_pressure_BC |
Merge into: | lp:fluidity |
Diff against target: |
7063 lines (+6824/-2) 40 files modified
assemble/Makefile.dependencies (+17/-1) assemble/Makefile.in (+1/-1) assemble/Momentum_Equation.F90 (+6/-0) assemble/Pressure_Dirichlet_BCS_CV.F90 (+280/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet/Makefile (+32/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet/cube.geo (+39/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet.xml (+118/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_1d.flml (+411/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_2d.flml (+427/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_3d.flml (+442/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet/square.geo (+22/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/Makefile (+23/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain.xml (+46/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain_2d.flml (+372/-0) tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/square_rotated.geo (+38/-0) tests/darcy_p0p1_test_cty_cv_velBCinlet/Makefile (+32/-0) tests/darcy_p0p1_test_cty_cv_velBCinlet/cube.geo (+39/-0) tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet.xml (+94/-0) tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_1d.flml (+391/-0) tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_2d.flml (+407/-0) tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_3d.flml (+404/-0) tests/darcy_p0p1_test_cty_cv_velBCinlet/square.geo (+22/-0) tests/darcy_p0p1cv_pressBCinlet/Makefile (+32/-0) tests/darcy_p0p1cv_pressBCinlet/cube.geo (+39/-0) tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet.xml (+94/-0) tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_1d.flml (+384/-0) tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_2d.flml (+392/-0) tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_3d.flml (+398/-0) tests/darcy_p0p1cv_pressBCinlet/square.geo (+22/-0) tests/darcy_p0p1cv_pressBCinlet_1solidphase/Makefile (+32/-0) tests/darcy_p0p1cv_pressBCinlet_1solidphase/cube.geo (+39/-0) tests/darcy_p0p1cv_pressBCinlet_1solidphase/darcy_p0p1cv_pressBCinlet_1solidphase.xml (+94/-0) tests/darcy_p0p1cv_pressBCinlet_1solidphase/darcy_p0p1cv_pressBCinlet_1solidphase_1d.flml (+363/-0) tests/darcy_p0p1cv_pressBCinlet_1solidphase/darcy_p0p1cv_pressBCinlet_1solidphase_2d.flml (+379/-0) tests/darcy_p0p1cv_pressBCinlet_1solidphase/darcy_p0p1cv_pressBCinlet_1solidphase_3d.flml (+394/-0) tests/darcy_p0p1cv_pressBCinlet_1solidphase/square.geo (+22/-0) tests/darcy_p0p1cv_pressBCinlet_rotated_domain/Makefile (+23/-0) tests/darcy_p0p1cv_pressBCinlet_rotated_domain/darcy_p0p1cv_pressBCinlet_rotated_domain.xml (+46/-0) tests/darcy_p0p1cv_pressBCinlet_rotated_domain/darcy_p0p1cv_pressBCinlet_rotated_domain_2d.flml (+370/-0) tests/darcy_p0p1cv_pressBCinlet_rotated_domain/square_rotated.geo (+38/-0) |
To merge this branch: | bzr merge lp:~btollit/fluidity/pressure_CV_weak_pressure_BC |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Cian Wilson | Approve | ||
Review via email: mp+83558@code.launchpad.net |
Commit message
Description of the change
This merge will add a procedure to be able to have non zero pressure Dirichlet boundary conditions when using a CV discretisation for pressure. As for the CG pressure BCs the integrals are included for both weak and strong Dirichlet. For multiphase the phase volume fraction is included via a FE spatial interpolation, akin to their inclusion in interior domain terms.
Code Additions:
- assemble/
Code Changes:
- assemble/
- assemble/
- assemble/
Test Cases Removed:
- tests/mphase_
Test Cases Added:
- tests/darcy_
- tests/darcy_
- tests/darcy_
- tests/darcy_
- tests/darcy_
- tests/darcy_
Buildbot green (on Nov 25 18:48)
- 3872. By Brendan Tollit
-
Very small change to a comment.
- 3873. By Brendan Tollit
-
Merge trunk into branch
Brendan Tollit (btollit) wrote : | # |
Cian Wilson (cwilson) wrote : | # |
Looks good. Sorry for the delay in reviewing.
One comment/suggestion:
In Makefile.in:
Pressure_
Clearly, as it still compiles this doesn't make much difference!
- 3874. By Brendan Tollit
-
Change .F90 to .o spotted by Cian in review.
- 3875. By Brendan Tollit
-
Merge trunk into branch
Preview Diff
1 | === modified file 'assemble/Makefile.dependencies' | |||
2 | --- assemble/Makefile.dependencies 2011-10-27 23:11:25 +0000 | |||
3 | +++ assemble/Makefile.dependencies 2011-12-23 12:05:25 +0000 | |||
4 | @@ -579,7 +579,8 @@ | |||
5 | 579 | ../include/momentum_cg.mod ../include/momentum_dg.mod \ | 579 | ../include/momentum_cg.mod ../include/momentum_dg.mod \ |
6 | 580 | ../include/momentum_diagnostic_fields.mod ../include/multiphase_module.mod \ | 580 | ../include/momentum_diagnostic_fields.mod ../include/multiphase_module.mod \ |
7 | 581 | ../include/oceansurfaceforcing.mod ../include/parallel_tools.mod \ | 581 | ../include/oceansurfaceforcing.mod ../include/parallel_tools.mod \ |
9 | 582 | ../include/petsc_solve_state_module.mod ../include/profiler.mod \ | 582 | ../include/petsc_solve_state_module.mod \ |
10 | 583 | ../include/pressure_dirichlet_bcs_cv.mod ../include/profiler.mod \ | ||
11 | 583 | ../include/reduced_model_runtime.mod \ | 584 | ../include/reduced_model_runtime.mod \ |
12 | 584 | ../include/rotated_boundary_conditions.mod ../include/slope_limiters_dg.mod \ | 585 | ../include/rotated_boundary_conditions.mod ../include/slope_limiters_dg.mod \ |
13 | 585 | ../include/solvers.mod ../include/sparse_matrices_fields.mod \ | 586 | ../include/solvers.mod ../include/sparse_matrices_fields.mod \ |
14 | @@ -645,6 +646,21 @@ | |||
15 | 645 | ../include/fdebug.h ../include/fields.mod ../include/fldebug.mod \ | 646 | ../include/fdebug.h ../include/fields.mod ../include/fldebug.mod \ |
16 | 646 | ../include/spud.mod ../include/state_module.mod | 647 | ../include/spud.mod ../include/state_module.mod |
17 | 647 | 648 | ||
18 | 649 | ../include/pressure_dirichlet_bcs_cv.mod: Pressure_Dirichlet_BCS_CV.o | ||
19 | 650 | @true | ||
20 | 651 | |||
21 | 652 | Pressure_Dirichlet_BCS_CV.o ../include/pressure_dirichlet_bcs_cv.mod: \ | ||
22 | 653 | Pressure_Dirichlet_BCS_CV.F90 ../include/boundary_conditions.mod \ | ||
23 | 654 | ../include/cv_face_values.mod ../include/cv_faces.mod \ | ||
24 | 655 | ../include/cv_fields.mod ../include/cv_options.mod \ | ||
25 | 656 | ../include/cv_shape_functions.mod ../include/cv_upwind_values.mod \ | ||
26 | 657 | ../include/cvtools.mod ../include/diagnostic_fields.mod ../include/fdebug.h \ | ||
27 | 658 | ../include/fetools.mod ../include/field_derivatives.mod \ | ||
28 | 659 | ../include/field_options.mod ../include/fields.mod ../include/futils.mod \ | ||
29 | 660 | ../include/global_parameters.mod ../include/multiphase_module.mod \ | ||
30 | 661 | ../include/quadrature.mod ../include/sparsity_patterns_meshes.mod \ | ||
31 | 662 | ../include/spud.mod ../include/state_module.mod | ||
32 | 663 | |||
33 | 648 | ../include/pseudo_supermesh.mod: Pseudo_supermesh.o | 664 | ../include/pseudo_supermesh.mod: Pseudo_supermesh.o |
34 | 649 | @true | 665 | @true |
35 | 650 | 666 | ||
36 | 651 | 667 | ||
37 | === modified file 'assemble/Makefile.in' | |||
38 | --- assemble/Makefile.in 2011-10-21 10:05:25 +0000 | |||
39 | +++ assemble/Makefile.in 2011-12-23 12:05:25 +0000 | |||
40 | @@ -76,7 +76,7 @@ | |||
41 | 76 | Linear_Shallow_Water.o \ | 76 | Linear_Shallow_Water.o \ |
42 | 77 | Zoltan_global_variables.o Zoltan_integration.o Zoltan_callbacks.o Zoltan_detectors.o \ | 77 | Zoltan_global_variables.o Zoltan_integration.o Zoltan_callbacks.o Zoltan_detectors.o \ |
43 | 78 | Diagnostic_Children.o Reduced_Model_Runtime.o Turbine.o Implicit_Solids.o \ | 78 | Diagnostic_Children.o Reduced_Model_Runtime.o Turbine.o Implicit_Solids.o \ |
45 | 79 | Manifold_Projections.o Hybridized_Helmholtz.o Burgers_Assembly.o | 79 | Manifold_Projections.o Hybridized_Helmholtz.o Burgers_Assembly.o Pressure_Dirichlet_BCS_CV.o |
46 | 80 | 80 | ||
47 | 81 | .SUFFIXES: .F90 .c .cpp .o .a | 81 | .SUFFIXES: .F90 .c .cpp .o .a |
48 | 82 | 82 | ||
49 | 83 | 83 | ||
50 | === modified file 'assemble/Momentum_Equation.F90' | |||
51 | --- assemble/Momentum_Equation.F90 2011-11-23 17:00:55 +0000 | |||
52 | +++ assemble/Momentum_Equation.F90 2011-12-23 12:05:25 +0000 | |||
53 | @@ -74,6 +74,7 @@ | |||
54 | 74 | use slope_limiters_dg | 74 | use slope_limiters_dg |
55 | 75 | use implicit_solids | 75 | use implicit_solids |
56 | 76 | use multiphase_module | 76 | use multiphase_module |
57 | 77 | use pressure_dirichlet_bcs_cv | ||
58 | 77 | 78 | ||
59 | 78 | implicit none | 79 | implicit none |
60 | 79 | 80 | ||
61 | @@ -589,6 +590,11 @@ | |||
62 | 589 | include_pressure_and_continuity_bcs=.not. cv_pressure) | 590 | include_pressure_and_continuity_bcs=.not. cv_pressure) |
63 | 590 | end if | 591 | end if |
64 | 591 | 592 | ||
65 | 593 | ! If CV pressure then add in any dirichlet pressure BC integrals to the mom_rhs. | ||
66 | 594 | if (cv_pressure) then | ||
67 | 595 | call add_pressure_dirichlet_bcs_cv(mom_rhs(istate), u, p, state(istate)) | ||
68 | 596 | end if | ||
69 | 597 | |||
70 | 592 | ! Add in multiphase interactions (e.g. fluid-particle drag) if necessary | 598 | ! Add in multiphase interactions (e.g. fluid-particle drag) if necessary |
71 | 593 | ! Note: this is done outside of construct_momentum_cg/dg to keep things | 599 | ! Note: this is done outside of construct_momentum_cg/dg to keep things |
72 | 594 | ! neater in Momentum_CG/DG.F90, since we would need to pass around multiple phases | 600 | ! neater in Momentum_CG/DG.F90, since we would need to pass around multiple phases |
73 | 595 | 601 | ||
74 | === added file 'assemble/Pressure_Dirichlet_BCS_CV.F90' | |||
75 | --- assemble/Pressure_Dirichlet_BCS_CV.F90 1970-01-01 00:00:00 +0000 | |||
76 | +++ assemble/Pressure_Dirichlet_BCS_CV.F90 2011-12-23 12:05:25 +0000 | |||
77 | @@ -0,0 +1,280 @@ | |||
78 | 1 | ! Copyright (C) 2006 Imperial College London and others. | ||
79 | 2 | ! | ||
80 | 3 | ! Please see the AUTHORS file in the main source directory for a full list | ||
81 | 4 | ! of copyright holders. | ||
82 | 5 | ! | ||
83 | 6 | ! Prof. C Pain | ||
84 | 7 | ! Applied Modelling and Computation Group | ||
85 | 8 | ! Department of Earth Science and Engineering | ||
86 | 9 | ! Imperial College London | ||
87 | 10 | ! | ||
88 | 11 | ! amcgsoftware@imperial.ac.uk | ||
89 | 12 | ! | ||
90 | 13 | ! This library is free software; you can redistribute it and/or | ||
91 | 14 | ! modify it under the terms of the GNU Lesser General Public | ||
92 | 15 | ! License as published by the Free Software Foundation, | ||
93 | 16 | ! version 2.1 of the License. | ||
94 | 17 | ! | ||
95 | 18 | ! This library is distributed in the hope that it will be useful, | ||
96 | 19 | ! but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
97 | 20 | ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
98 | 21 | ! Lesser General Public License for more details. | ||
99 | 22 | ! | ||
100 | 23 | ! You should have received a copy of the GNU Lesser General Public | ||
101 | 24 | ! License along with this library; if not, write to the Free Software | ||
102 | 25 | ! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
103 | 26 | ! USA | ||
104 | 27 | #include "fdebug.h" | ||
105 | 28 | |||
106 | 29 | module pressure_dirichlet_bcs_cv | ||
107 | 30 | |||
108 | 31 | use quadrature | ||
109 | 32 | use fields | ||
110 | 33 | use field_derivatives | ||
111 | 34 | use state_module | ||
112 | 35 | use futils | ||
113 | 36 | use fetools | ||
114 | 37 | use spud | ||
115 | 38 | use cv_faces | ||
116 | 39 | use cv_shape_functions | ||
117 | 40 | use cvtools | ||
118 | 41 | use cv_fields | ||
119 | 42 | use cv_upwind_values | ||
120 | 43 | use cv_face_values | ||
121 | 44 | use cv_options | ||
122 | 45 | use diagnostic_fields, only: calculate_diagnostic_variable | ||
123 | 46 | use boundary_conditions | ||
124 | 47 | use global_parameters, only: OPTION_PATH_LEN | ||
125 | 48 | use field_options, only: get_coordinate_field | ||
126 | 49 | use sparsity_patterns_meshes | ||
127 | 50 | use multiphase_module | ||
128 | 51 | |||
129 | 52 | implicit none | ||
130 | 53 | |||
131 | 54 | private | ||
132 | 55 | |||
133 | 56 | public :: add_pressure_dirichlet_bcs_cv | ||
134 | 57 | |||
135 | 58 | contains | ||
136 | 59 | |||
137 | 60 | ! -------------------------------------------------------------------------------------- | ||
138 | 61 | |||
139 | 62 | subroutine add_pressure_dirichlet_bcs_cv(mom_rhs, u, p, state) | ||
140 | 63 | |||
141 | 64 | !!< Add any CV pressure dirichlet BC integrals to the mom_rhs field if required. | ||
142 | 65 | !!< If this is a multiphase simulation then the phase volume fraction spatial | ||
143 | 66 | !!< interpolation uses finite elements. This isnt striclty correct if the | ||
144 | 67 | !!< phase volume fractions were solved with a control volume discretisation | ||
145 | 68 | !!< and also whether of not they themselves have a weak BC is ignored. If the | ||
146 | 69 | !!< latter was to be considered then the upwind value should be used. | ||
147 | 70 | |||
148 | 71 | ! Note the pressure BC values come from the end of time step Pressure field | ||
149 | 72 | ! rather than using a theta average. The latter was tried but didnt work | ||
150 | 73 | ! because OldPressure had no BC info. Taking the end of time step value | ||
151 | 74 | ! for the BC is also what the pressure CG routine(s) do. | ||
152 | 75 | |||
153 | 76 | type(vector_field), intent(inout) :: mom_rhs | ||
154 | 77 | type(vector_field), intent(in) :: u | ||
155 | 78 | type(scalar_field), intent(in) :: p | ||
156 | 79 | type(state_type), intent(inout) :: state ! required for phase volume fraction | ||
157 | 80 | |||
158 | 81 | ! local variables | ||
159 | 82 | |||
160 | 83 | ! degree of quadrature over cv faces | ||
161 | 84 | integer :: quaddegree | ||
162 | 85 | |||
163 | 86 | real, dimension(:,:), allocatable :: x_ele, x_ele_bdy | ||
164 | 87 | real, dimension(:,:), allocatable :: normal_bdy | ||
165 | 88 | real, dimension(:), allocatable :: detwei_bdy | ||
166 | 89 | integer, dimension(:), allocatable :: u_nodes_bdy | ||
167 | 90 | |||
168 | 91 | integer :: ele, sele, iloc, jloc, face, gi, ggi, dim | ||
169 | 92 | |||
170 | 93 | ! information about cv faces | ||
171 | 94 | type(cv_faces_type) :: cvfaces | ||
172 | 95 | ! shape functions for surface | ||
173 | 96 | type(element_type) :: x_cvbdyshape | ||
174 | 97 | type(element_type) :: u_cvbdyshape | ||
175 | 98 | |||
176 | 99 | ! pointer to coordinates | ||
177 | 100 | type(vector_field), pointer :: x | ||
178 | 101 | |||
179 | 102 | ! pressure BC info | ||
180 | 103 | integer, dimension(:), allocatable :: pressure_bc_type | ||
181 | 104 | real, dimension(:), allocatable :: pressure_bc_val | ||
182 | 105 | type(scalar_field) :: pressure_bc | ||
183 | 106 | |||
184 | 107 | ! local ct matrix | ||
185 | 108 | real, dimension(:,:,:), allocatable :: ct_mat_local_bdy | ||
186 | 109 | |||
187 | 110 | ! Multiphase variables | ||
188 | 111 | logical :: multiphase | ||
189 | 112 | ! Volume fraction fields | ||
190 | 113 | type(scalar_field), pointer :: vfrac | ||
191 | 114 | type(scalar_field) :: nvfrac | ||
192 | 115 | |||
193 | 116 | ! Variables used for FE interpolation of vfrac on surface | ||
194 | 117 | ! Values of nvfrac at the faces | ||
195 | 118 | real, dimension(:), allocatable :: nvfrac_gi_f | ||
196 | 119 | ! CV shape functions for nvfrac (computed only if the Coordinate and | ||
197 | 120 | ! PhaseVolumeFraction meshes are different, otherwise it is | ||
198 | 121 | ! assigned x_cvbdyshape) | ||
199 | 122 | type(element_type) :: nvfrac_cvbdyshape | ||
200 | 123 | |||
201 | 124 | ewrite(1,*) 'In add_cv_pressure_weak_dirichlet_bcs' | ||
202 | 125 | |||
203 | 126 | x => extract_vector_field(state, "Coordinate") | ||
204 | 127 | |||
205 | 128 | allocate(x_ele(x%dim, x%mesh%shape%loc)) | ||
206 | 129 | |||
207 | 130 | call get_option("/geometry/quadrature/controlvolume_surface_degree", quaddegree, default=1) | ||
208 | 131 | |||
209 | 132 | cvfaces = find_cv_faces(vertices = ele_vertices(p, 1), & | ||
210 | 133 | dimension = mesh_dim(p), & | ||
211 | 134 | polydegree = p%mesh%shape%degree, & | ||
212 | 135 | quaddegree = quaddegree) | ||
213 | 136 | |||
214 | 137 | x_cvbdyshape = make_cvbdy_element_shape(cvfaces, x%mesh%faces%shape) | ||
215 | 138 | u_cvbdyshape = make_cvbdy_element_shape(cvfaces, u%mesh%faces%shape) | ||
216 | 139 | |||
217 | 140 | assert(surface_element_count(p) == surface_element_count(u)) | ||
218 | 141 | |||
219 | 142 | ! get the pressure BC field | ||
220 | 143 | allocate(pressure_bc_type(surface_element_count(p))) | ||
221 | 144 | |||
222 | 145 | call get_entire_boundary_condition(p, (/"weakdirichlet", & | ||
223 | 146 | "dirichlet "/), pressure_bc, pressure_bc_type) | ||
224 | 147 | |||
225 | 148 | allocate(x_ele_bdy(x%dim,x%mesh%faces%shape%loc), & | ||
226 | 149 | detwei_bdy(x_cvbdyshape%ngi), & | ||
227 | 150 | normal_bdy(x%dim, x_cvbdyshape%ngi), & | ||
228 | 151 | pressure_bc_val(pressure_bc%mesh%shape%loc)) | ||
229 | 152 | |||
230 | 153 | allocate(u_nodes_bdy(u%mesh%faces%shape%loc)) | ||
231 | 154 | |||
232 | 155 | allocate(ct_mat_local_bdy(x%dim, p%mesh%faces%shape%loc, u%mesh%faces%shape%loc)) | ||
233 | 156 | |||
234 | 157 | ! Check if we need to multiply through by the non-linear volume fraction | ||
235 | 158 | if(option_count("/material_phase/vector_field::Velocity/prognostic") > 1) then | ||
236 | 159 | multiphase = .true. | ||
237 | 160 | |||
238 | 161 | vfrac => extract_scalar_field(state, "PhaseVolumeFraction") | ||
239 | 162 | call allocate(nvfrac, vfrac%mesh, "NonlinearPhaseVolumeFraction") | ||
240 | 163 | call zero(nvfrac) | ||
241 | 164 | call get_nonlinear_volume_fraction(state, nvfrac) | ||
242 | 165 | |||
243 | 166 | assert(surface_element_count(p) == surface_element_count(vfrac)) | ||
244 | 167 | |||
245 | 168 | ewrite_minmax(nvfrac) | ||
246 | 169 | |||
247 | 170 | ! If the Coordinate and PhaseVolumeFraction meshes are different, then we need to | ||
248 | 171 | ! generate the PhaseVolumeFraction CV shape functions. | ||
249 | 172 | if(.not.(nvfrac%mesh == x%mesh)) then | ||
250 | 173 | nvfrac_cvbdyshape = make_cvbdy_element_shape(cvfaces, nvfrac%mesh%faces%shape) | ||
251 | 174 | else | ||
252 | 175 | nvfrac_cvbdyshape = x_cvbdyshape | ||
253 | 176 | ! incease reference for deallocates below | ||
254 | 177 | call incref(nvfrac_cvbdyshape) | ||
255 | 178 | end if | ||
256 | 179 | |||
257 | 180 | allocate(nvfrac_gi_f(nvfrac_cvbdyshape%ngi)) | ||
258 | 181 | |||
259 | 182 | else | ||
260 | 183 | multiphase = .false. | ||
261 | 184 | nullify(vfrac) | ||
262 | 185 | end if | ||
263 | 186 | |||
264 | 187 | surface_element_loop: do sele = 1, surface_element_count(p) | ||
265 | 188 | |||
266 | 189 | ! cycle if this not a dirichlet pressure BC. | ||
267 | 190 | if (pressure_bc_type(sele) == 0) cycle | ||
268 | 191 | |||
269 | 192 | ele = face_ele(x, sele) | ||
270 | 193 | x_ele = ele_val(x, ele) | ||
271 | 194 | x_ele_bdy = face_val(x, sele) | ||
272 | 195 | u_nodes_bdy = face_global_nodes(u, sele) | ||
273 | 196 | |||
274 | 197 | ! Get the phase volume fraction face value | ||
275 | 198 | if(multiphase) then | ||
276 | 199 | nvfrac_gi_f = face_val_at_quad(nvfrac, sele, nvfrac_cvbdyshape) | ||
277 | 200 | end if | ||
278 | 201 | |||
279 | 202 | call transform_cvsurf_facet_to_physical(x_ele, x_ele_bdy, & | ||
280 | 203 | x_cvbdyshape, normal_bdy, detwei_bdy) | ||
281 | 204 | |||
282 | 205 | ct_mat_local_bdy = 0.0 | ||
283 | 206 | |||
284 | 207 | ! calculate the ct local matrix | ||
285 | 208 | surface_nodal_loop_i: do iloc = 1, p%mesh%faces%shape%loc | ||
286 | 209 | |||
287 | 210 | surface_face_loop: do face = 1, cvfaces%sfaces | ||
288 | 211 | |||
289 | 212 | if(cvfaces%sneiloc(iloc,face) /= 0) then | ||
290 | 213 | |||
291 | 214 | surface_quadrature_loop: do gi = 1, cvfaces%shape%ngi | ||
292 | 215 | |||
293 | 216 | ggi = (face-1)*cvfaces%shape%ngi + gi | ||
294 | 217 | |||
295 | 218 | surface_nodal_loop_j: do jloc = 1, u%mesh%faces%shape%loc | ||
296 | 219 | |||
297 | 220 | surface_inner_dimension_loop: do dim = 1, size(normal_bdy,1) | ||
298 | 221 | |||
299 | 222 | if(multiphase) then | ||
300 | 223 | ct_mat_local_bdy(dim, iloc, jloc) = ct_mat_local_bdy(dim, iloc, jloc) + & | ||
301 | 224 | u_cvbdyshape%n(jloc,ggi)*detwei_bdy(ggi)*nvfrac_gi_f(ggi)*normal_bdy(dim, ggi) | ||
302 | 225 | else | ||
303 | 226 | ct_mat_local_bdy(dim, iloc, jloc) = ct_mat_local_bdy(dim, iloc, jloc) + & | ||
304 | 227 | u_cvbdyshape%n(jloc,ggi)*detwei_bdy(ggi)*normal_bdy(dim, ggi) | ||
305 | 228 | end if | ||
306 | 229 | |||
307 | 230 | end do surface_inner_dimension_loop | ||
308 | 231 | |||
309 | 232 | end do surface_nodal_loop_j | ||
310 | 233 | |||
311 | 234 | end do surface_quadrature_loop | ||
312 | 235 | |||
313 | 236 | end if | ||
314 | 237 | |||
315 | 238 | end do surface_face_loop | ||
316 | 239 | |||
317 | 240 | end do surface_nodal_loop_i | ||
318 | 241 | |||
319 | 242 | ! pressure dirichlet BC is -c*press_bc_val = -press_bc_val*ct, integrated over surface elements appropriate | ||
320 | 243 | surface_outer_dimension_loop: do dim = 1, size(normal_bdy,1) | ||
321 | 244 | |||
322 | 245 | ! for weak and strong pressure dirichlet bcs: | ||
323 | 246 | ! / | ||
324 | 247 | ! add -| N_i M_j \vec n p_j, where p_j are the prescribed bc values | ||
325 | 248 | ! / | ||
326 | 249 | |||
327 | 250 | call addto(mom_rhs, dim, u_nodes_bdy, -matmul(ele_val(pressure_bc, sele), ct_mat_local_bdy(dim,:,:))) | ||
328 | 251 | |||
329 | 252 | end do surface_outer_dimension_loop | ||
330 | 253 | |||
331 | 254 | end do surface_element_loop | ||
332 | 255 | |||
333 | 256 | call deallocate(pressure_bc) | ||
334 | 257 | deallocate(pressure_bc_type) | ||
335 | 258 | deallocate(pressure_bc_val) | ||
336 | 259 | call deallocate(x_cvbdyshape) | ||
337 | 260 | call deallocate(u_cvbdyshape) | ||
338 | 261 | deallocate(x_ele_bdy, detwei_bdy, normal_bdy) | ||
339 | 262 | |||
340 | 263 | deallocate(u_nodes_bdy) | ||
341 | 264 | deallocate(ct_mat_local_bdy) | ||
342 | 265 | |||
343 | 266 | call deallocate(cvfaces) | ||
344 | 267 | deallocate(x_ele) | ||
345 | 268 | |||
346 | 269 | if(multiphase) then | ||
347 | 270 | call deallocate(nvfrac) | ||
348 | 271 | deallocate(nvfrac_gi_f) | ||
349 | 272 | call deallocate(nvfrac_cvbdyshape) | ||
350 | 273 | end if | ||
351 | 274 | |||
352 | 275 | end subroutine add_pressure_dirichlet_bcs_cv | ||
353 | 276 | |||
354 | 277 | ! -------------------------------------------------------------------------------------- | ||
355 | 278 | |||
356 | 279 | end module pressure_dirichlet_bcs_cv | ||
357 | 280 | |||
358 | 0 | 281 | ||
359 | === added directory 'tests/darcy_p0p1_test_cty_cv_pressBCinlet' | |||
360 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet/Makefile' | |||
361 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet/Makefile 1970-01-01 00:00:00 +0000 | |||
362 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet/Makefile 2011-12-23 12:05:25 +0000 | |||
363 | @@ -0,0 +1,32 @@ | |||
364 | 1 | SHELL = sh | ||
365 | 2 | |||
366 | 3 | SIM = darcy_p0p1_test_cty_cv_pressBCinlet | ||
367 | 4 | |||
368 | 5 | # options for 1d mesh interval script | ||
369 | 6 | MESH_SIZE = 100.0 | ||
370 | 7 | LEFT_X = 0.0 | ||
371 | 8 | RIGHT_X = 300.0 | ||
372 | 9 | |||
373 | 10 | input: clean | ||
374 | 11 | interval --dx=$(MESH_SIZE) $(LEFT_X) $(RIGHT_X) $(SIM)_1d | ||
375 | 12 | gmsh -2 square.geo -o square.msh | ||
376 | 13 | gmsh -3 cube.geo -o cube.msh | ||
377 | 14 | |||
378 | 15 | clean: | ||
379 | 16 | rm -f *.ele | ||
380 | 17 | rm -f *.node | ||
381 | 18 | rm -f *.bound | ||
382 | 19 | rm -f *.edge | ||
383 | 20 | rm -f *.face | ||
384 | 21 | rm -f *.vtu | ||
385 | 22 | rm -f *.pvtu | ||
386 | 23 | rm -f *.s | ||
387 | 24 | rm -f *.stat | ||
388 | 25 | rm -f *.log-0 | ||
389 | 26 | rm -f *.err-0 | ||
390 | 27 | rm -f *.msh | ||
391 | 28 | rm -f *.halo | ||
392 | 29 | rm -f fluidity.err* | ||
393 | 30 | rm -f fluidity.log* | ||
394 | 31 | rm -f matrixdump* | ||
395 | 32 | rm -f first_timestep_adapted_mesh* | ||
396 | 0 | 33 | ||
397 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet/cube.geo' | |||
398 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet/cube.geo 1970-01-01 00:00:00 +0000 | |||
399 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet/cube.geo 2011-12-23 12:05:25 +0000 | |||
400 | @@ -0,0 +1,39 @@ | |||
401 | 1 | // define a layer variable | ||
402 | 2 | lay = 5; | ||
403 | 3 | |||
404 | 4 | // define a len variable | ||
405 | 5 | len = 300.0; | ||
406 | 6 | |||
407 | 7 | Point(1) = {0.0, 0.0, 0.0, 1.0}; | ||
408 | 8 | |||
409 | 9 | Extrude {len, 0.0, 0.0} { | ||
410 | 10 | Point{1}; Layers{lay}; | ||
411 | 11 | } | ||
412 | 12 | |||
413 | 13 | Extrude {0.0, len, 0.0} { | ||
414 | 14 | Line{1}; Layers{lay}; | ||
415 | 15 | } | ||
416 | 16 | |||
417 | 17 | Extrude {0.0, 0.0, len} { | ||
418 | 18 | Surface{5}; Layers{lay}; | ||
419 | 19 | } | ||
420 | 20 | |||
421 | 21 | // bottom | ||
422 | 22 | Physical Surface(1) = {5}; | ||
423 | 23 | |||
424 | 24 | // top | ||
425 | 25 | Physical Surface(2) = {27}; | ||
426 | 26 | |||
427 | 27 | // left | ||
428 | 28 | Physical Surface(3) = {26}; | ||
429 | 29 | |||
430 | 30 | // right | ||
431 | 31 | Physical Surface(4) = {18}; | ||
432 | 32 | |||
433 | 33 | // front | ||
434 | 34 | Physical Surface(5) = {14}; | ||
435 | 35 | |||
436 | 36 | // back | ||
437 | 37 | Physical Surface(6) = {22}; | ||
438 | 38 | |||
439 | 39 | Physical Volume(1) = {1}; | ||
440 | 0 | 40 | ||
441 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet.xml' | |||
442 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet.xml 1970-01-01 00:00:00 +0000 | |||
443 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet.xml 2011-12-23 12:05:25 +0000 | |||
444 | @@ -0,0 +1,118 @@ | |||
445 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
446 | 2 | <!DOCTYPE testproblem SYSTEM "regressiontest.dtd"> | ||
447 | 3 | |||
448 | 4 | <testproblem> | ||
449 | 5 | <name>darcy_p0p1_test_cty_cv_pressBCinlet</name> | ||
450 | 6 | <owner userid="btollit"/> | ||
451 | 7 | <tags>flml darcy</tags> | ||
452 | 8 | <problem_definition length="short" nprocs="1"> | ||
453 | 9 | <command_line> | ||
454 | 10 | ../../bin/fluidity darcy_p0p1_test_cty_cv_pressBCinlet_1d.flml | ||
455 | 11 | ../../bin/fluidity darcy_p0p1_test_cty_cv_pressBCinlet_2d.flml | ||
456 | 12 | ../../bin/fluidity darcy_p0p1_test_cty_cv_pressBCinlet_3d.flml | ||
457 | 13 | </command_line> | ||
458 | 14 | <!-- One/two/three dimensional problem for darcy flow with one region and one material using p0p1 element type testing the pressure gradient against analytic and the interstitial velocity. This tests using a diagnostic velocity absorption field associated with a mesh and momentum dg for darcy flows.--> | ||
459 | 15 | </problem_definition> | ||
460 | 16 | <variables> | ||
461 | 17 | <variable name="pressure_1d" language="python"> | ||
462 | 18 | import vtktools | ||
463 | 19 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_1d_1.vtu") | ||
464 | 20 | pressure_1d = v.GetScalarRange("Pressure") | ||
465 | 21 | </variable> | ||
466 | 22 | <variable name="inter_vel_1d" language="python"> | ||
467 | 23 | import vtktools | ||
468 | 24 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_1d_1.vtu") | ||
469 | 25 | inter_vel_1d = max(v.GetScalarRange("interstitial_velocity")) | ||
470 | 26 | </variable> | ||
471 | 27 | <variable name="max_div_vel_1d" language="python"> | ||
472 | 28 | import vtktools | ||
473 | 29 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_1d_1.vtu") | ||
474 | 30 | max_div_vel_1d = max(v.GetScalarRange("ControlVolumeDivergence")) | ||
475 | 31 | </variable> | ||
476 | 32 | <variable name="pressure_2d" language="python"> | ||
477 | 33 | import vtktools | ||
478 | 34 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_2d_1.vtu") | ||
479 | 35 | pressure_2d = v.GetScalarRange("Pressure") | ||
480 | 36 | </variable> | ||
481 | 37 | <variable name="inter_vel_2d" language="python"> | ||
482 | 38 | import vtktools | ||
483 | 39 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_2d_1.vtu") | ||
484 | 40 | inter_vel_2d = max(v.GetScalarRange("interstitial_velocity")) | ||
485 | 41 | </variable> | ||
486 | 42 | <variable name="max_div_vel_2d" language="python"> | ||
487 | 43 | import vtktools | ||
488 | 44 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_2d_1.vtu") | ||
489 | 45 | max_div_vel_2d = max(v.GetScalarRange("ControlVolumeDivergence")) | ||
490 | 46 | </variable> | ||
491 | 47 | <variable name="pressure_3d" language="python"> | ||
492 | 48 | import vtktools | ||
493 | 49 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_3d_1.vtu") | ||
494 | 50 | pressure_3d = v.GetScalarRange("Pressure") | ||
495 | 51 | </variable> | ||
496 | 52 | <variable name="inter_vel_3d" language="python"> | ||
497 | 53 | import vtktools | ||
498 | 54 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_3d_1.vtu") | ||
499 | 55 | inter_vel_3d = max(v.GetScalarRange("interstitial_velocity")) | ||
500 | 56 | </variable> | ||
501 | 57 | <variable name="max_div_vel_3d" language="python"> | ||
502 | 58 | import vtktools | ||
503 | 59 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_3d_1.vtu") | ||
504 | 60 | max_div_vel_3d = max(v.GetScalarRange("ControlVolumeDivergence")) | ||
505 | 61 | </variable> | ||
506 | 62 | </variables> | ||
507 | 63 | <pass_tests> | ||
508 | 64 | <test name="change_P for 1d should equal domain_length*visc*darcy_vel_BC/perm, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
509 | 65 | change_P = abs(max(pressure_1d) - min(pressure_1d)) | ||
510 | 66 | visc = 1.0e-04 | ||
511 | 67 | darcy_vel_BC = 5.0 | ||
512 | 68 | perm = 1.0e-10 | ||
513 | 69 | domain_length = 300.0 | ||
514 | 70 | print 'Relative error of pressure difference: ',abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) | ||
515 | 71 | assert abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) < 1.0e-09 | ||
516 | 72 | </test> | ||
517 | 73 | <test name="interstitial velocity 1d should equal darcy_vel/porosity), check relative difference to be under tolerance 1.0e-09" language="python"> | ||
518 | 74 | analytic_vel = 10.0 | ||
519 | 75 | print 'Relative error of interstitial velocity: ',abs((inter_vel_1d - analytic_vel)/analytic_vel) | ||
520 | 76 | assert abs((inter_vel_1d - analytic_vel)/analytic_vel) < 1.0e-09 | ||
521 | 77 | </test> | ||
522 | 78 | <test name="max_div_vel_1d under tolerance 1.0e-09" language="python"> | ||
523 | 79 | assert max_div_vel_1d < 1.0e-09 | ||
524 | 80 | </test> | ||
525 | 81 | <test name="change_P for 2d should equal domain_length*visc*darcy_vel_BC/perm, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
526 | 82 | change_P = abs(max(pressure_2d) - min(pressure_2d)) | ||
527 | 83 | visc = 1.0e-04 | ||
528 | 84 | darcy_vel_BC = 5.0 | ||
529 | 85 | perm = 1.0e-10 | ||
530 | 86 | domain_length = 300.0 | ||
531 | 87 | print 'Relative error of pressure difference: ',abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) | ||
532 | 88 | assert abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) < 1.0e-09 | ||
533 | 89 | </test> | ||
534 | 90 | <test name="interstitial velocity 2d should equal darcy_vel/porosity), check relative difference to be under tolerance 1.0e-09" language="python"> | ||
535 | 91 | analytic_vel = 10.0 | ||
536 | 92 | print 'Relative error of interstitial velocity: ',abs((inter_vel_2d - analytic_vel)/analytic_vel) | ||
537 | 93 | assert abs((inter_vel_2d - analytic_vel)/analytic_vel) < 1.0e-09 | ||
538 | 94 | </test> | ||
539 | 95 | <test name="max_div_vel_2d under tolerance 1.0e-09" language="python"> | ||
540 | 96 | assert max_div_vel_2d < 1.0e-09 | ||
541 | 97 | </test> | ||
542 | 98 | <test name="change_P for 3d should equal domain_length*visc*darcy_vel_BC/perm, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
543 | 99 | change_P = abs(max(pressure_3d) - min(pressure_3d)) | ||
544 | 100 | visc = 1.0e-04 | ||
545 | 101 | darcy_vel_BC = 5.0 | ||
546 | 102 | perm = 1.0e-10 | ||
547 | 103 | domain_length = 300.0 | ||
548 | 104 | print 'Relative error of pressure difference: ',abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) | ||
549 | 105 | assert abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) < 1.0e-09 | ||
550 | 106 | </test> | ||
551 | 107 | <test name="interstitial velocity 3d should equal darcy_vel/porosity), check relative difference to be under tolerance 1.0e-09" language="python"> | ||
552 | 108 | analytic_vel = 10.0 | ||
553 | 109 | print 'Relative error of interstitial velocity: ',abs((inter_vel_3d - analytic_vel)/analytic_vel) | ||
554 | 110 | assert abs((inter_vel_3d - analytic_vel)/analytic_vel) < 1.0e-09 | ||
555 | 111 | </test> | ||
556 | 112 | <test name="max_div_vel_3d under tolerance 1.0e-09" language="python"> | ||
557 | 113 | assert max_div_vel_3d < 1.0e-09 | ||
558 | 114 | </test> | ||
559 | 115 | </pass_tests> | ||
560 | 116 | <warn_tests> | ||
561 | 117 | </warn_tests> | ||
562 | 118 | </testproblem> | ||
563 | 0 | 119 | ||
564 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_1d.flml' | |||
565 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_1d.flml 1970-01-01 00:00:00 +0000 | |||
566 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_1d.flml 2011-12-23 12:05:25 +0000 | |||
567 | @@ -0,0 +1,411 @@ | |||
568 | 1 | <?xml version='1.0' encoding='utf-8'?> | ||
569 | 2 | <fluidity_options> | ||
570 | 3 | <simulation_name> | ||
571 | 4 | <string_value lines="1">darcy_p0p1_test_cty_cv_pressBCinlet_1d</string_value> | ||
572 | 5 | <comment>a simple short test case for darcy flow using the element type p0p1 for velocity-pressure | ||
573 | 6 | |||
574 | 7 | with the continuity equation tested with the control volume dual mesh | ||
575 | 8 | |||
576 | 9 | the darcy velocity is solved for and the interstitial velocity is a diagnostic from this (assuming a dg solution) | ||
577 | 10 | |||
578 | 11 | it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct | ||
579 | 12 | |||
580 | 13 | the darcy flow equation is | ||
581 | 14 | |||
582 | 15 | sigma*darcy_vel = - grad P | ||
583 | 16 | |||
584 | 17 | sigma is a function of viscosity and permeability which are two input fields that are named in the flml - not on fluidity special names (ie. this doesnt use the porous media object options) | ||
585 | 18 | |||
586 | 19 | python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity | ||
587 | 20 | |||
588 | 21 | this case has a 1 region 1 material with pressure boundary condition inflow. | ||
589 | 22 | |||
590 | 23 | to get a darcy equation the time, stress and advection terms are not included in a bousinessq formulation (to avoid needing to specify a density). Ideally it would be better to actually have a darcy momentum option to simplify the input. | ||
591 | 24 | |||
592 | 25 | the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation) | ||
593 | 26 | |||
594 | 27 | the geometry is 1d and one time step is done (as nothing depends on time) | ||
595 | 28 | |||
596 | 29 | the left and right boundary conditions of pressure are applied strongly. | ||
597 | 30 | |||
598 | 31 | For 2d and 3d a second approach is also done via solving a pressure poisson equation then calculating the | ||
599 | 32 | velocity diagnostically from this. This uses generic scalar and vector fields and python diagnostics. | ||
600 | 33 | The latter didnt work in 1d. The same vel-press element pair is used as the mixed projection formulation.</comment> | ||
601 | 34 | </simulation_name> | ||
602 | 35 | <problem_type> | ||
603 | 36 | <string_value lines="1">fluids</string_value> | ||
604 | 37 | </problem_type> | ||
605 | 38 | <geometry> | ||
606 | 39 | <dimension> | ||
607 | 40 | <integer_value rank="0">1</integer_value> | ||
608 | 41 | </dimension> | ||
609 | 42 | <mesh name="CoordinateMesh"> | ||
610 | 43 | <from_file file_name="darcy_p0p1_test_cty_cv_pressBCinlet_1d"> | ||
611 | 44 | <format name="triangle"/> | ||
612 | 45 | <stat> | ||
613 | 46 | <include_in_stat/> | ||
614 | 47 | </stat> | ||
615 | 48 | </from_file> | ||
616 | 49 | </mesh> | ||
617 | 50 | <mesh name="VelocityMesh"> | ||
618 | 51 | <from_mesh> | ||
619 | 52 | <mesh name="CoordinateMesh"/> | ||
620 | 53 | <mesh_shape> | ||
621 | 54 | <polynomial_degree> | ||
622 | 55 | <integer_value rank="0">0</integer_value> | ||
623 | 56 | </polynomial_degree> | ||
624 | 57 | </mesh_shape> | ||
625 | 58 | <mesh_continuity> | ||
626 | 59 | <string_value>discontinuous</string_value> | ||
627 | 60 | </mesh_continuity> | ||
628 | 61 | <stat> | ||
629 | 62 | <exclude_from_stat/> | ||
630 | 63 | </stat> | ||
631 | 64 | </from_mesh> | ||
632 | 65 | </mesh> | ||
633 | 66 | <mesh name="PressureMesh"> | ||
634 | 67 | <from_mesh> | ||
635 | 68 | <mesh name="CoordinateMesh"/> | ||
636 | 69 | <mesh_shape> | ||
637 | 70 | <polynomial_degree> | ||
638 | 71 | <integer_value rank="0">1</integer_value> | ||
639 | 72 | </polynomial_degree> | ||
640 | 73 | </mesh_shape> | ||
641 | 74 | <stat> | ||
642 | 75 | <exclude_from_stat/> | ||
643 | 76 | </stat> | ||
644 | 77 | </from_mesh> | ||
645 | 78 | </mesh> | ||
646 | 79 | <mesh name="DGP0"> | ||
647 | 80 | <from_mesh> | ||
648 | 81 | <mesh name="CoordinateMesh"/> | ||
649 | 82 | <mesh_shape> | ||
650 | 83 | <polynomial_degree> | ||
651 | 84 | <integer_value rank="0">0</integer_value> | ||
652 | 85 | </polynomial_degree> | ||
653 | 86 | </mesh_shape> | ||
654 | 87 | <mesh_continuity> | ||
655 | 88 | <string_value>discontinuous</string_value> | ||
656 | 89 | </mesh_continuity> | ||
657 | 90 | <stat> | ||
658 | 91 | <exclude_from_stat/> | ||
659 | 92 | </stat> | ||
660 | 93 | </from_mesh> | ||
661 | 94 | </mesh> | ||
662 | 95 | <mesh name="OutputMesh"> | ||
663 | 96 | <from_mesh> | ||
664 | 97 | <mesh name="CoordinateMesh"/> | ||
665 | 98 | <mesh_continuity> | ||
666 | 99 | <string_value>discontinuous</string_value> | ||
667 | 100 | </mesh_continuity> | ||
668 | 101 | <stat> | ||
669 | 102 | <exclude_from_stat/> | ||
670 | 103 | </stat> | ||
671 | 104 | </from_mesh> | ||
672 | 105 | </mesh> | ||
673 | 106 | <quadrature> | ||
674 | 107 | <degree> | ||
675 | 108 | <integer_value rank="0">3</integer_value> | ||
676 | 109 | </degree> | ||
677 | 110 | </quadrature> | ||
678 | 111 | </geometry> | ||
679 | 112 | <io> | ||
680 | 113 | <dump_format> | ||
681 | 114 | <string_value>vtk</string_value> | ||
682 | 115 | </dump_format> | ||
683 | 116 | <dump_period_in_timesteps> | ||
684 | 117 | <constant> | ||
685 | 118 | <integer_value rank="0">0</integer_value> | ||
686 | 119 | </constant> | ||
687 | 120 | </dump_period_in_timesteps> | ||
688 | 121 | <output_mesh name="OutputMesh"/> | ||
689 | 122 | <stat/> | ||
690 | 123 | </io> | ||
691 | 124 | <timestepping> | ||
692 | 125 | <current_time> | ||
693 | 126 | <real_value rank="0">0.0</real_value> | ||
694 | 127 | </current_time> | ||
695 | 128 | <timestep> | ||
696 | 129 | <real_value rank="0">1.0</real_value> | ||
697 | 130 | </timestep> | ||
698 | 131 | <finish_time> | ||
699 | 132 | <real_value rank="0">1.0</real_value> | ||
700 | 133 | </finish_time> | ||
701 | 134 | </timestepping> | ||
702 | 135 | <material_phase name="fluid"> | ||
703 | 136 | <scalar_field name="Pressure" rank="0"> | ||
704 | 137 | <prognostic> | ||
705 | 138 | <mesh name="PressureMesh"/> | ||
706 | 139 | <spatial_discretisation> | ||
707 | 140 | <continuous_galerkin> | ||
708 | 141 | <test_continuity_with_cv_dual/> | ||
709 | 142 | </continuous_galerkin> | ||
710 | 143 | </spatial_discretisation> | ||
711 | 144 | <scheme> | ||
712 | 145 | <poisson_pressure_solution> | ||
713 | 146 | <string_value lines="1">never</string_value> | ||
714 | 147 | </poisson_pressure_solution> | ||
715 | 148 | <use_projection_method/> | ||
716 | 149 | </scheme> | ||
717 | 150 | <solver> | ||
718 | 151 | <iterative_method name="cg"/> | ||
719 | 152 | <preconditioner name="sor"/> | ||
720 | 153 | <relative_error> | ||
721 | 154 | <real_value rank="0">1.0e-10</real_value> | ||
722 | 155 | </relative_error> | ||
723 | 156 | <max_iterations> | ||
724 | 157 | <integer_value rank="0">1000</integer_value> | ||
725 | 158 | </max_iterations> | ||
726 | 159 | <never_ignore_solver_failures/> | ||
727 | 160 | <diagnostics> | ||
728 | 161 | <monitors/> | ||
729 | 162 | </diagnostics> | ||
730 | 163 | </solver> | ||
731 | 164 | <boundary_conditions name="right_outflow"> | ||
732 | 165 | <surface_ids> | ||
733 | 166 | <integer_value shape="1" rank="1">2</integer_value> | ||
734 | 167 | </surface_ids> | ||
735 | 168 | <type name="dirichlet"> | ||
736 | 169 | <constant> | ||
737 | 170 | <real_value rank="0">0.0</real_value> | ||
738 | 171 | </constant> | ||
739 | 172 | </type> | ||
740 | 173 | </boundary_conditions> | ||
741 | 174 | <boundary_conditions name="left_inflow"> | ||
742 | 175 | <surface_ids> | ||
743 | 176 | <integer_value shape="1" rank="1">1</integer_value> | ||
744 | 177 | </surface_ids> | ||
745 | 178 | <type name="dirichlet"> | ||
746 | 179 | <constant> | ||
747 | 180 | <real_value rank="0">1.5e+09</real_value> | ||
748 | 181 | </constant> | ||
749 | 182 | </type> | ||
750 | 183 | </boundary_conditions> | ||
751 | 184 | <output/> | ||
752 | 185 | <stat/> | ||
753 | 186 | <convergence> | ||
754 | 187 | <include_in_convergence/> | ||
755 | 188 | </convergence> | ||
756 | 189 | <detectors> | ||
757 | 190 | <exclude_from_detectors/> | ||
758 | 191 | </detectors> | ||
759 | 192 | <steady_state> | ||
760 | 193 | <include_in_steady_state/> | ||
761 | 194 | </steady_state> | ||
762 | 195 | <no_interpolation/> | ||
763 | 196 | </prognostic> | ||
764 | 197 | </scalar_field> | ||
765 | 198 | <vector_field name="Velocity" rank="1"> | ||
766 | 199 | <prognostic> | ||
767 | 200 | <mesh name="VelocityMesh"/> | ||
768 | 201 | <equation name="Boussinesq"/> | ||
769 | 202 | <spatial_discretisation> | ||
770 | 203 | <discontinuous_galerkin> | ||
771 | 204 | <mass_terms> | ||
772 | 205 | <exclude_mass_terms/> | ||
773 | 206 | </mass_terms> | ||
774 | 207 | <viscosity_scheme> | ||
775 | 208 | <compact_discontinuous_galerkin/> | ||
776 | 209 | </viscosity_scheme> | ||
777 | 210 | <advection_scheme> | ||
778 | 211 | <none/> | ||
779 | 212 | <integrate_advection_by_parts> | ||
780 | 213 | <twice/> | ||
781 | 214 | </integrate_advection_by_parts> | ||
782 | 215 | </advection_scheme> | ||
783 | 216 | </discontinuous_galerkin> | ||
784 | 217 | <conservative_advection> | ||
785 | 218 | <real_value rank="0">0.0</real_value> | ||
786 | 219 | </conservative_advection> | ||
787 | 220 | </spatial_discretisation> | ||
788 | 221 | <temporal_discretisation> | ||
789 | 222 | <theta> | ||
790 | 223 | <real_value rank="0">1.0</real_value> | ||
791 | 224 | </theta> | ||
792 | 225 | <relaxation> | ||
793 | 226 | <real_value rank="0">1.0</real_value> | ||
794 | 227 | </relaxation> | ||
795 | 228 | </temporal_discretisation> | ||
796 | 229 | <solver> | ||
797 | 230 | <iterative_method name="gmres"> | ||
798 | 231 | <restart> | ||
799 | 232 | <integer_value rank="0">30</integer_value> | ||
800 | 233 | </restart> | ||
801 | 234 | </iterative_method> | ||
802 | 235 | <preconditioner name="sor"/> | ||
803 | 236 | <relative_error> | ||
804 | 237 | <real_value rank="0">1.0e-10</real_value> | ||
805 | 238 | </relative_error> | ||
806 | 239 | <max_iterations> | ||
807 | 240 | <integer_value rank="0">1000</integer_value> | ||
808 | 241 | </max_iterations> | ||
809 | 242 | <never_ignore_solver_failures/> | ||
810 | 243 | <diagnostics> | ||
811 | 244 | <monitors/> | ||
812 | 245 | </diagnostics> | ||
813 | 246 | </solver> | ||
814 | 247 | <initial_condition name="WholeMesh"> | ||
815 | 248 | <constant> | ||
816 | 249 | <real_value shape="1" dim1="dim" rank="1">0.0</real_value> | ||
817 | 250 | </constant> | ||
818 | 251 | </initial_condition> | ||
819 | 252 | <vector_field name="Absorption" rank="1"> | ||
820 | 253 | <diagnostic> | ||
821 | 254 | <mesh name="DGP0"/> | ||
822 | 255 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
823 | 256 | <string_value lines="20" type="python"># get the prescribed fields | ||
824 | 257 | perm = states["fluid"].scalar_fields["Permeability"] | ||
825 | 258 | visc = states["fluid"].scalar_fields["Viscosity"] | ||
826 | 259 | |||
827 | 260 | # loop the DMmesh_p0 nodes (which are element centred) | ||
828 | 261 | for n in range(field.node_count): | ||
829 | 262 | perm_n = perm.node_val(n) | ||
830 | 263 | visc_n = visc.node_val(n) | ||
831 | 264 | |||
832 | 265 | # calc the absorption term | ||
833 | 266 | sigma_n = visc_n/perm_n | ||
834 | 267 | |||
835 | 268 | # set the absorption term | ||
836 | 269 | field.set(n,sigma_n)</string_value> | ||
837 | 270 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
838 | 271 | |||
839 | 272 | also assume that the velocity is dg</comment> | ||
840 | 273 | </algorithm> | ||
841 | 274 | <output/> | ||
842 | 275 | <stat> | ||
843 | 276 | <include_in_stat/> | ||
844 | 277 | </stat> | ||
845 | 278 | <convergence> | ||
846 | 279 | <include_in_convergence/> | ||
847 | 280 | </convergence> | ||
848 | 281 | <detectors> | ||
849 | 282 | <include_in_detectors/> | ||
850 | 283 | </detectors> | ||
851 | 284 | <steady_state> | ||
852 | 285 | <include_in_steady_state/> | ||
853 | 286 | </steady_state> | ||
854 | 287 | </diagnostic> | ||
855 | 288 | <include_pressure_correction/> | ||
856 | 289 | </vector_field> | ||
857 | 290 | <output/> | ||
858 | 291 | <stat> | ||
859 | 292 | <include_in_stat/> | ||
860 | 293 | <previous_time_step> | ||
861 | 294 | <exclude_from_stat/> | ||
862 | 295 | </previous_time_step> | ||
863 | 296 | <nonlinear_field> | ||
864 | 297 | <exclude_from_stat/> | ||
865 | 298 | </nonlinear_field> | ||
866 | 299 | </stat> | ||
867 | 300 | <convergence> | ||
868 | 301 | <include_in_convergence/> | ||
869 | 302 | </convergence> | ||
870 | 303 | <detectors> | ||
871 | 304 | <include_in_detectors/> | ||
872 | 305 | </detectors> | ||
873 | 306 | <steady_state> | ||
874 | 307 | <include_in_steady_state/> | ||
875 | 308 | </steady_state> | ||
876 | 309 | <consistent_interpolation/> | ||
877 | 310 | </prognostic> | ||
878 | 311 | </vector_field> | ||
879 | 312 | <scalar_field name="Porosity" rank="0"> | ||
880 | 313 | <prescribed> | ||
881 | 314 | <mesh name="DGP0"/> | ||
882 | 315 | <value name="WholeMesh"> | ||
883 | 316 | <constant> | ||
884 | 317 | <real_value rank="0">0.5</real_value> | ||
885 | 318 | </constant> | ||
886 | 319 | </value> | ||
887 | 320 | <output/> | ||
888 | 321 | <stat/> | ||
889 | 322 | <detectors> | ||
890 | 323 | <exclude_from_detectors/> | ||
891 | 324 | </detectors> | ||
892 | 325 | </prescribed> | ||
893 | 326 | </scalar_field> | ||
894 | 327 | <scalar_field name="Permeability" rank="0"> | ||
895 | 328 | <prescribed> | ||
896 | 329 | <mesh name="DGP0"/> | ||
897 | 330 | <value name="WholeMesh"> | ||
898 | 331 | <constant> | ||
899 | 332 | <real_value rank="0">1.0e-10</real_value> | ||
900 | 333 | </constant> | ||
901 | 334 | </value> | ||
902 | 335 | <output/> | ||
903 | 336 | <stat/> | ||
904 | 337 | <detectors> | ||
905 | 338 | <exclude_from_detectors/> | ||
906 | 339 | </detectors> | ||
907 | 340 | </prescribed> | ||
908 | 341 | </scalar_field> | ||
909 | 342 | <scalar_field name="Viscosity" rank="0"> | ||
910 | 343 | <prescribed> | ||
911 | 344 | <mesh name="DGP0"/> | ||
912 | 345 | <value name="WholeMesh"> | ||
913 | 346 | <constant> | ||
914 | 347 | <real_value rank="0">1.0e-04</real_value> | ||
915 | 348 | </constant> | ||
916 | 349 | </value> | ||
917 | 350 | <output/> | ||
918 | 351 | <stat/> | ||
919 | 352 | <detectors> | ||
920 | 353 | <exclude_from_detectors/> | ||
921 | 354 | </detectors> | ||
922 | 355 | </prescribed> | ||
923 | 356 | </scalar_field> | ||
924 | 357 | <scalar_field name="ControlVolumeDivergence" rank="0"> | ||
925 | 358 | <diagnostic field_name="Velocity"> | ||
926 | 359 | <algorithm name="Internal" material_phase_support="multiple"/> | ||
927 | 360 | <mesh name="PressureMesh"/> | ||
928 | 361 | <output/> | ||
929 | 362 | <stat/> | ||
930 | 363 | <convergence> | ||
931 | 364 | <include_in_convergence/> | ||
932 | 365 | </convergence> | ||
933 | 366 | <detectors> | ||
934 | 367 | <include_in_detectors/> | ||
935 | 368 | </detectors> | ||
936 | 369 | <steady_state> | ||
937 | 370 | <include_in_steady_state/> | ||
938 | 371 | </steady_state> | ||
939 | 372 | </diagnostic> | ||
940 | 373 | </scalar_field> | ||
941 | 374 | <vector_field name="interstitial_velocity" rank="1"> | ||
942 | 375 | <diagnostic> | ||
943 | 376 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
944 | 377 | <string_value lines="20" type="python">phi = states["fluid"].scalar_fields["Porosity"] | ||
945 | 378 | darcy_vel = states["fluid"].vector_fields["Velocity"] | ||
946 | 379 | |||
947 | 380 | for ele in range(field.element_count): | ||
948 | 381 | phi_ele = phi.node_val(ele) | ||
949 | 382 | |||
950 | 383 | factor_ele = 1.0/max(phi_ele,1.0e-08) | ||
951 | 384 | |||
952 | 385 | vel_ele = [] | ||
953 | 386 | for i in range(len(darcy_vel.ele_val(ele))): | ||
954 | 387 | vel_ele.append(factor_ele*darcy_vel.ele_val(ele)[i]) | ||
955 | 388 | |||
956 | 389 | field.set(darcy_vel.ele_nodes(ele),vel_ele)</string_value> | ||
957 | 390 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
958 | 391 | |||
959 | 392 | also assume that the velocity is dg</comment> | ||
960 | 393 | </algorithm> | ||
961 | 394 | <mesh name="VelocityMesh"/> | ||
962 | 395 | <output/> | ||
963 | 396 | <stat> | ||
964 | 397 | <include_in_stat/> | ||
965 | 398 | </stat> | ||
966 | 399 | <convergence> | ||
967 | 400 | <include_in_convergence/> | ||
968 | 401 | </convergence> | ||
969 | 402 | <detectors> | ||
970 | 403 | <include_in_detectors/> | ||
971 | 404 | </detectors> | ||
972 | 405 | <steady_state> | ||
973 | 406 | <include_in_steady_state/> | ||
974 | 407 | </steady_state> | ||
975 | 408 | </diagnostic> | ||
976 | 409 | </vector_field> | ||
977 | 410 | </material_phase> | ||
978 | 411 | </fluidity_options> | ||
979 | 0 | 412 | ||
980 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_2d.flml' | |||
981 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_2d.flml 1970-01-01 00:00:00 +0000 | |||
982 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_2d.flml 2011-12-23 12:05:25 +0000 | |||
983 | @@ -0,0 +1,427 @@ | |||
984 | 1 | <?xml version='1.0' encoding='utf-8'?> | ||
985 | 2 | <fluidity_options> | ||
986 | 3 | <simulation_name> | ||
987 | 4 | <string_value lines="1">darcy_p0p1_test_cty_cv_pressBCinlet_2d</string_value> | ||
988 | 5 | <comment>a simple short test case for darcy flow using the element type p0p1 for velocity-pressure | ||
989 | 6 | |||
990 | 7 | with the continuity equation tested with the control volume dual mesh | ||
991 | 8 | |||
992 | 9 | the darcy velocity is solved for and the interstitial velocity is a diagnostic from this (assuming a dg solution) | ||
993 | 10 | |||
994 | 11 | it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct | ||
995 | 12 | |||
996 | 13 | the darcy flow equation is | ||
997 | 14 | |||
998 | 15 | sigma*darcy_vel = - grad P | ||
999 | 16 | |||
1000 | 17 | sigma is a function of viscosity and permeability which are two input fields that are named in the flml - not on fluidity special names (ie. this doesnt use the porous media object options) | ||
1001 | 18 | |||
1002 | 19 | python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity | ||
1003 | 20 | |||
1004 | 21 | this case has a 1 region 1 material with pressure boundary condition inflow. | ||
1005 | 22 | |||
1006 | 23 | to get a darcy equation the time, stress and advection terms are not included in a bousinessq formulation (to avoid needing to specify a density). Ideally it would be better to actually have a darcy momentum option to simplify the input. | ||
1007 | 24 | |||
1008 | 25 | the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation) | ||
1009 | 26 | |||
1010 | 27 | the geometry is 2d (although this is a 1d problem) and one time step is done (as nothing depends on time) | ||
1011 | 28 | |||
1012 | 29 | the left and right boundary conditions of pressure are applied strongly. | ||
1013 | 30 | |||
1014 | 31 | For 2d and 3d a second approach is also done via solving a pressure poisson equation then calculating the | ||
1015 | 32 | velocity diagnostically from this. This uses generic scalar and vector fields and python diagnostics. | ||
1016 | 33 | The latter didnt work in 1d. The same vel-press element pair is used as the mixed projection formulation.</comment> | ||
1017 | 34 | </simulation_name> | ||
1018 | 35 | <problem_type> | ||
1019 | 36 | <string_value lines="1">fluids</string_value> | ||
1020 | 37 | </problem_type> | ||
1021 | 38 | <geometry> | ||
1022 | 39 | <dimension> | ||
1023 | 40 | <integer_value rank="0">2</integer_value> | ||
1024 | 41 | </dimension> | ||
1025 | 42 | <mesh name="CoordinateMesh"> | ||
1026 | 43 | <from_file file_name="square"> | ||
1027 | 44 | <format name="gmsh"/> | ||
1028 | 45 | <stat> | ||
1029 | 46 | <include_in_stat/> | ||
1030 | 47 | </stat> | ||
1031 | 48 | </from_file> | ||
1032 | 49 | </mesh> | ||
1033 | 50 | <mesh name="VelocityMesh"> | ||
1034 | 51 | <from_mesh> | ||
1035 | 52 | <mesh name="CoordinateMesh"/> | ||
1036 | 53 | <mesh_shape> | ||
1037 | 54 | <polynomial_degree> | ||
1038 | 55 | <integer_value rank="0">0</integer_value> | ||
1039 | 56 | </polynomial_degree> | ||
1040 | 57 | </mesh_shape> | ||
1041 | 58 | <mesh_continuity> | ||
1042 | 59 | <string_value>discontinuous</string_value> | ||
1043 | 60 | </mesh_continuity> | ||
1044 | 61 | <stat> | ||
1045 | 62 | <exclude_from_stat/> | ||
1046 | 63 | </stat> | ||
1047 | 64 | </from_mesh> | ||
1048 | 65 | </mesh> | ||
1049 | 66 | <mesh name="PressureMesh"> | ||
1050 | 67 | <from_mesh> | ||
1051 | 68 | <mesh name="CoordinateMesh"/> | ||
1052 | 69 | <mesh_shape> | ||
1053 | 70 | <polynomial_degree> | ||
1054 | 71 | <integer_value rank="0">1</integer_value> | ||
1055 | 72 | </polynomial_degree> | ||
1056 | 73 | </mesh_shape> | ||
1057 | 74 | <stat> | ||
1058 | 75 | <exclude_from_stat/> | ||
1059 | 76 | </stat> | ||
1060 | 77 | </from_mesh> | ||
1061 | 78 | </mesh> | ||
1062 | 79 | <mesh name="DGP0"> | ||
1063 | 80 | <from_mesh> | ||
1064 | 81 | <mesh name="CoordinateMesh"/> | ||
1065 | 82 | <mesh_shape> | ||
1066 | 83 | <polynomial_degree> | ||
1067 | 84 | <integer_value rank="0">0</integer_value> | ||
1068 | 85 | </polynomial_degree> | ||
1069 | 86 | </mesh_shape> | ||
1070 | 87 | <mesh_continuity> | ||
1071 | 88 | <string_value>discontinuous</string_value> | ||
1072 | 89 | </mesh_continuity> | ||
1073 | 90 | <stat> | ||
1074 | 91 | <exclude_from_stat/> | ||
1075 | 92 | </stat> | ||
1076 | 93 | </from_mesh> | ||
1077 | 94 | </mesh> | ||
1078 | 95 | <mesh name="OutputMesh"> | ||
1079 | 96 | <from_mesh> | ||
1080 | 97 | <mesh name="CoordinateMesh"/> | ||
1081 | 98 | <mesh_continuity> | ||
1082 | 99 | <string_value>discontinuous</string_value> | ||
1083 | 100 | </mesh_continuity> | ||
1084 | 101 | <stat> | ||
1085 | 102 | <exclude_from_stat/> | ||
1086 | 103 | </stat> | ||
1087 | 104 | </from_mesh> | ||
1088 | 105 | </mesh> | ||
1089 | 106 | <quadrature> | ||
1090 | 107 | <degree> | ||
1091 | 108 | <integer_value rank="0">3</integer_value> | ||
1092 | 109 | </degree> | ||
1093 | 110 | </quadrature> | ||
1094 | 111 | </geometry> | ||
1095 | 112 | <io> | ||
1096 | 113 | <dump_format> | ||
1097 | 114 | <string_value>vtk</string_value> | ||
1098 | 115 | </dump_format> | ||
1099 | 116 | <dump_period_in_timesteps> | ||
1100 | 117 | <constant> | ||
1101 | 118 | <integer_value rank="0">0</integer_value> | ||
1102 | 119 | </constant> | ||
1103 | 120 | </dump_period_in_timesteps> | ||
1104 | 121 | <output_mesh name="OutputMesh"/> | ||
1105 | 122 | <stat/> | ||
1106 | 123 | </io> | ||
1107 | 124 | <timestepping> | ||
1108 | 125 | <current_time> | ||
1109 | 126 | <real_value rank="0">0.0</real_value> | ||
1110 | 127 | </current_time> | ||
1111 | 128 | <timestep> | ||
1112 | 129 | <real_value rank="0">1.0</real_value> | ||
1113 | 130 | </timestep> | ||
1114 | 131 | <finish_time> | ||
1115 | 132 | <real_value rank="0">1.0</real_value> | ||
1116 | 133 | </finish_time> | ||
1117 | 134 | </timestepping> | ||
1118 | 135 | <material_phase name="fluid"> | ||
1119 | 136 | <scalar_field name="Pressure" rank="0"> | ||
1120 | 137 | <prognostic> | ||
1121 | 138 | <mesh name="PressureMesh"/> | ||
1122 | 139 | <spatial_discretisation> | ||
1123 | 140 | <continuous_galerkin> | ||
1124 | 141 | <test_continuity_with_cv_dual/> | ||
1125 | 142 | </continuous_galerkin> | ||
1126 | 143 | </spatial_discretisation> | ||
1127 | 144 | <scheme> | ||
1128 | 145 | <poisson_pressure_solution> | ||
1129 | 146 | <string_value lines="1">never</string_value> | ||
1130 | 147 | </poisson_pressure_solution> | ||
1131 | 148 | <use_projection_method/> | ||
1132 | 149 | </scheme> | ||
1133 | 150 | <solver> | ||
1134 | 151 | <iterative_method name="cg"/> | ||
1135 | 152 | <preconditioner name="sor"/> | ||
1136 | 153 | <relative_error> | ||
1137 | 154 | <real_value rank="0">1.0e-10</real_value> | ||
1138 | 155 | </relative_error> | ||
1139 | 156 | <max_iterations> | ||
1140 | 157 | <integer_value rank="0">1000</integer_value> | ||
1141 | 158 | </max_iterations> | ||
1142 | 159 | <never_ignore_solver_failures/> | ||
1143 | 160 | <diagnostics> | ||
1144 | 161 | <monitors/> | ||
1145 | 162 | </diagnostics> | ||
1146 | 163 | </solver> | ||
1147 | 164 | <boundary_conditions name="right_outflow"> | ||
1148 | 165 | <surface_ids> | ||
1149 | 166 | <integer_value shape="1" rank="1">8</integer_value> | ||
1150 | 167 | </surface_ids> | ||
1151 | 168 | <type name="dirichlet"> | ||
1152 | 169 | <constant> | ||
1153 | 170 | <real_value rank="0">0.0</real_value> | ||
1154 | 171 | </constant> | ||
1155 | 172 | </type> | ||
1156 | 173 | </boundary_conditions> | ||
1157 | 174 | <boundary_conditions name="left_inflow"> | ||
1158 | 175 | <surface_ids> | ||
1159 | 176 | <integer_value shape="1" rank="1">10</integer_value> | ||
1160 | 177 | </surface_ids> | ||
1161 | 178 | <type name="dirichlet"> | ||
1162 | 179 | <apply_weakly/> | ||
1163 | 180 | <constant> | ||
1164 | 181 | <real_value rank="0">1.5e+09</real_value> | ||
1165 | 182 | </constant> | ||
1166 | 183 | </type> | ||
1167 | 184 | </boundary_conditions> | ||
1168 | 185 | <output/> | ||
1169 | 186 | <stat/> | ||
1170 | 187 | <convergence> | ||
1171 | 188 | <include_in_convergence/> | ||
1172 | 189 | </convergence> | ||
1173 | 190 | <detectors> | ||
1174 | 191 | <exclude_from_detectors/> | ||
1175 | 192 | </detectors> | ||
1176 | 193 | <steady_state> | ||
1177 | 194 | <include_in_steady_state/> | ||
1178 | 195 | </steady_state> | ||
1179 | 196 | <no_interpolation/> | ||
1180 | 197 | </prognostic> | ||
1181 | 198 | </scalar_field> | ||
1182 | 199 | <vector_field name="Velocity" rank="1"> | ||
1183 | 200 | <prognostic> | ||
1184 | 201 | <mesh name="VelocityMesh"/> | ||
1185 | 202 | <equation name="Boussinesq"/> | ||
1186 | 203 | <spatial_discretisation> | ||
1187 | 204 | <discontinuous_galerkin> | ||
1188 | 205 | <mass_terms> | ||
1189 | 206 | <exclude_mass_terms/> | ||
1190 | 207 | </mass_terms> | ||
1191 | 208 | <viscosity_scheme> | ||
1192 | 209 | <compact_discontinuous_galerkin/> | ||
1193 | 210 | </viscosity_scheme> | ||
1194 | 211 | <advection_scheme> | ||
1195 | 212 | <none/> | ||
1196 | 213 | <integrate_advection_by_parts> | ||
1197 | 214 | <twice/> | ||
1198 | 215 | </integrate_advection_by_parts> | ||
1199 | 216 | </advection_scheme> | ||
1200 | 217 | </discontinuous_galerkin> | ||
1201 | 218 | <conservative_advection> | ||
1202 | 219 | <real_value rank="0">0.0</real_value> | ||
1203 | 220 | </conservative_advection> | ||
1204 | 221 | </spatial_discretisation> | ||
1205 | 222 | <temporal_discretisation> | ||
1206 | 223 | <theta> | ||
1207 | 224 | <real_value rank="0">1.0</real_value> | ||
1208 | 225 | </theta> | ||
1209 | 226 | <relaxation> | ||
1210 | 227 | <real_value rank="0">1.0</real_value> | ||
1211 | 228 | </relaxation> | ||
1212 | 229 | </temporal_discretisation> | ||
1213 | 230 | <solver> | ||
1214 | 231 | <iterative_method name="gmres"> | ||
1215 | 232 | <restart> | ||
1216 | 233 | <integer_value rank="0">30</integer_value> | ||
1217 | 234 | </restart> | ||
1218 | 235 | </iterative_method> | ||
1219 | 236 | <preconditioner name="sor"/> | ||
1220 | 237 | <relative_error> | ||
1221 | 238 | <real_value rank="0">1.0e-10</real_value> | ||
1222 | 239 | </relative_error> | ||
1223 | 240 | <max_iterations> | ||
1224 | 241 | <integer_value rank="0">1000</integer_value> | ||
1225 | 242 | </max_iterations> | ||
1226 | 243 | <never_ignore_solver_failures/> | ||
1227 | 244 | <diagnostics> | ||
1228 | 245 | <monitors/> | ||
1229 | 246 | </diagnostics> | ||
1230 | 247 | </solver> | ||
1231 | 248 | <initial_condition name="WholeMesh"> | ||
1232 | 249 | <constant> | ||
1233 | 250 | <real_value shape="2" dim1="dim" rank="1">0.0 0.0</real_value> | ||
1234 | 251 | </constant> | ||
1235 | 252 | </initial_condition> | ||
1236 | 253 | <boundary_conditions name="no_outflow_top_bottom"> | ||
1237 | 254 | <surface_ids> | ||
1238 | 255 | <integer_value shape="2" rank="1">7 9</integer_value> | ||
1239 | 256 | </surface_ids> | ||
1240 | 257 | <type name="dirichlet"> | ||
1241 | 258 | <apply_weakly/> | ||
1242 | 259 | <align_bc_with_cartesian> | ||
1243 | 260 | <y_component> | ||
1244 | 261 | <constant> | ||
1245 | 262 | <real_value rank="0">0.0</real_value> | ||
1246 | 263 | </constant> | ||
1247 | 264 | </y_component> | ||
1248 | 265 | </align_bc_with_cartesian> | ||
1249 | 266 | </type> | ||
1250 | 267 | </boundary_conditions> | ||
1251 | 268 | <vector_field name="Absorption" rank="1"> | ||
1252 | 269 | <diagnostic> | ||
1253 | 270 | <mesh name="DGP0"/> | ||
1254 | 271 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
1255 | 272 | <string_value lines="20" type="python"># get the prescribed fields | ||
1256 | 273 | perm = states["fluid"].scalar_fields["Permeability"] | ||
1257 | 274 | visc = states["fluid"].scalar_fields["Viscosity"] | ||
1258 | 275 | |||
1259 | 276 | # loop the DMmesh_p0 nodes (which are element centred) | ||
1260 | 277 | for n in range(field.node_count): | ||
1261 | 278 | perm_n = perm.node_val(n) | ||
1262 | 279 | visc_n = visc.node_val(n) | ||
1263 | 280 | |||
1264 | 281 | # calc the absorption term | ||
1265 | 282 | sigma_n = visc_n/perm_n | ||
1266 | 283 | |||
1267 | 284 | # set the absorption term | ||
1268 | 285 | field.set(n,sigma_n)</string_value> | ||
1269 | 286 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
1270 | 287 | |||
1271 | 288 | also assume that the velocity is dg</comment> | ||
1272 | 289 | </algorithm> | ||
1273 | 290 | <output/> | ||
1274 | 291 | <stat> | ||
1275 | 292 | <include_in_stat/> | ||
1276 | 293 | </stat> | ||
1277 | 294 | <convergence> | ||
1278 | 295 | <include_in_convergence/> | ||
1279 | 296 | </convergence> | ||
1280 | 297 | <detectors> | ||
1281 | 298 | <include_in_detectors/> | ||
1282 | 299 | </detectors> | ||
1283 | 300 | <steady_state> | ||
1284 | 301 | <include_in_steady_state/> | ||
1285 | 302 | </steady_state> | ||
1286 | 303 | </diagnostic> | ||
1287 | 304 | <include_pressure_correction/> | ||
1288 | 305 | </vector_field> | ||
1289 | 306 | <output/> | ||
1290 | 307 | <stat> | ||
1291 | 308 | <include_in_stat/> | ||
1292 | 309 | <previous_time_step> | ||
1293 | 310 | <exclude_from_stat/> | ||
1294 | 311 | </previous_time_step> | ||
1295 | 312 | <nonlinear_field> | ||
1296 | 313 | <exclude_from_stat/> | ||
1297 | 314 | </nonlinear_field> | ||
1298 | 315 | </stat> | ||
1299 | 316 | <convergence> | ||
1300 | 317 | <include_in_convergence/> | ||
1301 | 318 | </convergence> | ||
1302 | 319 | <detectors> | ||
1303 | 320 | <include_in_detectors/> | ||
1304 | 321 | </detectors> | ||
1305 | 322 | <steady_state> | ||
1306 | 323 | <include_in_steady_state/> | ||
1307 | 324 | </steady_state> | ||
1308 | 325 | <consistent_interpolation/> | ||
1309 | 326 | </prognostic> | ||
1310 | 327 | </vector_field> | ||
1311 | 328 | <scalar_field name="Porosity" rank="0"> | ||
1312 | 329 | <prescribed> | ||
1313 | 330 | <mesh name="DGP0"/> | ||
1314 | 331 | <value name="WholeMesh"> | ||
1315 | 332 | <constant> | ||
1316 | 333 | <real_value rank="0">0.5</real_value> | ||
1317 | 334 | </constant> | ||
1318 | 335 | </value> | ||
1319 | 336 | <output/> | ||
1320 | 337 | <stat/> | ||
1321 | 338 | <detectors> | ||
1322 | 339 | <exclude_from_detectors/> | ||
1323 | 340 | </detectors> | ||
1324 | 341 | </prescribed> | ||
1325 | 342 | </scalar_field> | ||
1326 | 343 | <scalar_field name="Permeability" rank="0"> | ||
1327 | 344 | <prescribed> | ||
1328 | 345 | <mesh name="DGP0"/> | ||
1329 | 346 | <value name="WholeMesh"> | ||
1330 | 347 | <constant> | ||
1331 | 348 | <real_value rank="0">1.0e-10</real_value> | ||
1332 | 349 | </constant> | ||
1333 | 350 | </value> | ||
1334 | 351 | <output/> | ||
1335 | 352 | <stat/> | ||
1336 | 353 | <detectors> | ||
1337 | 354 | <exclude_from_detectors/> | ||
1338 | 355 | </detectors> | ||
1339 | 356 | </prescribed> | ||
1340 | 357 | </scalar_field> | ||
1341 | 358 | <scalar_field name="Viscosity" rank="0"> | ||
1342 | 359 | <prescribed> | ||
1343 | 360 | <mesh name="DGP0"/> | ||
1344 | 361 | <value name="WholeMesh"> | ||
1345 | 362 | <constant> | ||
1346 | 363 | <real_value rank="0">1.0e-04</real_value> | ||
1347 | 364 | </constant> | ||
1348 | 365 | </value> | ||
1349 | 366 | <output/> | ||
1350 | 367 | <stat/> | ||
1351 | 368 | <detectors> | ||
1352 | 369 | <exclude_from_detectors/> | ||
1353 | 370 | </detectors> | ||
1354 | 371 | </prescribed> | ||
1355 | 372 | </scalar_field> | ||
1356 | 373 | <scalar_field name="ControlVolumeDivergence" rank="0"> | ||
1357 | 374 | <diagnostic field_name="Velocity"> | ||
1358 | 375 | <algorithm name="Internal" material_phase_support="multiple"/> | ||
1359 | 376 | <mesh name="PressureMesh"/> | ||
1360 | 377 | <output/> | ||
1361 | 378 | <stat/> | ||
1362 | 379 | <convergence> | ||
1363 | 380 | <include_in_convergence/> | ||
1364 | 381 | </convergence> | ||
1365 | 382 | <detectors> | ||
1366 | 383 | <include_in_detectors/> | ||
1367 | 384 | </detectors> | ||
1368 | 385 | <steady_state> | ||
1369 | 386 | <include_in_steady_state/> | ||
1370 | 387 | </steady_state> | ||
1371 | 388 | </diagnostic> | ||
1372 | 389 | </scalar_field> | ||
1373 | 390 | <vector_field name="interstitial_velocity" rank="1"> | ||
1374 | 391 | <diagnostic> | ||
1375 | 392 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
1376 | 393 | <string_value lines="20" type="python">phi = states["fluid"].scalar_fields["Porosity"] | ||
1377 | 394 | darcy_vel = states["fluid"].vector_fields["Velocity"] | ||
1378 | 395 | |||
1379 | 396 | for ele in range(field.element_count): | ||
1380 | 397 | phi_ele = phi.node_val(ele) | ||
1381 | 398 | |||
1382 | 399 | factor_ele = 1.0/max(phi_ele,1.0e-08) | ||
1383 | 400 | |||
1384 | 401 | vel_ele = [] | ||
1385 | 402 | for i in range(len(darcy_vel.ele_val(ele))): | ||
1386 | 403 | vel_ele.append(factor_ele*darcy_vel.ele_val(ele)[i]) | ||
1387 | 404 | |||
1388 | 405 | field.set(darcy_vel.ele_nodes(ele),vel_ele)</string_value> | ||
1389 | 406 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
1390 | 407 | |||
1391 | 408 | also assume that the velocity is dg</comment> | ||
1392 | 409 | </algorithm> | ||
1393 | 410 | <mesh name="VelocityMesh"/> | ||
1394 | 411 | <output/> | ||
1395 | 412 | <stat> | ||
1396 | 413 | <include_in_stat/> | ||
1397 | 414 | </stat> | ||
1398 | 415 | <convergence> | ||
1399 | 416 | <include_in_convergence/> | ||
1400 | 417 | </convergence> | ||
1401 | 418 | <detectors> | ||
1402 | 419 | <include_in_detectors/> | ||
1403 | 420 | </detectors> | ||
1404 | 421 | <steady_state> | ||
1405 | 422 | <include_in_steady_state/> | ||
1406 | 423 | </steady_state> | ||
1407 | 424 | </diagnostic> | ||
1408 | 425 | </vector_field> | ||
1409 | 426 | </material_phase> | ||
1410 | 427 | </fluidity_options> | ||
1411 | 0 | 428 | ||
1412 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_3d.flml' | |||
1413 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_3d.flml 1970-01-01 00:00:00 +0000 | |||
1414 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet/darcy_p0p1_test_cty_cv_pressBCinlet_3d.flml 2011-12-23 12:05:25 +0000 | |||
1415 | @@ -0,0 +1,442 @@ | |||
1416 | 1 | <?xml version='1.0' encoding='utf-8'?> | ||
1417 | 2 | <fluidity_options> | ||
1418 | 3 | <simulation_name> | ||
1419 | 4 | <string_value lines="1">darcy_p0p1_test_cty_cv_pressBCinlet_3d</string_value> | ||
1420 | 5 | <comment>a simple short test case for darcy flow using the element type p0p1 for velocity-pressure | ||
1421 | 6 | |||
1422 | 7 | with the continuity equation tested with the control volume dual mesh | ||
1423 | 8 | |||
1424 | 9 | the darcy velocity is solved for and the interstitial velocity is a diagnostic from this (assuming a dg solution) | ||
1425 | 10 | |||
1426 | 11 | it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct | ||
1427 | 12 | |||
1428 | 13 | the darcy flow equation is | ||
1429 | 14 | |||
1430 | 15 | sigma*darcy_vel = - grad P | ||
1431 | 16 | |||
1432 | 17 | sigma is a function of viscosity and permeability which are two input fields that are named in the flml - not on fluidity special names (ie. this doesnt use the porous media object options) | ||
1433 | 18 | |||
1434 | 19 | python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity | ||
1435 | 20 | |||
1436 | 21 | this case has a 1 region 1 material with pressure boundary condition inflow. | ||
1437 | 22 | |||
1438 | 23 | to get a darcy equation the time, stress and advection terms are not included in a bousinessq formulation (to avoid needing to specify a density). Ideally it would be better to actually have a darcy momentum option to simplify the input. | ||
1439 | 24 | |||
1440 | 25 | the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation) | ||
1441 | 26 | |||
1442 | 27 | the geometry is 3d (although this is a 1d problem) and one time step is done (as nothing depends on time) | ||
1443 | 28 | |||
1444 | 29 | the left and right boundary conditions of pressure are applied strongly. | ||
1445 | 30 | |||
1446 | 31 | For 2d and 3d a second approach is also done via solving a pressure poisson equation then calculating the | ||
1447 | 32 | velocity diagnostically from this. This uses generic scalar and vector fields and python diagnostics. | ||
1448 | 33 | The latter didnt work in 1d. The same vel-press element pair is used as the mixed projection formulation.</comment> | ||
1449 | 34 | </simulation_name> | ||
1450 | 35 | <problem_type> | ||
1451 | 36 | <string_value lines="1">fluids</string_value> | ||
1452 | 37 | </problem_type> | ||
1453 | 38 | <geometry> | ||
1454 | 39 | <dimension> | ||
1455 | 40 | <integer_value rank="0">3</integer_value> | ||
1456 | 41 | </dimension> | ||
1457 | 42 | <mesh name="CoordinateMesh"> | ||
1458 | 43 | <from_file file_name="cube"> | ||
1459 | 44 | <format name="gmsh"/> | ||
1460 | 45 | <stat> | ||
1461 | 46 | <include_in_stat/> | ||
1462 | 47 | </stat> | ||
1463 | 48 | </from_file> | ||
1464 | 49 | </mesh> | ||
1465 | 50 | <mesh name="VelocityMesh"> | ||
1466 | 51 | <from_mesh> | ||
1467 | 52 | <mesh name="CoordinateMesh"/> | ||
1468 | 53 | <mesh_shape> | ||
1469 | 54 | <polynomial_degree> | ||
1470 | 55 | <integer_value rank="0">0</integer_value> | ||
1471 | 56 | </polynomial_degree> | ||
1472 | 57 | </mesh_shape> | ||
1473 | 58 | <mesh_continuity> | ||
1474 | 59 | <string_value>discontinuous</string_value> | ||
1475 | 60 | </mesh_continuity> | ||
1476 | 61 | <stat> | ||
1477 | 62 | <exclude_from_stat/> | ||
1478 | 63 | </stat> | ||
1479 | 64 | </from_mesh> | ||
1480 | 65 | </mesh> | ||
1481 | 66 | <mesh name="PressureMesh"> | ||
1482 | 67 | <from_mesh> | ||
1483 | 68 | <mesh name="CoordinateMesh"/> | ||
1484 | 69 | <mesh_shape> | ||
1485 | 70 | <polynomial_degree> | ||
1486 | 71 | <integer_value rank="0">1</integer_value> | ||
1487 | 72 | </polynomial_degree> | ||
1488 | 73 | </mesh_shape> | ||
1489 | 74 | <stat> | ||
1490 | 75 | <exclude_from_stat/> | ||
1491 | 76 | </stat> | ||
1492 | 77 | </from_mesh> | ||
1493 | 78 | </mesh> | ||
1494 | 79 | <mesh name="DGP0"> | ||
1495 | 80 | <from_mesh> | ||
1496 | 81 | <mesh name="CoordinateMesh"/> | ||
1497 | 82 | <mesh_shape> | ||
1498 | 83 | <polynomial_degree> | ||
1499 | 84 | <integer_value rank="0">0</integer_value> | ||
1500 | 85 | </polynomial_degree> | ||
1501 | 86 | </mesh_shape> | ||
1502 | 87 | <mesh_continuity> | ||
1503 | 88 | <string_value>discontinuous</string_value> | ||
1504 | 89 | </mesh_continuity> | ||
1505 | 90 | <stat> | ||
1506 | 91 | <exclude_from_stat/> | ||
1507 | 92 | </stat> | ||
1508 | 93 | </from_mesh> | ||
1509 | 94 | </mesh> | ||
1510 | 95 | <mesh name="OutputMesh"> | ||
1511 | 96 | <from_mesh> | ||
1512 | 97 | <mesh name="CoordinateMesh"/> | ||
1513 | 98 | <mesh_continuity> | ||
1514 | 99 | <string_value>discontinuous</string_value> | ||
1515 | 100 | </mesh_continuity> | ||
1516 | 101 | <stat> | ||
1517 | 102 | <exclude_from_stat/> | ||
1518 | 103 | </stat> | ||
1519 | 104 | </from_mesh> | ||
1520 | 105 | </mesh> | ||
1521 | 106 | <quadrature> | ||
1522 | 107 | <degree> | ||
1523 | 108 | <integer_value rank="0">3</integer_value> | ||
1524 | 109 | </degree> | ||
1525 | 110 | </quadrature> | ||
1526 | 111 | </geometry> | ||
1527 | 112 | <io> | ||
1528 | 113 | <dump_format> | ||
1529 | 114 | <string_value>vtk</string_value> | ||
1530 | 115 | </dump_format> | ||
1531 | 116 | <dump_period_in_timesteps> | ||
1532 | 117 | <constant> | ||
1533 | 118 | <integer_value rank="0">0</integer_value> | ||
1534 | 119 | </constant> | ||
1535 | 120 | </dump_period_in_timesteps> | ||
1536 | 121 | <output_mesh name="OutputMesh"/> | ||
1537 | 122 | <stat/> | ||
1538 | 123 | </io> | ||
1539 | 124 | <timestepping> | ||
1540 | 125 | <current_time> | ||
1541 | 126 | <real_value rank="0">0.0</real_value> | ||
1542 | 127 | </current_time> | ||
1543 | 128 | <timestep> | ||
1544 | 129 | <real_value rank="0">1.0</real_value> | ||
1545 | 130 | </timestep> | ||
1546 | 131 | <finish_time> | ||
1547 | 132 | <real_value rank="0">1.0</real_value> | ||
1548 | 133 | </finish_time> | ||
1549 | 134 | </timestepping> | ||
1550 | 135 | <material_phase name="fluid"> | ||
1551 | 136 | <scalar_field name="Pressure" rank="0"> | ||
1552 | 137 | <prognostic> | ||
1553 | 138 | <mesh name="PressureMesh"/> | ||
1554 | 139 | <spatial_discretisation> | ||
1555 | 140 | <continuous_galerkin> | ||
1556 | 141 | <test_continuity_with_cv_dual/> | ||
1557 | 142 | </continuous_galerkin> | ||
1558 | 143 | </spatial_discretisation> | ||
1559 | 144 | <scheme> | ||
1560 | 145 | <poisson_pressure_solution> | ||
1561 | 146 | <string_value lines="1">never</string_value> | ||
1562 | 147 | </poisson_pressure_solution> | ||
1563 | 148 | <use_projection_method/> | ||
1564 | 149 | </scheme> | ||
1565 | 150 | <solver> | ||
1566 | 151 | <iterative_method name="cg"/> | ||
1567 | 152 | <preconditioner name="sor"/> | ||
1568 | 153 | <relative_error> | ||
1569 | 154 | <real_value rank="0">1.0e-10</real_value> | ||
1570 | 155 | </relative_error> | ||
1571 | 156 | <max_iterations> | ||
1572 | 157 | <integer_value rank="0">1000</integer_value> | ||
1573 | 158 | </max_iterations> | ||
1574 | 159 | <never_ignore_solver_failures/> | ||
1575 | 160 | <diagnostics> | ||
1576 | 161 | <monitors/> | ||
1577 | 162 | </diagnostics> | ||
1578 | 163 | </solver> | ||
1579 | 164 | <boundary_conditions name="right_outflow"> | ||
1580 | 165 | <surface_ids> | ||
1581 | 166 | <integer_value shape="1" rank="1">4</integer_value> | ||
1582 | 167 | </surface_ids> | ||
1583 | 168 | <type name="dirichlet"> | ||
1584 | 169 | <constant> | ||
1585 | 170 | <real_value rank="0">0.0</real_value> | ||
1586 | 171 | </constant> | ||
1587 | 172 | </type> | ||
1588 | 173 | </boundary_conditions> | ||
1589 | 174 | <boundary_conditions name="left_inflow"> | ||
1590 | 175 | <surface_ids> | ||
1591 | 176 | <integer_value shape="1" rank="1">3</integer_value> | ||
1592 | 177 | </surface_ids> | ||
1593 | 178 | <type name="dirichlet"> | ||
1594 | 179 | <apply_weakly/> | ||
1595 | 180 | <constant> | ||
1596 | 181 | <real_value rank="0">1.5e+09</real_value> | ||
1597 | 182 | </constant> | ||
1598 | 183 | </type> | ||
1599 | 184 | </boundary_conditions> | ||
1600 | 185 | <output/> | ||
1601 | 186 | <stat/> | ||
1602 | 187 | <convergence> | ||
1603 | 188 | <include_in_convergence/> | ||
1604 | 189 | </convergence> | ||
1605 | 190 | <detectors> | ||
1606 | 191 | <exclude_from_detectors/> | ||
1607 | 192 | </detectors> | ||
1608 | 193 | <steady_state> | ||
1609 | 194 | <include_in_steady_state/> | ||
1610 | 195 | </steady_state> | ||
1611 | 196 | <no_interpolation/> | ||
1612 | 197 | </prognostic> | ||
1613 | 198 | </scalar_field> | ||
1614 | 199 | <vector_field name="Velocity" rank="1"> | ||
1615 | 200 | <prognostic> | ||
1616 | 201 | <mesh name="VelocityMesh"/> | ||
1617 | 202 | <equation name="Boussinesq"/> | ||
1618 | 203 | <spatial_discretisation> | ||
1619 | 204 | <discontinuous_galerkin> | ||
1620 | 205 | <mass_terms> | ||
1621 | 206 | <exclude_mass_terms/> | ||
1622 | 207 | </mass_terms> | ||
1623 | 208 | <viscosity_scheme> | ||
1624 | 209 | <compact_discontinuous_galerkin/> | ||
1625 | 210 | </viscosity_scheme> | ||
1626 | 211 | <advection_scheme> | ||
1627 | 212 | <none/> | ||
1628 | 213 | <integrate_advection_by_parts> | ||
1629 | 214 | <twice/> | ||
1630 | 215 | </integrate_advection_by_parts> | ||
1631 | 216 | </advection_scheme> | ||
1632 | 217 | </discontinuous_galerkin> | ||
1633 | 218 | <conservative_advection> | ||
1634 | 219 | <real_value rank="0">0.0</real_value> | ||
1635 | 220 | </conservative_advection> | ||
1636 | 221 | </spatial_discretisation> | ||
1637 | 222 | <temporal_discretisation> | ||
1638 | 223 | <theta> | ||
1639 | 224 | <real_value rank="0">1.0</real_value> | ||
1640 | 225 | </theta> | ||
1641 | 226 | <relaxation> | ||
1642 | 227 | <real_value rank="0">1.0</real_value> | ||
1643 | 228 | </relaxation> | ||
1644 | 229 | </temporal_discretisation> | ||
1645 | 230 | <solver> | ||
1646 | 231 | <iterative_method name="gmres"> | ||
1647 | 232 | <restart> | ||
1648 | 233 | <integer_value rank="0">30</integer_value> | ||
1649 | 234 | </restart> | ||
1650 | 235 | </iterative_method> | ||
1651 | 236 | <preconditioner name="sor"/> | ||
1652 | 237 | <relative_error> | ||
1653 | 238 | <real_value rank="0">1.0e-10</real_value> | ||
1654 | 239 | </relative_error> | ||
1655 | 240 | <max_iterations> | ||
1656 | 241 | <integer_value rank="0">1000</integer_value> | ||
1657 | 242 | </max_iterations> | ||
1658 | 243 | <never_ignore_solver_failures/> | ||
1659 | 244 | <diagnostics> | ||
1660 | 245 | <monitors/> | ||
1661 | 246 | </diagnostics> | ||
1662 | 247 | </solver> | ||
1663 | 248 | <initial_condition name="WholeMesh"> | ||
1664 | 249 | <constant> | ||
1665 | 250 | <real_value shape="3" dim1="dim" rank="1">0.0 0.0 0.0</real_value> | ||
1666 | 251 | </constant> | ||
1667 | 252 | </initial_condition> | ||
1668 | 253 | <boundary_conditions name="no_outflow_top_bottom"> | ||
1669 | 254 | <surface_ids> | ||
1670 | 255 | <integer_value shape="2" rank="1">1 2</integer_value> | ||
1671 | 256 | </surface_ids> | ||
1672 | 257 | <type name="dirichlet"> | ||
1673 | 258 | <apply_weakly/> | ||
1674 | 259 | <align_bc_with_cartesian> | ||
1675 | 260 | <z_component> | ||
1676 | 261 | <constant> | ||
1677 | 262 | <real_value rank="0">0.0</real_value> | ||
1678 | 263 | </constant> | ||
1679 | 264 | </z_component> | ||
1680 | 265 | </align_bc_with_cartesian> | ||
1681 | 266 | </type> | ||
1682 | 267 | </boundary_conditions> | ||
1683 | 268 | <boundary_conditions name="no_outflow_front_back"> | ||
1684 | 269 | <surface_ids> | ||
1685 | 270 | <integer_value shape="2" rank="1">5 6</integer_value> | ||
1686 | 271 | </surface_ids> | ||
1687 | 272 | <type name="dirichlet"> | ||
1688 | 273 | <apply_weakly/> | ||
1689 | 274 | <align_bc_with_cartesian> | ||
1690 | 275 | <y_component> | ||
1691 | 276 | <constant> | ||
1692 | 277 | <real_value rank="0">0.0</real_value> | ||
1693 | 278 | </constant> | ||
1694 | 279 | </y_component> | ||
1695 | 280 | </align_bc_with_cartesian> | ||
1696 | 281 | </type> | ||
1697 | 282 | </boundary_conditions> | ||
1698 | 283 | <vector_field name="Absorption" rank="1"> | ||
1699 | 284 | <diagnostic> | ||
1700 | 285 | <mesh name="DGP0"/> | ||
1701 | 286 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
1702 | 287 | <string_value lines="20" type="python"># get the prescribed fields | ||
1703 | 288 | perm = states["fluid"].scalar_fields["Permeability"] | ||
1704 | 289 | visc = states["fluid"].scalar_fields["Viscosity"] | ||
1705 | 290 | |||
1706 | 291 | # loop the DMmesh_p0 nodes (which are element centred) | ||
1707 | 292 | for n in range(field.node_count): | ||
1708 | 293 | perm_n = perm.node_val(n) | ||
1709 | 294 | visc_n = visc.node_val(n) | ||
1710 | 295 | |||
1711 | 296 | # calc the absorption term | ||
1712 | 297 | sigma_n = visc_n/perm_n | ||
1713 | 298 | |||
1714 | 299 | # set the absorption term | ||
1715 | 300 | field.set(n,sigma_n)</string_value> | ||
1716 | 301 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
1717 | 302 | |||
1718 | 303 | also assume that the velocity is dg</comment> | ||
1719 | 304 | </algorithm> | ||
1720 | 305 | <output/> | ||
1721 | 306 | <stat> | ||
1722 | 307 | <include_in_stat/> | ||
1723 | 308 | </stat> | ||
1724 | 309 | <convergence> | ||
1725 | 310 | <include_in_convergence/> | ||
1726 | 311 | </convergence> | ||
1727 | 312 | <detectors> | ||
1728 | 313 | <include_in_detectors/> | ||
1729 | 314 | </detectors> | ||
1730 | 315 | <steady_state> | ||
1731 | 316 | <include_in_steady_state/> | ||
1732 | 317 | </steady_state> | ||
1733 | 318 | </diagnostic> | ||
1734 | 319 | <include_pressure_correction/> | ||
1735 | 320 | </vector_field> | ||
1736 | 321 | <output/> | ||
1737 | 322 | <stat> | ||
1738 | 323 | <include_in_stat/> | ||
1739 | 324 | <previous_time_step> | ||
1740 | 325 | <exclude_from_stat/> | ||
1741 | 326 | </previous_time_step> | ||
1742 | 327 | <nonlinear_field> | ||
1743 | 328 | <exclude_from_stat/> | ||
1744 | 329 | </nonlinear_field> | ||
1745 | 330 | </stat> | ||
1746 | 331 | <convergence> | ||
1747 | 332 | <include_in_convergence/> | ||
1748 | 333 | </convergence> | ||
1749 | 334 | <detectors> | ||
1750 | 335 | <include_in_detectors/> | ||
1751 | 336 | </detectors> | ||
1752 | 337 | <steady_state> | ||
1753 | 338 | <include_in_steady_state/> | ||
1754 | 339 | </steady_state> | ||
1755 | 340 | <consistent_interpolation/> | ||
1756 | 341 | </prognostic> | ||
1757 | 342 | </vector_field> | ||
1758 | 343 | <scalar_field name="Porosity" rank="0"> | ||
1759 | 344 | <prescribed> | ||
1760 | 345 | <mesh name="DGP0"/> | ||
1761 | 346 | <value name="WholeMesh"> | ||
1762 | 347 | <constant> | ||
1763 | 348 | <real_value rank="0">0.5</real_value> | ||
1764 | 349 | </constant> | ||
1765 | 350 | </value> | ||
1766 | 351 | <output/> | ||
1767 | 352 | <stat/> | ||
1768 | 353 | <detectors> | ||
1769 | 354 | <exclude_from_detectors/> | ||
1770 | 355 | </detectors> | ||
1771 | 356 | </prescribed> | ||
1772 | 357 | </scalar_field> | ||
1773 | 358 | <scalar_field name="Permeability" rank="0"> | ||
1774 | 359 | <prescribed> | ||
1775 | 360 | <mesh name="DGP0"/> | ||
1776 | 361 | <value name="WholeMesh"> | ||
1777 | 362 | <constant> | ||
1778 | 363 | <real_value rank="0">1.0e-10</real_value> | ||
1779 | 364 | </constant> | ||
1780 | 365 | </value> | ||
1781 | 366 | <output/> | ||
1782 | 367 | <stat/> | ||
1783 | 368 | <detectors> | ||
1784 | 369 | <exclude_from_detectors/> | ||
1785 | 370 | </detectors> | ||
1786 | 371 | </prescribed> | ||
1787 | 372 | </scalar_field> | ||
1788 | 373 | <scalar_field name="Viscosity" rank="0"> | ||
1789 | 374 | <prescribed> | ||
1790 | 375 | <mesh name="DGP0"/> | ||
1791 | 376 | <value name="WholeMesh"> | ||
1792 | 377 | <constant> | ||
1793 | 378 | <real_value rank="0">1.0e-04</real_value> | ||
1794 | 379 | </constant> | ||
1795 | 380 | </value> | ||
1796 | 381 | <output/> | ||
1797 | 382 | <stat/> | ||
1798 | 383 | <detectors> | ||
1799 | 384 | <exclude_from_detectors/> | ||
1800 | 385 | </detectors> | ||
1801 | 386 | </prescribed> | ||
1802 | 387 | </scalar_field> | ||
1803 | 388 | <scalar_field name="ControlVolumeDivergence" rank="0"> | ||
1804 | 389 | <diagnostic field_name="Velocity"> | ||
1805 | 390 | <algorithm name="Internal" material_phase_support="multiple"/> | ||
1806 | 391 | <mesh name="PressureMesh"/> | ||
1807 | 392 | <output/> | ||
1808 | 393 | <stat/> | ||
1809 | 394 | <convergence> | ||
1810 | 395 | <include_in_convergence/> | ||
1811 | 396 | </convergence> | ||
1812 | 397 | <detectors> | ||
1813 | 398 | <include_in_detectors/> | ||
1814 | 399 | </detectors> | ||
1815 | 400 | <steady_state> | ||
1816 | 401 | <include_in_steady_state/> | ||
1817 | 402 | </steady_state> | ||
1818 | 403 | </diagnostic> | ||
1819 | 404 | </scalar_field> | ||
1820 | 405 | <vector_field name="interstitial_velocity" rank="1"> | ||
1821 | 406 | <diagnostic> | ||
1822 | 407 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
1823 | 408 | <string_value lines="20" type="python">phi = states["fluid"].scalar_fields["Porosity"] | ||
1824 | 409 | darcy_vel = states["fluid"].vector_fields["Velocity"] | ||
1825 | 410 | |||
1826 | 411 | for ele in range(field.element_count): | ||
1827 | 412 | phi_ele = phi.node_val(ele) | ||
1828 | 413 | |||
1829 | 414 | factor_ele = 1.0/max(phi_ele,1.0e-08) | ||
1830 | 415 | |||
1831 | 416 | vel_ele = [] | ||
1832 | 417 | for i in range(len(darcy_vel.ele_val(ele))): | ||
1833 | 418 | vel_ele.append(factor_ele*darcy_vel.ele_val(ele)[i]) | ||
1834 | 419 | |||
1835 | 420 | field.set(darcy_vel.ele_nodes(ele),vel_ele)</string_value> | ||
1836 | 421 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
1837 | 422 | |||
1838 | 423 | also assume that the velocity is dg</comment> | ||
1839 | 424 | </algorithm> | ||
1840 | 425 | <mesh name="VelocityMesh"/> | ||
1841 | 426 | <output/> | ||
1842 | 427 | <stat> | ||
1843 | 428 | <include_in_stat/> | ||
1844 | 429 | </stat> | ||
1845 | 430 | <convergence> | ||
1846 | 431 | <include_in_convergence/> | ||
1847 | 432 | </convergence> | ||
1848 | 433 | <detectors> | ||
1849 | 434 | <include_in_detectors/> | ||
1850 | 435 | </detectors> | ||
1851 | 436 | <steady_state> | ||
1852 | 437 | <include_in_steady_state/> | ||
1853 | 438 | </steady_state> | ||
1854 | 439 | </diagnostic> | ||
1855 | 440 | </vector_field> | ||
1856 | 441 | </material_phase> | ||
1857 | 442 | </fluidity_options> | ||
1858 | 0 | 443 | ||
1859 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet/square.geo' | |||
1860 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet/square.geo 1970-01-01 00:00:00 +0000 | |||
1861 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet/square.geo 2011-12-23 12:05:25 +0000 | |||
1862 | @@ -0,0 +1,22 @@ | |||
1863 | 1 | // define a layer variable | ||
1864 | 2 | lay = 5; | ||
1865 | 3 | |||
1866 | 4 | // define a len variable | ||
1867 | 5 | len = 300.0; | ||
1868 | 6 | |||
1869 | 7 | Point(1) = {0.0, 0.0, 0.0, 1.0}; | ||
1870 | 8 | |||
1871 | 9 | Extrude {len, 0.0, 0.0} { | ||
1872 | 10 | Point{1}; Layers{lay}; | ||
1873 | 11 | } | ||
1874 | 12 | |||
1875 | 13 | Extrude {0.0, len, 0.0} { | ||
1876 | 14 | Line{1}; Layers{lay}; | ||
1877 | 15 | } | ||
1878 | 16 | |||
1879 | 17 | Physical Line(7) = {1}; | ||
1880 | 18 | Physical Line(8) = {4}; | ||
1881 | 19 | Physical Line(9) = {2}; | ||
1882 | 20 | Physical Line(10) = {3}; | ||
1883 | 21 | |||
1884 | 22 | Physical Surface(11) = {5}; | ||
1885 | 0 | 23 | ||
1886 | === added directory 'tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain' | |||
1887 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/Makefile' | |||
1888 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/Makefile 1970-01-01 00:00:00 +0000 | |||
1889 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/Makefile 2011-12-23 12:05:25 +0000 | |||
1890 | @@ -0,0 +1,23 @@ | |||
1891 | 1 | SHELL = sh | ||
1892 | 2 | |||
1893 | 3 | input: clean | ||
1894 | 4 | gmsh -2 square_rotated.geo -o square_rotated.msh | ||
1895 | 5 | |||
1896 | 6 | clean: | ||
1897 | 7 | rm -f *.ele | ||
1898 | 8 | rm -f *.node | ||
1899 | 9 | rm -f *.bound | ||
1900 | 10 | rm -f *.edge | ||
1901 | 11 | rm -f *.face | ||
1902 | 12 | rm -f *.vtu | ||
1903 | 13 | rm -f *.pvtu | ||
1904 | 14 | rm -f *.s | ||
1905 | 15 | rm -f *.stat | ||
1906 | 16 | rm -f *.log-0 | ||
1907 | 17 | rm -f *.err-0 | ||
1908 | 18 | rm -f *.msh | ||
1909 | 19 | rm -f *.halo | ||
1910 | 20 | rm -f fluidity.err* | ||
1911 | 21 | rm -f fluidity.log* | ||
1912 | 22 | rm -f matrixdump* | ||
1913 | 23 | rm -f first_timestep_adapted_mesh* | ||
1914 | 0 | 24 | ||
1915 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain.xml' | |||
1916 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain.xml 1970-01-01 00:00:00 +0000 | |||
1917 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain.xml 2011-12-23 12:05:25 +0000 | |||
1918 | @@ -0,0 +1,46 @@ | |||
1919 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
1920 | 2 | <!DOCTYPE testproblem SYSTEM "regressiontest.dtd"> | ||
1921 | 3 | |||
1922 | 4 | <testproblem> | ||
1923 | 5 | <name>darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain</name> | ||
1924 | 6 | <owner userid="btollit"/> | ||
1925 | 7 | <tags>flml darcy</tags> | ||
1926 | 8 | <problem_definition length="short" nprocs="1"> | ||
1927 | 9 | <command_line> | ||
1928 | 10 | ../../bin/fluidity darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain_2d.flml | ||
1929 | 11 | </command_line> | ||
1930 | 12 | <!-- Two dimensional problem (actually 1d done in 2d) for darcy flow with one region and one material using p0p1_test_cty_cv element type testing the pressure gradient against analytic and the interstitial velocity. This tests using a diagnostic velocity absorption field associated with a mesh and momentum dg for darcy flow. This will use a rotated gmsh domain to test applying the weak pressure BC at a non cartesian aligned axis.--> | ||
1931 | 13 | </problem_definition> | ||
1932 | 14 | <variables> | ||
1933 | 15 | <variable name="pressure_2d" language="python"> | ||
1934 | 16 | import vtktools | ||
1935 | 17 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain_2d_1.vtu") | ||
1936 | 18 | pressure_2d = v.GetScalarRange("Pressure") | ||
1937 | 19 | </variable> | ||
1938 | 20 | <variable name="inter_vel_2d" language="python"> | ||
1939 | 21 | import vtktools | ||
1940 | 22 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain_2d_1.vtu") | ||
1941 | 23 | inter_vel_2d = max(v.GetScalarRange("interstitial_velocity")) | ||
1942 | 24 | </variable> | ||
1943 | 25 | </variables> | ||
1944 | 26 | <pass_tests> | ||
1945 | 27 | <test name="change_P for 2d should equal domain_length*visc*darcy_vel_BC/perm, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
1946 | 28 | change_P = abs(max(pressure_2d) - min(pressure_2d)) | ||
1947 | 29 | visc = 1.0e-04 | ||
1948 | 30 | darcy_vel_BC = 5.0 | ||
1949 | 31 | perm = 1.0e-10 | ||
1950 | 32 | domain_length = 300.0 | ||
1951 | 33 | print 'Relative error of pressure difference: ',abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) | ||
1952 | 34 | assert abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) < 1.0e-09 | ||
1953 | 35 | </test> | ||
1954 | 36 | <test name="interstitial velocity 2d should equal darcy_vel/porosity, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
1955 | 37 | import math | ||
1956 | 38 | # the analytic velocity magnitude is 10.0, with an incline of 45 degrees (= pi/4.0 radians) | ||
1957 | 39 | analytic_vel = 10.0 * math.sin(math.pi/4.0) | ||
1958 | 40 | print 'Relative error of interstitial velocity: ',abs((inter_vel_2d - analytic_vel)/analytic_vel) | ||
1959 | 41 | assert abs((inter_vel_2d - analytic_vel)/analytic_vel) < 1.0e-09 | ||
1960 | 42 | </test> | ||
1961 | 43 | </pass_tests> | ||
1962 | 44 | <warn_tests> | ||
1963 | 45 | </warn_tests> | ||
1964 | 46 | </testproblem> | ||
1965 | 0 | 47 | ||
1966 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain_2d.flml' | |||
1967 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain_2d.flml 1970-01-01 00:00:00 +0000 | |||
1968 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain_2d.flml 2011-12-23 12:05:25 +0000 | |||
1969 | @@ -0,0 +1,372 @@ | |||
1970 | 1 | <?xml version='1.0' encoding='utf-8'?> | ||
1971 | 2 | <fluidity_options> | ||
1972 | 3 | <simulation_name> | ||
1973 | 4 | <string_value lines="1">darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain_2d</string_value> | ||
1974 | 5 | </simulation_name> | ||
1975 | 6 | <problem_type> | ||
1976 | 7 | <string_value lines="1">fluids</string_value> | ||
1977 | 8 | </problem_type> | ||
1978 | 9 | <geometry> | ||
1979 | 10 | <dimension> | ||
1980 | 11 | <integer_value rank="0">2</integer_value> | ||
1981 | 12 | </dimension> | ||
1982 | 13 | <mesh name="CoordinateMesh"> | ||
1983 | 14 | <from_file file_name="square_rotated"> | ||
1984 | 15 | <format name="gmsh"/> | ||
1985 | 16 | <stat> | ||
1986 | 17 | <include_in_stat/> | ||
1987 | 18 | </stat> | ||
1988 | 19 | </from_file> | ||
1989 | 20 | </mesh> | ||
1990 | 21 | <mesh name="VelocityMesh"> | ||
1991 | 22 | <from_mesh> | ||
1992 | 23 | <mesh name="CoordinateMesh"/> | ||
1993 | 24 | <mesh_shape> | ||
1994 | 25 | <polynomial_degree> | ||
1995 | 26 | <integer_value rank="0">0</integer_value> | ||
1996 | 27 | </polynomial_degree> | ||
1997 | 28 | </mesh_shape> | ||
1998 | 29 | <mesh_continuity> | ||
1999 | 30 | <string_value>discontinuous</string_value> | ||
2000 | 31 | </mesh_continuity> | ||
2001 | 32 | <stat> | ||
2002 | 33 | <exclude_from_stat/> | ||
2003 | 34 | </stat> | ||
2004 | 35 | </from_mesh> | ||
2005 | 36 | </mesh> | ||
2006 | 37 | <mesh name="PressureMesh"> | ||
2007 | 38 | <from_mesh> | ||
2008 | 39 | <mesh name="CoordinateMesh"/> | ||
2009 | 40 | <mesh_shape> | ||
2010 | 41 | <polynomial_degree> | ||
2011 | 42 | <integer_value rank="0">1</integer_value> | ||
2012 | 43 | </polynomial_degree> | ||
2013 | 44 | </mesh_shape> | ||
2014 | 45 | <stat> | ||
2015 | 46 | <exclude_from_stat/> | ||
2016 | 47 | </stat> | ||
2017 | 48 | </from_mesh> | ||
2018 | 49 | </mesh> | ||
2019 | 50 | <mesh name="DGP0"> | ||
2020 | 51 | <from_mesh> | ||
2021 | 52 | <mesh name="CoordinateMesh"/> | ||
2022 | 53 | <mesh_shape> | ||
2023 | 54 | <polynomial_degree> | ||
2024 | 55 | <integer_value rank="0">0</integer_value> | ||
2025 | 56 | </polynomial_degree> | ||
2026 | 57 | </mesh_shape> | ||
2027 | 58 | <mesh_continuity> | ||
2028 | 59 | <string_value>discontinuous</string_value> | ||
2029 | 60 | </mesh_continuity> | ||
2030 | 61 | <stat> | ||
2031 | 62 | <exclude_from_stat/> | ||
2032 | 63 | </stat> | ||
2033 | 64 | </from_mesh> | ||
2034 | 65 | </mesh> | ||
2035 | 66 | <mesh name="OutputMesh"> | ||
2036 | 67 | <from_mesh> | ||
2037 | 68 | <mesh name="CoordinateMesh"/> | ||
2038 | 69 | <mesh_continuity> | ||
2039 | 70 | <string_value>discontinuous</string_value> | ||
2040 | 71 | </mesh_continuity> | ||
2041 | 72 | <stat> | ||
2042 | 73 | <exclude_from_stat/> | ||
2043 | 74 | </stat> | ||
2044 | 75 | </from_mesh> | ||
2045 | 76 | </mesh> | ||
2046 | 77 | <quadrature> | ||
2047 | 78 | <degree> | ||
2048 | 79 | <integer_value rank="0">5</integer_value> | ||
2049 | 80 | </degree> | ||
2050 | 81 | </quadrature> | ||
2051 | 82 | </geometry> | ||
2052 | 83 | <io> | ||
2053 | 84 | <dump_format> | ||
2054 | 85 | <string_value>vtk</string_value> | ||
2055 | 86 | </dump_format> | ||
2056 | 87 | <dump_period_in_timesteps> | ||
2057 | 88 | <constant> | ||
2058 | 89 | <integer_value rank="0">0</integer_value> | ||
2059 | 90 | </constant> | ||
2060 | 91 | </dump_period_in_timesteps> | ||
2061 | 92 | <output_mesh name="OutputMesh"/> | ||
2062 | 93 | <stat/> | ||
2063 | 94 | </io> | ||
2064 | 95 | <timestepping> | ||
2065 | 96 | <current_time> | ||
2066 | 97 | <real_value rank="0">0.0</real_value> | ||
2067 | 98 | </current_time> | ||
2068 | 99 | <timestep> | ||
2069 | 100 | <real_value rank="0">1.0</real_value> | ||
2070 | 101 | </timestep> | ||
2071 | 102 | <finish_time> | ||
2072 | 103 | <real_value rank="0">1.0</real_value> | ||
2073 | 104 | </finish_time> | ||
2074 | 105 | </timestepping> | ||
2075 | 106 | <material_phase name="fluid"> | ||
2076 | 107 | <scalar_field name="Pressure" rank="0"> | ||
2077 | 108 | <prognostic> | ||
2078 | 109 | <mesh name="PressureMesh"/> | ||
2079 | 110 | <spatial_discretisation> | ||
2080 | 111 | <continuous_galerkin> | ||
2081 | 112 | <test_continuity_with_cv_dual/> | ||
2082 | 113 | </continuous_galerkin> | ||
2083 | 114 | </spatial_discretisation> | ||
2084 | 115 | <scheme> | ||
2085 | 116 | <poisson_pressure_solution> | ||
2086 | 117 | <string_value lines="1">never</string_value> | ||
2087 | 118 | </poisson_pressure_solution> | ||
2088 | 119 | <use_projection_method/> | ||
2089 | 120 | </scheme> | ||
2090 | 121 | <solver> | ||
2091 | 122 | <iterative_method name="cg"/> | ||
2092 | 123 | <preconditioner name="sor"/> | ||
2093 | 124 | <relative_error> | ||
2094 | 125 | <real_value rank="0">1.0e-10</real_value> | ||
2095 | 126 | </relative_error> | ||
2096 | 127 | <max_iterations> | ||
2097 | 128 | <integer_value rank="0">1000</integer_value> | ||
2098 | 129 | </max_iterations> | ||
2099 | 130 | <never_ignore_solver_failures/> | ||
2100 | 131 | <diagnostics> | ||
2101 | 132 | <monitors/> | ||
2102 | 133 | </diagnostics> | ||
2103 | 134 | </solver> | ||
2104 | 135 | <boundary_conditions name="right_outflow"> | ||
2105 | 136 | <surface_ids> | ||
2106 | 137 | <integer_value shape="1" rank="1">8</integer_value> | ||
2107 | 138 | </surface_ids> | ||
2108 | 139 | <type name="dirichlet"> | ||
2109 | 140 | <constant> | ||
2110 | 141 | <real_value rank="0">0.0</real_value> | ||
2111 | 142 | </constant> | ||
2112 | 143 | </type> | ||
2113 | 144 | </boundary_conditions> | ||
2114 | 145 | <boundary_conditions name="left_inflow"> | ||
2115 | 146 | <surface_ids> | ||
2116 | 147 | <integer_value shape="1" rank="1">10</integer_value> | ||
2117 | 148 | </surface_ids> | ||
2118 | 149 | <type name="dirichlet"> | ||
2119 | 150 | <apply_weakly/> | ||
2120 | 151 | <constant> | ||
2121 | 152 | <real_value rank="0">1.5e+09</real_value> | ||
2122 | 153 | </constant> | ||
2123 | 154 | </type> | ||
2124 | 155 | </boundary_conditions> | ||
2125 | 156 | <output/> | ||
2126 | 157 | <stat/> | ||
2127 | 158 | <convergence> | ||
2128 | 159 | <include_in_convergence/> | ||
2129 | 160 | </convergence> | ||
2130 | 161 | <detectors> | ||
2131 | 162 | <exclude_from_detectors/> | ||
2132 | 163 | </detectors> | ||
2133 | 164 | <steady_state> | ||
2134 | 165 | <include_in_steady_state/> | ||
2135 | 166 | </steady_state> | ||
2136 | 167 | <no_interpolation/> | ||
2137 | 168 | </prognostic> | ||
2138 | 169 | </scalar_field> | ||
2139 | 170 | <vector_field name="Velocity" rank="1"> | ||
2140 | 171 | <prognostic> | ||
2141 | 172 | <mesh name="VelocityMesh"/> | ||
2142 | 173 | <equation name="Boussinesq"/> | ||
2143 | 174 | <spatial_discretisation> | ||
2144 | 175 | <discontinuous_galerkin> | ||
2145 | 176 | <mass_terms> | ||
2146 | 177 | <exclude_mass_terms/> | ||
2147 | 178 | </mass_terms> | ||
2148 | 179 | <viscosity_scheme> | ||
2149 | 180 | <compact_discontinuous_galerkin/> | ||
2150 | 181 | </viscosity_scheme> | ||
2151 | 182 | <advection_scheme> | ||
2152 | 183 | <none/> | ||
2153 | 184 | <integrate_advection_by_parts> | ||
2154 | 185 | <twice/> | ||
2155 | 186 | </integrate_advection_by_parts> | ||
2156 | 187 | </advection_scheme> | ||
2157 | 188 | </discontinuous_galerkin> | ||
2158 | 189 | <conservative_advection> | ||
2159 | 190 | <real_value rank="0">0.0</real_value> | ||
2160 | 191 | </conservative_advection> | ||
2161 | 192 | </spatial_discretisation> | ||
2162 | 193 | <temporal_discretisation> | ||
2163 | 194 | <theta> | ||
2164 | 195 | <real_value rank="0">1.0</real_value> | ||
2165 | 196 | </theta> | ||
2166 | 197 | <relaxation> | ||
2167 | 198 | <real_value rank="0">1.0</real_value> | ||
2168 | 199 | </relaxation> | ||
2169 | 200 | </temporal_discretisation> | ||
2170 | 201 | <solver> | ||
2171 | 202 | <iterative_method name="gmres"> | ||
2172 | 203 | <restart> | ||
2173 | 204 | <integer_value rank="0">30</integer_value> | ||
2174 | 205 | </restart> | ||
2175 | 206 | </iterative_method> | ||
2176 | 207 | <preconditioner name="sor"/> | ||
2177 | 208 | <relative_error> | ||
2178 | 209 | <real_value rank="0">1.0e-10</real_value> | ||
2179 | 210 | </relative_error> | ||
2180 | 211 | <max_iterations> | ||
2181 | 212 | <integer_value rank="0">1000</integer_value> | ||
2182 | 213 | </max_iterations> | ||
2183 | 214 | <never_ignore_solver_failures/> | ||
2184 | 215 | <diagnostics> | ||
2185 | 216 | <monitors/> | ||
2186 | 217 | </diagnostics> | ||
2187 | 218 | </solver> | ||
2188 | 219 | <initial_condition name="WholeMesh"> | ||
2189 | 220 | <constant> | ||
2190 | 221 | <real_value shape="2" dim1="dim" rank="1">0.0 0.0</real_value> | ||
2191 | 222 | </constant> | ||
2192 | 223 | </initial_condition> | ||
2193 | 224 | <boundary_conditions name="no_outflow_top_bottom"> | ||
2194 | 225 | <surface_ids> | ||
2195 | 226 | <integer_value shape="2" rank="1">7 9</integer_value> | ||
2196 | 227 | </surface_ids> | ||
2197 | 228 | <type name="no_normal_flow"/> | ||
2198 | 229 | </boundary_conditions> | ||
2199 | 230 | <vector_field name="Absorption" rank="1"> | ||
2200 | 231 | <diagnostic> | ||
2201 | 232 | <mesh name="DGP0"/> | ||
2202 | 233 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
2203 | 234 | <string_value lines="20" type="python"># get the prescribed fields | ||
2204 | 235 | perm = states["fluid"].scalar_fields["Permeability"] | ||
2205 | 236 | visc = states["fluid"].scalar_fields["Viscosity"] | ||
2206 | 237 | |||
2207 | 238 | # loop the DMmesh_p0 nodes (which are element centred) | ||
2208 | 239 | for n in range(field.node_count): | ||
2209 | 240 | perm_n = perm.node_val(n) | ||
2210 | 241 | visc_n = visc.node_val(n) | ||
2211 | 242 | |||
2212 | 243 | # calc the absorption term | ||
2213 | 244 | sigma_n = visc_n/perm_n | ||
2214 | 245 | |||
2215 | 246 | # set the absorption term | ||
2216 | 247 | field.set(n,sigma_n)</string_value> | ||
2217 | 248 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
2218 | 249 | |||
2219 | 250 | also assume that the velocity is dg</comment> | ||
2220 | 251 | </algorithm> | ||
2221 | 252 | <output/> | ||
2222 | 253 | <stat> | ||
2223 | 254 | <include_in_stat/> | ||
2224 | 255 | </stat> | ||
2225 | 256 | <convergence> | ||
2226 | 257 | <include_in_convergence/> | ||
2227 | 258 | </convergence> | ||
2228 | 259 | <detectors> | ||
2229 | 260 | <include_in_detectors/> | ||
2230 | 261 | </detectors> | ||
2231 | 262 | <steady_state> | ||
2232 | 263 | <include_in_steady_state/> | ||
2233 | 264 | </steady_state> | ||
2234 | 265 | </diagnostic> | ||
2235 | 266 | <include_pressure_correction/> | ||
2236 | 267 | </vector_field> | ||
2237 | 268 | <output/> | ||
2238 | 269 | <stat> | ||
2239 | 270 | <include_in_stat/> | ||
2240 | 271 | <previous_time_step> | ||
2241 | 272 | <exclude_from_stat/> | ||
2242 | 273 | </previous_time_step> | ||
2243 | 274 | <nonlinear_field> | ||
2244 | 275 | <exclude_from_stat/> | ||
2245 | 276 | </nonlinear_field> | ||
2246 | 277 | </stat> | ||
2247 | 278 | <convergence> | ||
2248 | 279 | <include_in_convergence/> | ||
2249 | 280 | </convergence> | ||
2250 | 281 | <detectors> | ||
2251 | 282 | <include_in_detectors/> | ||
2252 | 283 | </detectors> | ||
2253 | 284 | <steady_state> | ||
2254 | 285 | <include_in_steady_state/> | ||
2255 | 286 | </steady_state> | ||
2256 | 287 | <consistent_interpolation/> | ||
2257 | 288 | </prognostic> | ||
2258 | 289 | </vector_field> | ||
2259 | 290 | <scalar_field name="Porosity" rank="0"> | ||
2260 | 291 | <prescribed> | ||
2261 | 292 | <mesh name="DGP0"/> | ||
2262 | 293 | <value name="WholeMesh"> | ||
2263 | 294 | <constant> | ||
2264 | 295 | <real_value rank="0">0.5</real_value> | ||
2265 | 296 | </constant> | ||
2266 | 297 | </value> | ||
2267 | 298 | <output/> | ||
2268 | 299 | <stat/> | ||
2269 | 300 | <detectors> | ||
2270 | 301 | <exclude_from_detectors/> | ||
2271 | 302 | </detectors> | ||
2272 | 303 | </prescribed> | ||
2273 | 304 | </scalar_field> | ||
2274 | 305 | <scalar_field name="Permeability" rank="0"> | ||
2275 | 306 | <prescribed> | ||
2276 | 307 | <mesh name="DGP0"/> | ||
2277 | 308 | <value name="WholeMesh"> | ||
2278 | 309 | <constant> | ||
2279 | 310 | <real_value rank="0">1.0e-10</real_value> | ||
2280 | 311 | </constant> | ||
2281 | 312 | </value> | ||
2282 | 313 | <output/> | ||
2283 | 314 | <stat/> | ||
2284 | 315 | <detectors> | ||
2285 | 316 | <exclude_from_detectors/> | ||
2286 | 317 | </detectors> | ||
2287 | 318 | </prescribed> | ||
2288 | 319 | </scalar_field> | ||
2289 | 320 | <scalar_field name="Viscosity" rank="0"> | ||
2290 | 321 | <prescribed> | ||
2291 | 322 | <mesh name="DGP0"/> | ||
2292 | 323 | <value name="WholeMesh"> | ||
2293 | 324 | <constant> | ||
2294 | 325 | <real_value rank="0">1.0e-04</real_value> | ||
2295 | 326 | </constant> | ||
2296 | 327 | </value> | ||
2297 | 328 | <output/> | ||
2298 | 329 | <stat/> | ||
2299 | 330 | <detectors> | ||
2300 | 331 | <exclude_from_detectors/> | ||
2301 | 332 | </detectors> | ||
2302 | 333 | </prescribed> | ||
2303 | 334 | </scalar_field> | ||
2304 | 335 | <vector_field name="interstitial_velocity" rank="1"> | ||
2305 | 336 | <diagnostic> | ||
2306 | 337 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
2307 | 338 | <string_value lines="20" type="python">phi = states["fluid"].scalar_fields["Porosity"] | ||
2308 | 339 | darcy_vel = states["fluid"].vector_fields["Velocity"] | ||
2309 | 340 | |||
2310 | 341 | for ele in range(field.element_count): | ||
2311 | 342 | phi_ele = phi.node_val(ele) | ||
2312 | 343 | |||
2313 | 344 | factor_ele = 1.0/max(phi_ele,1.0e-08) | ||
2314 | 345 | |||
2315 | 346 | vel_ele = [] | ||
2316 | 347 | for i in range(len(darcy_vel.ele_val(ele))): | ||
2317 | 348 | vel_ele.append(factor_ele*darcy_vel.ele_val(ele)[i]) | ||
2318 | 349 | |||
2319 | 350 | field.set(darcy_vel.ele_nodes(ele),vel_ele)</string_value> | ||
2320 | 351 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
2321 | 352 | |||
2322 | 353 | also assume that the velocity is dg</comment> | ||
2323 | 354 | </algorithm> | ||
2324 | 355 | <mesh name="VelocityMesh"/> | ||
2325 | 356 | <output/> | ||
2326 | 357 | <stat> | ||
2327 | 358 | <include_in_stat/> | ||
2328 | 359 | </stat> | ||
2329 | 360 | <convergence> | ||
2330 | 361 | <include_in_convergence/> | ||
2331 | 362 | </convergence> | ||
2332 | 363 | <detectors> | ||
2333 | 364 | <include_in_detectors/> | ||
2334 | 365 | </detectors> | ||
2335 | 366 | <steady_state> | ||
2336 | 367 | <include_in_steady_state/> | ||
2337 | 368 | </steady_state> | ||
2338 | 369 | </diagnostic> | ||
2339 | 370 | </vector_field> | ||
2340 | 371 | </material_phase> | ||
2341 | 372 | </fluidity_options> | ||
2342 | 0 | 373 | ||
2343 | === added file 'tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/square_rotated.geo' | |||
2344 | --- tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/square_rotated.geo 1970-01-01 00:00:00 +0000 | |||
2345 | +++ tests/darcy_p0p1_test_cty_cv_pressBCinlet_rotated_domain/square_rotated.geo 2011-12-23 12:05:25 +0000 | |||
2346 | @@ -0,0 +1,38 @@ | |||
2347 | 1 | // define a characteristic length | ||
2348 | 2 | lc = 60.0; | ||
2349 | 3 | |||
2350 | 4 | len = 300.0; | ||
2351 | 5 | |||
2352 | 6 | // define points | ||
2353 | 7 | Point(1) = {0.0,0.0,0.0,lc}; | ||
2354 | 8 | Point(2) = {len,0.0,0.0,lc}; | ||
2355 | 9 | Point(3) = {len,len,0.0,lc}; | ||
2356 | 10 | Point(4) = {0.0,len,0.0,lc}; | ||
2357 | 11 | |||
2358 | 12 | // define line's | ||
2359 | 13 | Line(1) = {1,2}; | ||
2360 | 14 | Line(2) = {2,3}; | ||
2361 | 15 | Line(3) = {3,4}; | ||
2362 | 16 | Line(4) = {4,1}; | ||
2363 | 17 | |||
2364 | 18 | // define line loop | ||
2365 | 19 | Line Loop(1) = {1,2,3,4}; | ||
2366 | 20 | |||
2367 | 21 | // define surface | ||
2368 | 22 | Plane Surface(1) = {1}; | ||
2369 | 23 | |||
2370 | 24 | // Rotate the domain about the z axis by 45 degrees (Pi/4) | ||
2371 | 25 | Rotate {{0, 0, 1}, {0, 0, 0}, Pi/4} { | ||
2372 | 26 | Surface{1}; | ||
2373 | 27 | } | ||
2374 | 28 | |||
2375 | 29 | // Tag the lines and surface | ||
2376 | 30 | Physical Line(7) = {1}; | ||
2377 | 31 | Physical Line(8) = {2}; | ||
2378 | 32 | Physical Line(9) = {3}; | ||
2379 | 33 | Physical Line(10) = {4}; | ||
2380 | 34 | |||
2381 | 35 | Physical Surface(11) = {1}; | ||
2382 | 36 | |||
2383 | 37 | // Make the grid regular | ||
2384 | 38 | Transfinite Surface"*"; | ||
2385 | 0 | 39 | ||
2386 | === added directory 'tests/darcy_p0p1_test_cty_cv_velBCinlet' | |||
2387 | === added file 'tests/darcy_p0p1_test_cty_cv_velBCinlet/Makefile' | |||
2388 | --- tests/darcy_p0p1_test_cty_cv_velBCinlet/Makefile 1970-01-01 00:00:00 +0000 | |||
2389 | +++ tests/darcy_p0p1_test_cty_cv_velBCinlet/Makefile 2011-12-23 12:05:25 +0000 | |||
2390 | @@ -0,0 +1,32 @@ | |||
2391 | 1 | SHELL = sh | ||
2392 | 2 | |||
2393 | 3 | SIM = darcy_p0p1_test_cty_cv_velBCinlet | ||
2394 | 4 | |||
2395 | 5 | # options for 1d mesh interval script | ||
2396 | 6 | MESH_SIZE = 100.0 | ||
2397 | 7 | LEFT_X = 0.0 | ||
2398 | 8 | RIGHT_X = 300.0 | ||
2399 | 9 | |||
2400 | 10 | input: clean | ||
2401 | 11 | interval --dx=$(MESH_SIZE) $(LEFT_X) $(RIGHT_X) $(SIM)_1d | ||
2402 | 12 | gmsh -2 square.geo -o square.msh | ||
2403 | 13 | gmsh -3 cube.geo -o cube.msh | ||
2404 | 14 | |||
2405 | 15 | clean: | ||
2406 | 16 | rm -f *.ele | ||
2407 | 17 | rm -f *.node | ||
2408 | 18 | rm -f *.bound | ||
2409 | 19 | rm -f *.edge | ||
2410 | 20 | rm -f *.face | ||
2411 | 21 | rm -f *.vtu | ||
2412 | 22 | rm -f *.pvtu | ||
2413 | 23 | rm -f *.s | ||
2414 | 24 | rm -f *.stat | ||
2415 | 25 | rm -f *.log-0 | ||
2416 | 26 | rm -f *.err-0 | ||
2417 | 27 | rm -f *.msh | ||
2418 | 28 | rm -f *.halo | ||
2419 | 29 | rm -f fluidity.err* | ||
2420 | 30 | rm -f fluidity.log* | ||
2421 | 31 | rm -f matrixdump* | ||
2422 | 32 | rm -f first_timestep_adapted_mesh* | ||
2423 | 0 | 33 | ||
2424 | === added file 'tests/darcy_p0p1_test_cty_cv_velBCinlet/cube.geo' | |||
2425 | --- tests/darcy_p0p1_test_cty_cv_velBCinlet/cube.geo 1970-01-01 00:00:00 +0000 | |||
2426 | +++ tests/darcy_p0p1_test_cty_cv_velBCinlet/cube.geo 2011-12-23 12:05:25 +0000 | |||
2427 | @@ -0,0 +1,39 @@ | |||
2428 | 1 | // define a layer variable | ||
2429 | 2 | lay = 5; | ||
2430 | 3 | |||
2431 | 4 | // define a len variable | ||
2432 | 5 | len = 300.0; | ||
2433 | 6 | |||
2434 | 7 | Point(1) = {0.0, 0.0, 0.0, 1.0}; | ||
2435 | 8 | |||
2436 | 9 | Extrude {len, 0.0, 0.0} { | ||
2437 | 10 | Point{1}; Layers{lay}; | ||
2438 | 11 | } | ||
2439 | 12 | |||
2440 | 13 | Extrude {0.0, len, 0.0} { | ||
2441 | 14 | Line{1}; Layers{lay}; | ||
2442 | 15 | } | ||
2443 | 16 | |||
2444 | 17 | Extrude {0.0, 0.0, len} { | ||
2445 | 18 | Surface{5}; Layers{lay}; | ||
2446 | 19 | } | ||
2447 | 20 | |||
2448 | 21 | // bottom | ||
2449 | 22 | Physical Surface(1) = {5}; | ||
2450 | 23 | |||
2451 | 24 | // top | ||
2452 | 25 | Physical Surface(2) = {27}; | ||
2453 | 26 | |||
2454 | 27 | // left | ||
2455 | 28 | Physical Surface(3) = {26}; | ||
2456 | 29 | |||
2457 | 30 | // right | ||
2458 | 31 | Physical Surface(4) = {18}; | ||
2459 | 32 | |||
2460 | 33 | // front | ||
2461 | 34 | Physical Surface(5) = {14}; | ||
2462 | 35 | |||
2463 | 36 | // back | ||
2464 | 37 | Physical Surface(6) = {22}; | ||
2465 | 38 | |||
2466 | 39 | Physical Volume(1) = {1}; | ||
2467 | 0 | 40 | ||
2468 | === added file 'tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet.xml' | |||
2469 | --- tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet.xml 1970-01-01 00:00:00 +0000 | |||
2470 | +++ tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet.xml 2011-12-23 12:05:25 +0000 | |||
2471 | @@ -0,0 +1,94 @@ | |||
2472 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
2473 | 2 | <!DOCTYPE testproblem SYSTEM "regressiontest.dtd"> | ||
2474 | 3 | |||
2475 | 4 | <testproblem> | ||
2476 | 5 | <name>darcy_p0p1_test_cty_cv_velBCinlet</name> | ||
2477 | 6 | <owner userid="btollit"/> | ||
2478 | 7 | <tags>flml darcy</tags> | ||
2479 | 8 | <problem_definition length="short" nprocs="1"> | ||
2480 | 9 | <command_line> | ||
2481 | 10 | ../../bin/fluidity darcy_p0p1_test_cty_cv_velBCinlet_1d.flml | ||
2482 | 11 | ../../bin/fluidity darcy_p0p1_test_cty_cv_velBCinlet_2d.flml | ||
2483 | 12 | ../../bin/fluidity darcy_p0p1_test_cty_cv_velBCinlet_3d.flml | ||
2484 | 13 | </command_line> | ||
2485 | 14 | <!-- One/two/three dimensional problem for darcy flow with one region and one material using p0p1_test_cty_cv element type testing the pressure gradient against analytic and the interstitial velocity. This tests using a diagnostic velocity absorption field associated with a mesh and momentum dg for darcy flow--> | ||
2486 | 15 | </problem_definition> | ||
2487 | 16 | <variables> | ||
2488 | 17 | <variable name="pressure_1d" language="python"> | ||
2489 | 18 | import vtktools | ||
2490 | 19 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_velBCinlet_1d_1.vtu") | ||
2491 | 20 | pressure_1d = v.GetScalarRange("Pressure") | ||
2492 | 21 | </variable> | ||
2493 | 22 | <variable name="inter_vel_1d" language="python"> | ||
2494 | 23 | import vtktools | ||
2495 | 24 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_velBCinlet_1d_1.vtu") | ||
2496 | 25 | inter_vel_1d = max(v.GetScalarRange("interstitial_velocity")) | ||
2497 | 26 | </variable> | ||
2498 | 27 | <variable name="pressure_2d" language="python"> | ||
2499 | 28 | import vtktools | ||
2500 | 29 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_velBCinlet_2d_1.vtu") | ||
2501 | 30 | pressure_2d = v.GetScalarRange("Pressure") | ||
2502 | 31 | </variable> | ||
2503 | 32 | <variable name="inter_vel_2d" language="python"> | ||
2504 | 33 | import vtktools | ||
2505 | 34 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_velBCinlet_2d_1.vtu") | ||
2506 | 35 | inter_vel_2d = max(v.GetScalarRange("interstitial_velocity")) | ||
2507 | 36 | </variable> | ||
2508 | 37 | <variable name="pressure_3d" language="python"> | ||
2509 | 38 | import vtktools | ||
2510 | 39 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_velBCinlet_3d_1.vtu") | ||
2511 | 40 | pressure_3d = v.GetScalarRange("Pressure") | ||
2512 | 41 | </variable> | ||
2513 | 42 | <variable name="inter_vel_3d" language="python"> | ||
2514 | 43 | import vtktools | ||
2515 | 44 | v = vtktools.vtu("darcy_p0p1_test_cty_cv_velBCinlet_3d_1.vtu") | ||
2516 | 45 | inter_vel_3d = max(v.GetScalarRange("interstitial_velocity")) | ||
2517 | 46 | </variable> | ||
2518 | 47 | </variables> | ||
2519 | 48 | <pass_tests> | ||
2520 | 49 | <test name="change_P for 1d should equal domain_length*visc*darcy_vel_BC/perm, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
2521 | 50 | change_P = abs(max(pressure_1d) - min(pressure_1d)) | ||
2522 | 51 | visc = 1.0e-04 | ||
2523 | 52 | darcy_vel_BC = 5.0 | ||
2524 | 53 | perm = 1.0e-10 | ||
2525 | 54 | domain_length = 300.0 | ||
2526 | 55 | print 'Relative error of pressure difference: ',abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) | ||
2527 | 56 | assert abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) < 1.0e-09 | ||
2528 | 57 | </test> | ||
2529 | 58 | <test name="interstitial velocity 1d should equal darcy_vel/porosity), check relative difference to be under tolerance 1.0e-09" language="python"> | ||
2530 | 59 | analytic_vel = 10.0 | ||
2531 | 60 | print 'Relative error of interstitial velocity: ',abs((inter_vel_1d - analytic_vel)/analytic_vel) | ||
2532 | 61 | assert abs((inter_vel_1d - analytic_vel)/analytic_vel) < 1.0e-09 | ||
2533 | 62 | </test> | ||
2534 | 63 | <test name="change_P for 2d should equal domain_length*visc*darcy_vel_BC/perm, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
2535 | 64 | change_P = abs(max(pressure_2d) - min(pressure_2d)) | ||
2536 | 65 | visc = 1.0e-04 | ||
2537 | 66 | darcy_vel_BC = 5.0 | ||
2538 | 67 | perm = 1.0e-10 | ||
2539 | 68 | domain_length = 300.0 | ||
2540 | 69 | print 'Relative error of pressure difference: ',abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) | ||
2541 | 70 | assert abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) < 1.0e-09 | ||
2542 | 71 | </test> | ||
2543 | 72 | <test name="interstitial velocity 2d should equal darcy_vel/porosity), check relative difference to be under tolerance 1.0e-09" language="python"> | ||
2544 | 73 | analytic_vel = 10.0 | ||
2545 | 74 | print 'Relative error of interstitial velocity: ',abs((inter_vel_2d - analytic_vel)/analytic_vel) | ||
2546 | 75 | assert abs((inter_vel_2d - analytic_vel)/analytic_vel) < 1.0e-09 | ||
2547 | 76 | </test> | ||
2548 | 77 | <test name="change_P for 3d should equal domain_length*visc*darcy_vel_BC/perm, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
2549 | 78 | change_P = abs(max(pressure_3d) - min(pressure_3d)) | ||
2550 | 79 | visc = 1.0e-04 | ||
2551 | 80 | darcy_vel_BC = 5.0 | ||
2552 | 81 | perm = 1.0e-10 | ||
2553 | 82 | domain_length = 300.0 | ||
2554 | 83 | print 'Relative error of pressure difference: ',abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) | ||
2555 | 84 | assert abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) < 1.0e-09 | ||
2556 | 85 | </test> | ||
2557 | 86 | <test name="interstitial velocity 3d should equal darcy_vel/porosity), check relative difference to be under tolerance 1.0e-09" language="python"> | ||
2558 | 87 | analytic_vel = 10.0 | ||
2559 | 88 | print 'Relative error of interstitial velocity: ',abs((inter_vel_3d - analytic_vel)/analytic_vel) | ||
2560 | 89 | assert abs((inter_vel_3d - analytic_vel)/analytic_vel) < 1.0e-09 | ||
2561 | 90 | </test> | ||
2562 | 91 | </pass_tests> | ||
2563 | 92 | <warn_tests> | ||
2564 | 93 | </warn_tests> | ||
2565 | 94 | </testproblem> | ||
2566 | 0 | 95 | ||
2567 | === added file 'tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_1d.flml' | |||
2568 | --- tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_1d.flml 1970-01-01 00:00:00 +0000 | |||
2569 | +++ tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_1d.flml 2011-12-23 12:05:25 +0000 | |||
2570 | @@ -0,0 +1,391 @@ | |||
2571 | 1 | <?xml version='1.0' encoding='utf-8'?> | ||
2572 | 2 | <fluidity_options> | ||
2573 | 3 | <simulation_name> | ||
2574 | 4 | <string_value lines="1">darcy_p0p1_test_cty_cv_velBCinlet_1d</string_value> | ||
2575 | 5 | <comment>a simple short test case for darcy flow using the element type p0p1_test_cty_cv for velocity-pressure | ||
2576 | 6 | |||
2577 | 7 | the darcy velocity is solved for and the interstitial velocity is a diagnostic from this (assuming a dg solution) | ||
2578 | 8 | |||
2579 | 9 | it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct | ||
2580 | 10 | |||
2581 | 11 | the darcy flow equation is | ||
2582 | 12 | |||
2583 | 13 | sigma*darcy_vel = - grad P | ||
2584 | 14 | |||
2585 | 15 | sigma is a function of viscosity and permeability which are two input fields that are named in the flml - not on fluidity special names (ie. this doesnt use the porous media object options) | ||
2586 | 16 | |||
2587 | 17 | python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity | ||
2588 | 18 | |||
2589 | 19 | this case has a 1 region 1 material with velocity boundary condition inflow. | ||
2590 | 20 | |||
2591 | 21 | to get a darcy equation the time, stress and advection terms are not included in a bousinessq formulation (to avoid needing to specify a density). Ideally it would be better to actually have a darcy momentum option to simplify the input. | ||
2592 | 22 | |||
2593 | 23 | the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation) | ||
2594 | 24 | |||
2595 | 25 | the geometry is 1d and one time step is done (as nothing depends on time)</comment> | ||
2596 | 26 | </simulation_name> | ||
2597 | 27 | <problem_type> | ||
2598 | 28 | <string_value lines="1">fluids</string_value> | ||
2599 | 29 | </problem_type> | ||
2600 | 30 | <geometry> | ||
2601 | 31 | <dimension> | ||
2602 | 32 | <integer_value rank="0">1</integer_value> | ||
2603 | 33 | </dimension> | ||
2604 | 34 | <mesh name="CoordinateMesh"> | ||
2605 | 35 | <from_file file_name="darcy_p0p1_test_cty_cv_velBCinlet_1d"> | ||
2606 | 36 | <format name="triangle"/> | ||
2607 | 37 | <stat> | ||
2608 | 38 | <include_in_stat/> | ||
2609 | 39 | </stat> | ||
2610 | 40 | </from_file> | ||
2611 | 41 | </mesh> | ||
2612 | 42 | <mesh name="VelocityMesh"> | ||
2613 | 43 | <from_mesh> | ||
2614 | 44 | <mesh name="CoordinateMesh"/> | ||
2615 | 45 | <mesh_shape> | ||
2616 | 46 | <polynomial_degree> | ||
2617 | 47 | <integer_value rank="0">0</integer_value> | ||
2618 | 48 | </polynomial_degree> | ||
2619 | 49 | </mesh_shape> | ||
2620 | 50 | <mesh_continuity> | ||
2621 | 51 | <string_value>discontinuous</string_value> | ||
2622 | 52 | </mesh_continuity> | ||
2623 | 53 | <stat> | ||
2624 | 54 | <exclude_from_stat/> | ||
2625 | 55 | </stat> | ||
2626 | 56 | </from_mesh> | ||
2627 | 57 | </mesh> | ||
2628 | 58 | <mesh name="PressureMesh"> | ||
2629 | 59 | <from_mesh> | ||
2630 | 60 | <mesh name="CoordinateMesh"/> | ||
2631 | 61 | <mesh_shape> | ||
2632 | 62 | <polynomial_degree> | ||
2633 | 63 | <integer_value rank="0">1</integer_value> | ||
2634 | 64 | </polynomial_degree> | ||
2635 | 65 | </mesh_shape> | ||
2636 | 66 | <stat> | ||
2637 | 67 | <exclude_from_stat/> | ||
2638 | 68 | </stat> | ||
2639 | 69 | </from_mesh> | ||
2640 | 70 | </mesh> | ||
2641 | 71 | <mesh name="DGP0"> | ||
2642 | 72 | <from_mesh> | ||
2643 | 73 | <mesh name="CoordinateMesh"/> | ||
2644 | 74 | <mesh_shape> | ||
2645 | 75 | <polynomial_degree> | ||
2646 | 76 | <integer_value rank="0">0</integer_value> | ||
2647 | 77 | </polynomial_degree> | ||
2648 | 78 | </mesh_shape> | ||
2649 | 79 | <mesh_continuity> | ||
2650 | 80 | <string_value>discontinuous</string_value> | ||
2651 | 81 | </mesh_continuity> | ||
2652 | 82 | <stat> | ||
2653 | 83 | <exclude_from_stat/> | ||
2654 | 84 | </stat> | ||
2655 | 85 | </from_mesh> | ||
2656 | 86 | </mesh> | ||
2657 | 87 | <mesh name="OutputMesh"> | ||
2658 | 88 | <from_mesh> | ||
2659 | 89 | <mesh name="CoordinateMesh"/> | ||
2660 | 90 | <mesh_continuity> | ||
2661 | 91 | <string_value>discontinuous</string_value> | ||
2662 | 92 | </mesh_continuity> | ||
2663 | 93 | <stat> | ||
2664 | 94 | <exclude_from_stat/> | ||
2665 | 95 | </stat> | ||
2666 | 96 | </from_mesh> | ||
2667 | 97 | </mesh> | ||
2668 | 98 | <quadrature> | ||
2669 | 99 | <degree> | ||
2670 | 100 | <integer_value rank="0">2</integer_value> | ||
2671 | 101 | </degree> | ||
2672 | 102 | </quadrature> | ||
2673 | 103 | </geometry> | ||
2674 | 104 | <io> | ||
2675 | 105 | <dump_format> | ||
2676 | 106 | <string_value>vtk</string_value> | ||
2677 | 107 | </dump_format> | ||
2678 | 108 | <dump_period_in_timesteps> | ||
2679 | 109 | <constant> | ||
2680 | 110 | <integer_value rank="0">0</integer_value> | ||
2681 | 111 | </constant> | ||
2682 | 112 | </dump_period_in_timesteps> | ||
2683 | 113 | <output_mesh name="OutputMesh"/> | ||
2684 | 114 | <stat/> | ||
2685 | 115 | </io> | ||
2686 | 116 | <timestepping> | ||
2687 | 117 | <current_time> | ||
2688 | 118 | <real_value rank="0">0.0</real_value> | ||
2689 | 119 | </current_time> | ||
2690 | 120 | <timestep> | ||
2691 | 121 | <real_value rank="0">1.0</real_value> | ||
2692 | 122 | </timestep> | ||
2693 | 123 | <finish_time> | ||
2694 | 124 | <real_value rank="0">1.0</real_value> | ||
2695 | 125 | </finish_time> | ||
2696 | 126 | </timestepping> | ||
2697 | 127 | <material_phase name="fluid"> | ||
2698 | 128 | <scalar_field name="Pressure" rank="0"> | ||
2699 | 129 | <prognostic> | ||
2700 | 130 | <mesh name="PressureMesh"/> | ||
2701 | 131 | <spatial_discretisation> | ||
2702 | 132 | <continuous_galerkin> | ||
2703 | 133 | <test_continuity_with_cv_dual/> | ||
2704 | 134 | </continuous_galerkin> | ||
2705 | 135 | </spatial_discretisation> | ||
2706 | 136 | <scheme> | ||
2707 | 137 | <poisson_pressure_solution> | ||
2708 | 138 | <string_value lines="1">never</string_value> | ||
2709 | 139 | </poisson_pressure_solution> | ||
2710 | 140 | <use_projection_method/> | ||
2711 | 141 | </scheme> | ||
2712 | 142 | <solver> | ||
2713 | 143 | <iterative_method name="cg"/> | ||
2714 | 144 | <preconditioner name="sor"/> | ||
2715 | 145 | <relative_error> | ||
2716 | 146 | <real_value rank="0">1.0e-10</real_value> | ||
2717 | 147 | </relative_error> | ||
2718 | 148 | <max_iterations> | ||
2719 | 149 | <integer_value rank="0">1000</integer_value> | ||
2720 | 150 | </max_iterations> | ||
2721 | 151 | <never_ignore_solver_failures/> | ||
2722 | 152 | <diagnostics> | ||
2723 | 153 | <monitors/> | ||
2724 | 154 | </diagnostics> | ||
2725 | 155 | </solver> | ||
2726 | 156 | <boundary_conditions name="right_outflow"> | ||
2727 | 157 | <surface_ids> | ||
2728 | 158 | <integer_value shape="1" rank="1">2</integer_value> | ||
2729 | 159 | </surface_ids> | ||
2730 | 160 | <type name="dirichlet"> | ||
2731 | 161 | <constant> | ||
2732 | 162 | <real_value rank="0">0.0</real_value> | ||
2733 | 163 | </constant> | ||
2734 | 164 | </type> | ||
2735 | 165 | </boundary_conditions> | ||
2736 | 166 | <output/> | ||
2737 | 167 | <stat/> | ||
2738 | 168 | <convergence> | ||
2739 | 169 | <include_in_convergence/> | ||
2740 | 170 | </convergence> | ||
2741 | 171 | <detectors> | ||
2742 | 172 | <exclude_from_detectors/> | ||
2743 | 173 | </detectors> | ||
2744 | 174 | <steady_state> | ||
2745 | 175 | <include_in_steady_state/> | ||
2746 | 176 | </steady_state> | ||
2747 | 177 | <no_interpolation/> | ||
2748 | 178 | </prognostic> | ||
2749 | 179 | </scalar_field> | ||
2750 | 180 | <vector_field name="Velocity" rank="1"> | ||
2751 | 181 | <prognostic> | ||
2752 | 182 | <mesh name="VelocityMesh"/> | ||
2753 | 183 | <equation name="Boussinesq"/> | ||
2754 | 184 | <spatial_discretisation> | ||
2755 | 185 | <discontinuous_galerkin> | ||
2756 | 186 | <mass_terms> | ||
2757 | 187 | <exclude_mass_terms/> | ||
2758 | 188 | </mass_terms> | ||
2759 | 189 | <viscosity_scheme> | ||
2760 | 190 | <compact_discontinuous_galerkin/> | ||
2761 | 191 | </viscosity_scheme> | ||
2762 | 192 | <advection_scheme> | ||
2763 | 193 | <none/> | ||
2764 | 194 | <integrate_advection_by_parts> | ||
2765 | 195 | <twice/> | ||
2766 | 196 | </integrate_advection_by_parts> | ||
2767 | 197 | </advection_scheme> | ||
2768 | 198 | </discontinuous_galerkin> | ||
2769 | 199 | <conservative_advection> | ||
2770 | 200 | <real_value rank="0">0.0</real_value> | ||
2771 | 201 | </conservative_advection> | ||
2772 | 202 | </spatial_discretisation> | ||
2773 | 203 | <temporal_discretisation> | ||
2774 | 204 | <theta> | ||
2775 | 205 | <real_value rank="0">1.0</real_value> | ||
2776 | 206 | </theta> | ||
2777 | 207 | <relaxation> | ||
2778 | 208 | <real_value rank="0">1.0</real_value> | ||
2779 | 209 | </relaxation> | ||
2780 | 210 | </temporal_discretisation> | ||
2781 | 211 | <solver> | ||
2782 | 212 | <iterative_method name="gmres"> | ||
2783 | 213 | <restart> | ||
2784 | 214 | <integer_value rank="0">30</integer_value> | ||
2785 | 215 | </restart> | ||
2786 | 216 | </iterative_method> | ||
2787 | 217 | <preconditioner name="sor"/> | ||
2788 | 218 | <relative_error> | ||
2789 | 219 | <real_value rank="0">1.0e-10</real_value> | ||
2790 | 220 | </relative_error> | ||
2791 | 221 | <max_iterations> | ||
2792 | 222 | <integer_value rank="0">1000</integer_value> | ||
2793 | 223 | </max_iterations> | ||
2794 | 224 | <never_ignore_solver_failures/> | ||
2795 | 225 | <diagnostics> | ||
2796 | 226 | <monitors/> | ||
2797 | 227 | </diagnostics> | ||
2798 | 228 | </solver> | ||
2799 | 229 | <initial_condition name="WholeMesh"> | ||
2800 | 230 | <constant> | ||
2801 | 231 | <real_value shape="1" dim1="dim" rank="1">0.0</real_value> | ||
2802 | 232 | </constant> | ||
2803 | 233 | </initial_condition> | ||
2804 | 234 | <boundary_conditions name="left_inflow"> | ||
2805 | 235 | <surface_ids> | ||
2806 | 236 | <integer_value shape="1" rank="1">1</integer_value> | ||
2807 | 237 | </surface_ids> | ||
2808 | 238 | <type name="dirichlet"> | ||
2809 | 239 | <apply_weakly/> | ||
2810 | 240 | <align_bc_with_cartesian> | ||
2811 | 241 | <x_component> | ||
2812 | 242 | <constant> | ||
2813 | 243 | <real_value rank="0">5.0</real_value> | ||
2814 | 244 | </constant> | ||
2815 | 245 | </x_component> | ||
2816 | 246 | </align_bc_with_cartesian> | ||
2817 | 247 | </type> | ||
2818 | 248 | </boundary_conditions> | ||
2819 | 249 | <vector_field name="Absorption" rank="1"> | ||
2820 | 250 | <diagnostic> | ||
2821 | 251 | <mesh name="DGP0"/> | ||
2822 | 252 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
2823 | 253 | <string_value lines="20" type="python"># get the prescribed fields | ||
2824 | 254 | perm = states["fluid"].scalar_fields["Permeability"] | ||
2825 | 255 | visc = states["fluid"].scalar_fields["Viscosity"] | ||
2826 | 256 | |||
2827 | 257 | # loop the DMmesh_p0 nodes (which are element centred) | ||
2828 | 258 | for n in range(field.node_count): | ||
2829 | 259 | perm_n = perm.node_val(n) | ||
2830 | 260 | visc_n = visc.node_val(n) | ||
2831 | 261 | |||
2832 | 262 | # calc the absorption term | ||
2833 | 263 | sigma_n = visc_n/perm_n | ||
2834 | 264 | |||
2835 | 265 | # set the absorption term | ||
2836 | 266 | field.set(n,sigma_n)</string_value> | ||
2837 | 267 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
2838 | 268 | |||
2839 | 269 | also assume that the velocity is dg</comment> | ||
2840 | 270 | </algorithm> | ||
2841 | 271 | <output/> | ||
2842 | 272 | <stat> | ||
2843 | 273 | <include_in_stat/> | ||
2844 | 274 | </stat> | ||
2845 | 275 | <convergence> | ||
2846 | 276 | <include_in_convergence/> | ||
2847 | 277 | </convergence> | ||
2848 | 278 | <detectors> | ||
2849 | 279 | <include_in_detectors/> | ||
2850 | 280 | </detectors> | ||
2851 | 281 | <steady_state> | ||
2852 | 282 | <include_in_steady_state/> | ||
2853 | 283 | </steady_state> | ||
2854 | 284 | </diagnostic> | ||
2855 | 285 | <include_pressure_correction/> | ||
2856 | 286 | </vector_field> | ||
2857 | 287 | <output/> | ||
2858 | 288 | <stat> | ||
2859 | 289 | <include_in_stat/> | ||
2860 | 290 | <previous_time_step> | ||
2861 | 291 | <exclude_from_stat/> | ||
2862 | 292 | </previous_time_step> | ||
2863 | 293 | <nonlinear_field> | ||
2864 | 294 | <exclude_from_stat/> | ||
2865 | 295 | </nonlinear_field> | ||
2866 | 296 | </stat> | ||
2867 | 297 | <convergence> | ||
2868 | 298 | <include_in_convergence/> | ||
2869 | 299 | </convergence> | ||
2870 | 300 | <detectors> | ||
2871 | 301 | <include_in_detectors/> | ||
2872 | 302 | </detectors> | ||
2873 | 303 | <steady_state> | ||
2874 | 304 | <include_in_steady_state/> | ||
2875 | 305 | </steady_state> | ||
2876 | 306 | <consistent_interpolation/> | ||
2877 | 307 | </prognostic> | ||
2878 | 308 | </vector_field> | ||
2879 | 309 | <scalar_field name="Porosity" rank="0"> | ||
2880 | 310 | <prescribed> | ||
2881 | 311 | <mesh name="DGP0"/> | ||
2882 | 312 | <value name="WholeMesh"> | ||
2883 | 313 | <constant> | ||
2884 | 314 | <real_value rank="0">0.5</real_value> | ||
2885 | 315 | </constant> | ||
2886 | 316 | </value> | ||
2887 | 317 | <output/> | ||
2888 | 318 | <stat/> | ||
2889 | 319 | <detectors> | ||
2890 | 320 | <exclude_from_detectors/> | ||
2891 | 321 | </detectors> | ||
2892 | 322 | </prescribed> | ||
2893 | 323 | </scalar_field> | ||
2894 | 324 | <scalar_field name="Permeability" rank="0"> | ||
2895 | 325 | <prescribed> | ||
2896 | 326 | <mesh name="DGP0"/> | ||
2897 | 327 | <value name="WholeMesh"> | ||
2898 | 328 | <constant> | ||
2899 | 329 | <real_value rank="0">1.0e-10</real_value> | ||
2900 | 330 | </constant> | ||
2901 | 331 | </value> | ||
2902 | 332 | <output/> | ||
2903 | 333 | <stat/> | ||
2904 | 334 | <detectors> | ||
2905 | 335 | <exclude_from_detectors/> | ||
2906 | 336 | </detectors> | ||
2907 | 337 | </prescribed> | ||
2908 | 338 | </scalar_field> | ||
2909 | 339 | <scalar_field name="Viscosity" rank="0"> | ||
2910 | 340 | <prescribed> | ||
2911 | 341 | <mesh name="DGP0"/> | ||
2912 | 342 | <value name="WholeMesh"> | ||
2913 | 343 | <constant> | ||
2914 | 344 | <real_value rank="0">1.0e-04</real_value> | ||
2915 | 345 | </constant> | ||
2916 | 346 | </value> | ||
2917 | 347 | <output/> | ||
2918 | 348 | <stat/> | ||
2919 | 349 | <detectors> | ||
2920 | 350 | <exclude_from_detectors/> | ||
2921 | 351 | </detectors> | ||
2922 | 352 | </prescribed> | ||
2923 | 353 | </scalar_field> | ||
2924 | 354 | <vector_field name="interstitial_velocity" rank="1"> | ||
2925 | 355 | <diagnostic> | ||
2926 | 356 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
2927 | 357 | <string_value lines="20" type="python">phi = states["fluid"].scalar_fields["Porosity"] | ||
2928 | 358 | darcy_vel = states["fluid"].vector_fields["Velocity"] | ||
2929 | 359 | |||
2930 | 360 | for ele in range(field.element_count): | ||
2931 | 361 | phi_ele = phi.node_val(ele) | ||
2932 | 362 | |||
2933 | 363 | factor_ele = 1.0/max(phi_ele,1.0e-08) | ||
2934 | 364 | |||
2935 | 365 | vel_ele = [] | ||
2936 | 366 | for i in range(len(darcy_vel.ele_val(ele))): | ||
2937 | 367 | vel_ele.append(factor_ele*darcy_vel.ele_val(ele)[i]) | ||
2938 | 368 | |||
2939 | 369 | field.set(darcy_vel.ele_nodes(ele),vel_ele)</string_value> | ||
2940 | 370 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
2941 | 371 | |||
2942 | 372 | also assume that the velocity is dg</comment> | ||
2943 | 373 | </algorithm> | ||
2944 | 374 | <mesh name="VelocityMesh"/> | ||
2945 | 375 | <output/> | ||
2946 | 376 | <stat> | ||
2947 | 377 | <include_in_stat/> | ||
2948 | 378 | </stat> | ||
2949 | 379 | <convergence> | ||
2950 | 380 | <include_in_convergence/> | ||
2951 | 381 | </convergence> | ||
2952 | 382 | <detectors> | ||
2953 | 383 | <include_in_detectors/> | ||
2954 | 384 | </detectors> | ||
2955 | 385 | <steady_state> | ||
2956 | 386 | <include_in_steady_state/> | ||
2957 | 387 | </steady_state> | ||
2958 | 388 | </diagnostic> | ||
2959 | 389 | </vector_field> | ||
2960 | 390 | </material_phase> | ||
2961 | 391 | </fluidity_options> | ||
2962 | 0 | 392 | ||
2963 | === added file 'tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_2d.flml' | |||
2964 | --- tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_2d.flml 1970-01-01 00:00:00 +0000 | |||
2965 | +++ tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_2d.flml 2011-12-23 12:05:25 +0000 | |||
2966 | @@ -0,0 +1,407 @@ | |||
2967 | 1 | <?xml version='1.0' encoding='utf-8'?> | ||
2968 | 2 | <fluidity_options> | ||
2969 | 3 | <simulation_name> | ||
2970 | 4 | <string_value lines="1">darcy_p0p1_test_cty_cv_velBCinlet_2d</string_value> | ||
2971 | 5 | <comment>a simple short test case for darcy flow using the element type p0p1_test_cty_cv for velocity-pressure | ||
2972 | 6 | |||
2973 | 7 | the darcy velocity is solved for and the interstitial velocity is a diagnostic from this (assuming a dg solution) | ||
2974 | 8 | |||
2975 | 9 | it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct | ||
2976 | 10 | |||
2977 | 11 | the darcy flow equation is | ||
2978 | 12 | |||
2979 | 13 | sigma*darcy_vel = - grad P | ||
2980 | 14 | |||
2981 | 15 | sigma is a function of viscosity and permeability which are two input fields that are named in the flml - not on fluidity special names (ie. this doesnt use the porous media object options) | ||
2982 | 16 | |||
2983 | 17 | python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity | ||
2984 | 18 | |||
2985 | 19 | this case has a 1 region 1 material with velocity boundary condition inflow. | ||
2986 | 20 | |||
2987 | 21 | to get a darcy equation the time, stress and advection terms are not included in a bousinessq formulation (to avoid needing to specify a density). Ideally it would be better to actually have a darcy momentum option to simplify the input. | ||
2988 | 22 | |||
2989 | 23 | the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation) | ||
2990 | 24 | |||
2991 | 25 | the geometry is 2d (although this is a 1d problem) and one time step is done (as nothing depends on time)</comment> | ||
2992 | 26 | </simulation_name> | ||
2993 | 27 | <problem_type> | ||
2994 | 28 | <string_value lines="1">fluids</string_value> | ||
2995 | 29 | </problem_type> | ||
2996 | 30 | <geometry> | ||
2997 | 31 | <dimension> | ||
2998 | 32 | <integer_value rank="0">2</integer_value> | ||
2999 | 33 | </dimension> | ||
3000 | 34 | <mesh name="CoordinateMesh"> | ||
3001 | 35 | <from_file file_name="square"> | ||
3002 | 36 | <format name="gmsh"/> | ||
3003 | 37 | <stat> | ||
3004 | 38 | <include_in_stat/> | ||
3005 | 39 | </stat> | ||
3006 | 40 | </from_file> | ||
3007 | 41 | </mesh> | ||
3008 | 42 | <mesh name="VelocityMesh"> | ||
3009 | 43 | <from_mesh> | ||
3010 | 44 | <mesh name="CoordinateMesh"/> | ||
3011 | 45 | <mesh_shape> | ||
3012 | 46 | <polynomial_degree> | ||
3013 | 47 | <integer_value rank="0">0</integer_value> | ||
3014 | 48 | </polynomial_degree> | ||
3015 | 49 | </mesh_shape> | ||
3016 | 50 | <mesh_continuity> | ||
3017 | 51 | <string_value>discontinuous</string_value> | ||
3018 | 52 | </mesh_continuity> | ||
3019 | 53 | <stat> | ||
3020 | 54 | <exclude_from_stat/> | ||
3021 | 55 | </stat> | ||
3022 | 56 | </from_mesh> | ||
3023 | 57 | </mesh> | ||
3024 | 58 | <mesh name="PressureMesh"> | ||
3025 | 59 | <from_mesh> | ||
3026 | 60 | <mesh name="CoordinateMesh"/> | ||
3027 | 61 | <mesh_shape> | ||
3028 | 62 | <polynomial_degree> | ||
3029 | 63 | <integer_value rank="0">1</integer_value> | ||
3030 | 64 | </polynomial_degree> | ||
3031 | 65 | </mesh_shape> | ||
3032 | 66 | <stat> | ||
3033 | 67 | <exclude_from_stat/> | ||
3034 | 68 | </stat> | ||
3035 | 69 | </from_mesh> | ||
3036 | 70 | </mesh> | ||
3037 | 71 | <mesh name="DGP0"> | ||
3038 | 72 | <from_mesh> | ||
3039 | 73 | <mesh name="CoordinateMesh"/> | ||
3040 | 74 | <mesh_shape> | ||
3041 | 75 | <polynomial_degree> | ||
3042 | 76 | <integer_value rank="0">0</integer_value> | ||
3043 | 77 | </polynomial_degree> | ||
3044 | 78 | </mesh_shape> | ||
3045 | 79 | <mesh_continuity> | ||
3046 | 80 | <string_value>discontinuous</string_value> | ||
3047 | 81 | </mesh_continuity> | ||
3048 | 82 | <stat> | ||
3049 | 83 | <exclude_from_stat/> | ||
3050 | 84 | </stat> | ||
3051 | 85 | </from_mesh> | ||
3052 | 86 | </mesh> | ||
3053 | 87 | <mesh name="OutputMesh"> | ||
3054 | 88 | <from_mesh> | ||
3055 | 89 | <mesh name="CoordinateMesh"/> | ||
3056 | 90 | <mesh_continuity> | ||
3057 | 91 | <string_value>discontinuous</string_value> | ||
3058 | 92 | </mesh_continuity> | ||
3059 | 93 | <stat> | ||
3060 | 94 | <exclude_from_stat/> | ||
3061 | 95 | </stat> | ||
3062 | 96 | </from_mesh> | ||
3063 | 97 | </mesh> | ||
3064 | 98 | <quadrature> | ||
3065 | 99 | <degree> | ||
3066 | 100 | <integer_value rank="0">2</integer_value> | ||
3067 | 101 | </degree> | ||
3068 | 102 | </quadrature> | ||
3069 | 103 | </geometry> | ||
3070 | 104 | <io> | ||
3071 | 105 | <dump_format> | ||
3072 | 106 | <string_value>vtk</string_value> | ||
3073 | 107 | </dump_format> | ||
3074 | 108 | <dump_period_in_timesteps> | ||
3075 | 109 | <constant> | ||
3076 | 110 | <integer_value rank="0">0</integer_value> | ||
3077 | 111 | </constant> | ||
3078 | 112 | </dump_period_in_timesteps> | ||
3079 | 113 | <output_mesh name="OutputMesh"/> | ||
3080 | 114 | <stat/> | ||
3081 | 115 | </io> | ||
3082 | 116 | <timestepping> | ||
3083 | 117 | <current_time> | ||
3084 | 118 | <real_value rank="0">0.0</real_value> | ||
3085 | 119 | </current_time> | ||
3086 | 120 | <timestep> | ||
3087 | 121 | <real_value rank="0">1.0</real_value> | ||
3088 | 122 | </timestep> | ||
3089 | 123 | <finish_time> | ||
3090 | 124 | <real_value rank="0">1.0</real_value> | ||
3091 | 125 | </finish_time> | ||
3092 | 126 | </timestepping> | ||
3093 | 127 | <material_phase name="fluid"> | ||
3094 | 128 | <scalar_field name="Pressure" rank="0"> | ||
3095 | 129 | <prognostic> | ||
3096 | 130 | <mesh name="PressureMesh"/> | ||
3097 | 131 | <spatial_discretisation> | ||
3098 | 132 | <continuous_galerkin> | ||
3099 | 133 | <test_continuity_with_cv_dual/> | ||
3100 | 134 | </continuous_galerkin> | ||
3101 | 135 | </spatial_discretisation> | ||
3102 | 136 | <scheme> | ||
3103 | 137 | <poisson_pressure_solution> | ||
3104 | 138 | <string_value lines="1">never</string_value> | ||
3105 | 139 | </poisson_pressure_solution> | ||
3106 | 140 | <use_projection_method/> | ||
3107 | 141 | </scheme> | ||
3108 | 142 | <solver> | ||
3109 | 143 | <iterative_method name="cg"/> | ||
3110 | 144 | <preconditioner name="sor"/> | ||
3111 | 145 | <relative_error> | ||
3112 | 146 | <real_value rank="0">1.0e-10</real_value> | ||
3113 | 147 | </relative_error> | ||
3114 | 148 | <max_iterations> | ||
3115 | 149 | <integer_value rank="0">1000</integer_value> | ||
3116 | 150 | </max_iterations> | ||
3117 | 151 | <never_ignore_solver_failures/> | ||
3118 | 152 | <diagnostics> | ||
3119 | 153 | <monitors/> | ||
3120 | 154 | </diagnostics> | ||
3121 | 155 | </solver> | ||
3122 | 156 | <boundary_conditions name="right_outflow"> | ||
3123 | 157 | <surface_ids> | ||
3124 | 158 | <integer_value shape="1" rank="1">8</integer_value> | ||
3125 | 159 | </surface_ids> | ||
3126 | 160 | <type name="dirichlet"> | ||
3127 | 161 | <apply_weakly/> | ||
3128 | 162 | <constant> | ||
3129 | 163 | <real_value rank="0">0.0</real_value> | ||
3130 | 164 | </constant> | ||
3131 | 165 | </type> | ||
3132 | 166 | </boundary_conditions> | ||
3133 | 167 | <output/> | ||
3134 | 168 | <stat/> | ||
3135 | 169 | <convergence> | ||
3136 | 170 | <include_in_convergence/> | ||
3137 | 171 | </convergence> | ||
3138 | 172 | <detectors> | ||
3139 | 173 | <exclude_from_detectors/> | ||
3140 | 174 | </detectors> | ||
3141 | 175 | <steady_state> | ||
3142 | 176 | <include_in_steady_state/> | ||
3143 | 177 | </steady_state> | ||
3144 | 178 | <no_interpolation/> | ||
3145 | 179 | </prognostic> | ||
3146 | 180 | </scalar_field> | ||
3147 | 181 | <vector_field name="Velocity" rank="1"> | ||
3148 | 182 | <prognostic> | ||
3149 | 183 | <mesh name="VelocityMesh"/> | ||
3150 | 184 | <equation name="Boussinesq"/> | ||
3151 | 185 | <spatial_discretisation> | ||
3152 | 186 | <discontinuous_galerkin> | ||
3153 | 187 | <mass_terms> | ||
3154 | 188 | <exclude_mass_terms/> | ||
3155 | 189 | </mass_terms> | ||
3156 | 190 | <viscosity_scheme> | ||
3157 | 191 | <compact_discontinuous_galerkin/> | ||
3158 | 192 | </viscosity_scheme> | ||
3159 | 193 | <advection_scheme> | ||
3160 | 194 | <none/> | ||
3161 | 195 | <integrate_advection_by_parts> | ||
3162 | 196 | <twice/> | ||
3163 | 197 | </integrate_advection_by_parts> | ||
3164 | 198 | </advection_scheme> | ||
3165 | 199 | </discontinuous_galerkin> | ||
3166 | 200 | <conservative_advection> | ||
3167 | 201 | <real_value rank="0">0.0</real_value> | ||
3168 | 202 | </conservative_advection> | ||
3169 | 203 | </spatial_discretisation> | ||
3170 | 204 | <temporal_discretisation> | ||
3171 | 205 | <theta> | ||
3172 | 206 | <real_value rank="0">1.0</real_value> | ||
3173 | 207 | </theta> | ||
3174 | 208 | <relaxation> | ||
3175 | 209 | <real_value rank="0">1.0</real_value> | ||
3176 | 210 | </relaxation> | ||
3177 | 211 | </temporal_discretisation> | ||
3178 | 212 | <solver> | ||
3179 | 213 | <iterative_method name="gmres"> | ||
3180 | 214 | <restart> | ||
3181 | 215 | <integer_value rank="0">30</integer_value> | ||
3182 | 216 | </restart> | ||
3183 | 217 | </iterative_method> | ||
3184 | 218 | <preconditioner name="sor"/> | ||
3185 | 219 | <relative_error> | ||
3186 | 220 | <real_value rank="0">1.0e-10</real_value> | ||
3187 | 221 | </relative_error> | ||
3188 | 222 | <max_iterations> | ||
3189 | 223 | <integer_value rank="0">1000</integer_value> | ||
3190 | 224 | </max_iterations> | ||
3191 | 225 | <never_ignore_solver_failures/> | ||
3192 | 226 | <diagnostics> | ||
3193 | 227 | <monitors/> | ||
3194 | 228 | </diagnostics> | ||
3195 | 229 | </solver> | ||
3196 | 230 | <initial_condition name="WholeMesh"> | ||
3197 | 231 | <constant> | ||
3198 | 232 | <real_value shape="2" dim1="dim" rank="1">0.0 0.0</real_value> | ||
3199 | 233 | </constant> | ||
3200 | 234 | </initial_condition> | ||
3201 | 235 | <boundary_conditions name="left_inflow"> | ||
3202 | 236 | <surface_ids> | ||
3203 | 237 | <integer_value shape="1" rank="1">10</integer_value> | ||
3204 | 238 | </surface_ids> | ||
3205 | 239 | <type name="dirichlet"> | ||
3206 | 240 | <apply_weakly/> | ||
3207 | 241 | <align_bc_with_cartesian> | ||
3208 | 242 | <x_component> | ||
3209 | 243 | <constant> | ||
3210 | 244 | <real_value rank="0">5.0</real_value> | ||
3211 | 245 | </constant> | ||
3212 | 246 | </x_component> | ||
3213 | 247 | </align_bc_with_cartesian> | ||
3214 | 248 | </type> | ||
3215 | 249 | </boundary_conditions> | ||
3216 | 250 | <boundary_conditions name="no_outflow_top_bottom"> | ||
3217 | 251 | <surface_ids> | ||
3218 | 252 | <integer_value shape="2" rank="1">7 9</integer_value> | ||
3219 | 253 | </surface_ids> | ||
3220 | 254 | <type name="dirichlet"> | ||
3221 | 255 | <apply_weakly/> | ||
3222 | 256 | <align_bc_with_cartesian> | ||
3223 | 257 | <y_component> | ||
3224 | 258 | <constant> | ||
3225 | 259 | <real_value rank="0">0.0</real_value> | ||
3226 | 260 | </constant> | ||
3227 | 261 | </y_component> | ||
3228 | 262 | </align_bc_with_cartesian> | ||
3229 | 263 | </type> | ||
3230 | 264 | </boundary_conditions> | ||
3231 | 265 | <vector_field name="Absorption" rank="1"> | ||
3232 | 266 | <diagnostic> | ||
3233 | 267 | <mesh name="DGP0"/> | ||
3234 | 268 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
3235 | 269 | <string_value lines="20" type="python"># get the prescribed fields | ||
3236 | 270 | perm = states["fluid"].scalar_fields["Permeability"] | ||
3237 | 271 | visc = states["fluid"].scalar_fields["Viscosity"] | ||
3238 | 272 | |||
3239 | 273 | # loop the DMmesh_p0 nodes (which are element centred) | ||
3240 | 274 | for n in range(field.node_count): | ||
3241 | 275 | perm_n = perm.node_val(n) | ||
3242 | 276 | visc_n = visc.node_val(n) | ||
3243 | 277 | |||
3244 | 278 | # calc the absorption term | ||
3245 | 279 | sigma_n = visc_n/perm_n | ||
3246 | 280 | |||
3247 | 281 | # set the absorption term | ||
3248 | 282 | field.set(n,sigma_n)</string_value> | ||
3249 | 283 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
3250 | 284 | |||
3251 | 285 | also assume that the velocity is dg</comment> | ||
3252 | 286 | </algorithm> | ||
3253 | 287 | <output/> | ||
3254 | 288 | <stat> | ||
3255 | 289 | <include_in_stat/> | ||
3256 | 290 | </stat> | ||
3257 | 291 | <convergence> | ||
3258 | 292 | <include_in_convergence/> | ||
3259 | 293 | </convergence> | ||
3260 | 294 | <detectors> | ||
3261 | 295 | <include_in_detectors/> | ||
3262 | 296 | </detectors> | ||
3263 | 297 | <steady_state> | ||
3264 | 298 | <include_in_steady_state/> | ||
3265 | 299 | </steady_state> | ||
3266 | 300 | </diagnostic> | ||
3267 | 301 | <include_pressure_correction/> | ||
3268 | 302 | </vector_field> | ||
3269 | 303 | <output/> | ||
3270 | 304 | <stat> | ||
3271 | 305 | <include_in_stat/> | ||
3272 | 306 | <previous_time_step> | ||
3273 | 307 | <exclude_from_stat/> | ||
3274 | 308 | </previous_time_step> | ||
3275 | 309 | <nonlinear_field> | ||
3276 | 310 | <exclude_from_stat/> | ||
3277 | 311 | </nonlinear_field> | ||
3278 | 312 | </stat> | ||
3279 | 313 | <convergence> | ||
3280 | 314 | <include_in_convergence/> | ||
3281 | 315 | </convergence> | ||
3282 | 316 | <detectors> | ||
3283 | 317 | <include_in_detectors/> | ||
3284 | 318 | </detectors> | ||
3285 | 319 | <steady_state> | ||
3286 | 320 | <include_in_steady_state/> | ||
3287 | 321 | </steady_state> | ||
3288 | 322 | <consistent_interpolation/> | ||
3289 | 323 | </prognostic> | ||
3290 | 324 | </vector_field> | ||
3291 | 325 | <scalar_field name="Porosity" rank="0"> | ||
3292 | 326 | <prescribed> | ||
3293 | 327 | <mesh name="DGP0"/> | ||
3294 | 328 | <value name="WholeMesh"> | ||
3295 | 329 | <constant> | ||
3296 | 330 | <real_value rank="0">0.5</real_value> | ||
3297 | 331 | </constant> | ||
3298 | 332 | </value> | ||
3299 | 333 | <output/> | ||
3300 | 334 | <stat/> | ||
3301 | 335 | <detectors> | ||
3302 | 336 | <exclude_from_detectors/> | ||
3303 | 337 | </detectors> | ||
3304 | 338 | </prescribed> | ||
3305 | 339 | </scalar_field> | ||
3306 | 340 | <scalar_field name="Permeability" rank="0"> | ||
3307 | 341 | <prescribed> | ||
3308 | 342 | <mesh name="DGP0"/> | ||
3309 | 343 | <value name="WholeMesh"> | ||
3310 | 344 | <constant> | ||
3311 | 345 | <real_value rank="0">1.0e-10</real_value> | ||
3312 | 346 | </constant> | ||
3313 | 347 | </value> | ||
3314 | 348 | <output/> | ||
3315 | 349 | <stat/> | ||
3316 | 350 | <detectors> | ||
3317 | 351 | <exclude_from_detectors/> | ||
3318 | 352 | </detectors> | ||
3319 | 353 | </prescribed> | ||
3320 | 354 | </scalar_field> | ||
3321 | 355 | <scalar_field name="Viscosity" rank="0"> | ||
3322 | 356 | <prescribed> | ||
3323 | 357 | <mesh name="DGP0"/> | ||
3324 | 358 | <value name="WholeMesh"> | ||
3325 | 359 | <constant> | ||
3326 | 360 | <real_value rank="0">1.0e-04</real_value> | ||
3327 | 361 | </constant> | ||
3328 | 362 | </value> | ||
3329 | 363 | <output/> | ||
3330 | 364 | <stat/> | ||
3331 | 365 | <detectors> | ||
3332 | 366 | <exclude_from_detectors/> | ||
3333 | 367 | </detectors> | ||
3334 | 368 | </prescribed> | ||
3335 | 369 | </scalar_field> | ||
3336 | 370 | <vector_field name="interstitial_velocity" rank="1"> | ||
3337 | 371 | <diagnostic> | ||
3338 | 372 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
3339 | 373 | <string_value lines="20" type="python">phi = states["fluid"].scalar_fields["Porosity"] | ||
3340 | 374 | darcy_vel = states["fluid"].vector_fields["Velocity"] | ||
3341 | 375 | |||
3342 | 376 | for ele in range(field.element_count): | ||
3343 | 377 | phi_ele = phi.node_val(ele) | ||
3344 | 378 | |||
3345 | 379 | factor_ele = 1.0/max(phi_ele,1.0e-08) | ||
3346 | 380 | |||
3347 | 381 | vel_ele = [] | ||
3348 | 382 | for i in range(len(darcy_vel.ele_val(ele))): | ||
3349 | 383 | vel_ele.append(factor_ele*darcy_vel.ele_val(ele)[i]) | ||
3350 | 384 | |||
3351 | 385 | field.set(darcy_vel.ele_nodes(ele),vel_ele)</string_value> | ||
3352 | 386 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
3353 | 387 | |||
3354 | 388 | also assume that the velocity is dg</comment> | ||
3355 | 389 | </algorithm> | ||
3356 | 390 | <mesh name="VelocityMesh"/> | ||
3357 | 391 | <output/> | ||
3358 | 392 | <stat> | ||
3359 | 393 | <include_in_stat/> | ||
3360 | 394 | </stat> | ||
3361 | 395 | <convergence> | ||
3362 | 396 | <include_in_convergence/> | ||
3363 | 397 | </convergence> | ||
3364 | 398 | <detectors> | ||
3365 | 399 | <include_in_detectors/> | ||
3366 | 400 | </detectors> | ||
3367 | 401 | <steady_state> | ||
3368 | 402 | <include_in_steady_state/> | ||
3369 | 403 | </steady_state> | ||
3370 | 404 | </diagnostic> | ||
3371 | 405 | </vector_field> | ||
3372 | 406 | </material_phase> | ||
3373 | 407 | </fluidity_options> | ||
3374 | 0 | 408 | ||
3375 | === added file 'tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_3d.flml' | |||
3376 | --- tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_3d.flml 1970-01-01 00:00:00 +0000 | |||
3377 | +++ tests/darcy_p0p1_test_cty_cv_velBCinlet/darcy_p0p1_test_cty_cv_velBCinlet_3d.flml 2011-12-23 12:05:25 +0000 | |||
3378 | @@ -0,0 +1,404 @@ | |||
3379 | 1 | <?xml version='1.0' encoding='utf-8'?> | ||
3380 | 2 | <fluidity_options> | ||
3381 | 3 | <simulation_name> | ||
3382 | 4 | <string_value lines="1">darcy_p0p1_test_cty_cv_velBCinlet_3d</string_value> | ||
3383 | 5 | <comment>a simple short test case for darcy flow using the element type p0p1_test_cty_cv for velocity-pressure | ||
3384 | 6 | |||
3385 | 7 | the darcy velocity is solved for and the interstitial velocity is a diagnostic from this (assuming a dg solution) | ||
3386 | 8 | |||
3387 | 9 | it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct | ||
3388 | 10 | |||
3389 | 11 | the darcy flow equation is | ||
3390 | 12 | |||
3391 | 13 | sigma*darcy_vel = - grad P | ||
3392 | 14 | |||
3393 | 15 | sigma is a function of viscosity and permeability which are two input fields that are named in the flml - not on fluidity special names (ie. this doesnt use the porous media object options) | ||
3394 | 16 | |||
3395 | 17 | python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity | ||
3396 | 18 | |||
3397 | 19 | this case has a 1 region 1 material with velocity boundary condition inflow. | ||
3398 | 20 | |||
3399 | 21 | to get a darcy equation the time, stress and advection terms are not included in a bousinessq formulation (to avoid needing to specify a density). Ideally it would be better to actually have a darcy momentum option to simplify the input. | ||
3400 | 22 | |||
3401 | 23 | the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation) | ||
3402 | 24 | |||
3403 | 25 | the geometry is 3d (although this is a 1d problem) and one time step is done (as nothing depends on time)</comment> | ||
3404 | 26 | </simulation_name> | ||
3405 | 27 | <problem_type> | ||
3406 | 28 | <string_value lines="1">fluids</string_value> | ||
3407 | 29 | </problem_type> | ||
3408 | 30 | <geometry> | ||
3409 | 31 | <dimension> | ||
3410 | 32 | <integer_value rank="0">3</integer_value> | ||
3411 | 33 | </dimension> | ||
3412 | 34 | <mesh name="CoordinateMesh"> | ||
3413 | 35 | <from_file file_name="cube"> | ||
3414 | 36 | <format name="gmsh"/> | ||
3415 | 37 | <stat> | ||
3416 | 38 | <include_in_stat/> | ||
3417 | 39 | </stat> | ||
3418 | 40 | </from_file> | ||
3419 | 41 | </mesh> | ||
3420 | 42 | <mesh name="VelocityMesh"> | ||
3421 | 43 | <from_mesh> | ||
3422 | 44 | <mesh name="CoordinateMesh"/> | ||
3423 | 45 | <mesh_shape> | ||
3424 | 46 | <polynomial_degree> | ||
3425 | 47 | <integer_value rank="0">0</integer_value> | ||
3426 | 48 | </polynomial_degree> | ||
3427 | 49 | </mesh_shape> | ||
3428 | 50 | <mesh_continuity> | ||
3429 | 51 | <string_value>discontinuous</string_value> | ||
3430 | 52 | </mesh_continuity> | ||
3431 | 53 | <stat> | ||
3432 | 54 | <exclude_from_stat/> | ||
3433 | 55 | </stat> | ||
3434 | 56 | </from_mesh> | ||
3435 | 57 | </mesh> | ||
3436 | 58 | <mesh name="PressureMesh"> | ||
3437 | 59 | <from_mesh> | ||
3438 | 60 | <mesh name="CoordinateMesh"/> | ||
3439 | 61 | <mesh_shape> | ||
3440 | 62 | <polynomial_degree> | ||
3441 | 63 | <integer_value rank="0">1</integer_value> | ||
3442 | 64 | </polynomial_degree> | ||
3443 | 65 | </mesh_shape> | ||
3444 | 66 | <stat> | ||
3445 | 67 | <exclude_from_stat/> | ||
3446 | 68 | </stat> | ||
3447 | 69 | </from_mesh> | ||
3448 | 70 | </mesh> | ||
3449 | 71 | <mesh name="DGP0"> | ||
3450 | 72 | <from_mesh> | ||
3451 | 73 | <mesh name="CoordinateMesh"/> | ||
3452 | 74 | <mesh_shape> | ||
3453 | 75 | <polynomial_degree> | ||
3454 | 76 | <integer_value rank="0">0</integer_value> | ||
3455 | 77 | </polynomial_degree> | ||
3456 | 78 | </mesh_shape> | ||
3457 | 79 | <mesh_continuity> | ||
3458 | 80 | <string_value>discontinuous</string_value> | ||
3459 | 81 | </mesh_continuity> | ||
3460 | 82 | <stat> | ||
3461 | 83 | <exclude_from_stat/> | ||
3462 | 84 | </stat> | ||
3463 | 85 | </from_mesh> | ||
3464 | 86 | </mesh> | ||
3465 | 87 | <mesh name="OutputMesh"> | ||
3466 | 88 | <from_mesh> | ||
3467 | 89 | <mesh name="CoordinateMesh"/> | ||
3468 | 90 | <mesh_continuity> | ||
3469 | 91 | <string_value>discontinuous</string_value> | ||
3470 | 92 | </mesh_continuity> | ||
3471 | 93 | <stat> | ||
3472 | 94 | <exclude_from_stat/> | ||
3473 | 95 | </stat> | ||
3474 | 96 | </from_mesh> | ||
3475 | 97 | </mesh> | ||
3476 | 98 | <quadrature> | ||
3477 | 99 | <degree> | ||
3478 | 100 | <integer_value rank="0">2</integer_value> | ||
3479 | 101 | </degree> | ||
3480 | 102 | </quadrature> | ||
3481 | 103 | </geometry> | ||
3482 | 104 | <io> | ||
3483 | 105 | <dump_format> | ||
3484 | 106 | <string_value>vtk</string_value> | ||
3485 | 107 | </dump_format> | ||
3486 | 108 | <dump_period_in_timesteps> | ||
3487 | 109 | <constant> | ||
3488 | 110 | <integer_value rank="0">0</integer_value> | ||
3489 | 111 | </constant> | ||
3490 | 112 | </dump_period_in_timesteps> | ||
3491 | 113 | <output_mesh name="OutputMesh"/> | ||
3492 | 114 | <stat/> | ||
3493 | 115 | </io> | ||
3494 | 116 | <timestepping> | ||
3495 | 117 | <current_time> | ||
3496 | 118 | <real_value rank="0">0.0</real_value> | ||
3497 | 119 | </current_time> | ||
3498 | 120 | <timestep> | ||
3499 | 121 | <real_value rank="0">1.0</real_value> | ||
3500 | 122 | </timestep> | ||
3501 | 123 | <finish_time> | ||
3502 | 124 | <real_value rank="0">1.0</real_value> | ||
3503 | 125 | </finish_time> | ||
3504 | 126 | </timestepping> | ||
3505 | 127 | <material_phase name="fluid"> | ||
3506 | 128 | <scalar_field name="Pressure" rank="0"> | ||
3507 | 129 | <prognostic> | ||
3508 | 130 | <mesh name="PressureMesh"/> | ||
3509 | 131 | <spatial_discretisation> | ||
3510 | 132 | <continuous_galerkin> | ||
3511 | 133 | <test_continuity_with_cv_dual/> | ||
3512 | 134 | </continuous_galerkin> | ||
3513 | 135 | </spatial_discretisation> | ||
3514 | 136 | <scheme> | ||
3515 | 137 | <poisson_pressure_solution> | ||
3516 | 138 | <string_value lines="1">never</string_value> | ||
3517 | 139 | </poisson_pressure_solution> | ||
3518 | 140 | <use_projection_method/> | ||
3519 | 141 | </scheme> | ||
3520 | 142 | <solver> | ||
3521 | 143 | <iterative_method name="cg"/> | ||
3522 | 144 | <preconditioner name="sor"/> | ||
3523 | 145 | <relative_error> | ||
3524 | 146 | <real_value rank="0">1.0e-10</real_value> | ||
3525 | 147 | </relative_error> | ||
3526 | 148 | <max_iterations> | ||
3527 | 149 | <integer_value rank="0">1000</integer_value> | ||
3528 | 150 | </max_iterations> | ||
3529 | 151 | <never_ignore_solver_failures/> | ||
3530 | 152 | <diagnostics> | ||
3531 | 153 | <monitors/> | ||
3532 | 154 | </diagnostics> | ||
3533 | 155 | </solver> | ||
3534 | 156 | <boundary_conditions name="right_outflow"> | ||
3535 | 157 | <surface_ids> | ||
3536 | 158 | <integer_value shape="1" rank="1">4</integer_value> | ||
3537 | 159 | </surface_ids> | ||
3538 | 160 | <type name="dirichlet"> | ||
3539 | 161 | <apply_weakly/> | ||
3540 | 162 | <constant> | ||
3541 | 163 | <real_value rank="0">0.0</real_value> | ||
3542 | 164 | </constant> | ||
3543 | 165 | </type> | ||
3544 | 166 | </boundary_conditions> | ||
3545 | 167 | <output/> | ||
3546 | 168 | <stat/> | ||
3547 | 169 | <convergence> | ||
3548 | 170 | <include_in_convergence/> | ||
3549 | 171 | </convergence> | ||
3550 | 172 | <detectors> | ||
3551 | 173 | <exclude_from_detectors/> | ||
3552 | 174 | </detectors> | ||
3553 | 175 | <steady_state> | ||
3554 | 176 | <include_in_steady_state/> | ||
3555 | 177 | </steady_state> | ||
3556 | 178 | <no_interpolation/> | ||
3557 | 179 | </prognostic> | ||
3558 | 180 | </scalar_field> | ||
3559 | 181 | <vector_field name="Velocity" rank="1"> | ||
3560 | 182 | <prognostic> | ||
3561 | 183 | <mesh name="VelocityMesh"/> | ||
3562 | 184 | <equation name="Boussinesq"/> | ||
3563 | 185 | <spatial_discretisation> | ||
3564 | 186 | <discontinuous_galerkin> | ||
3565 | 187 | <mass_terms> | ||
3566 | 188 | <exclude_mass_terms/> | ||
3567 | 189 | </mass_terms> | ||
3568 | 190 | <viscosity_scheme> | ||
3569 | 191 | <compact_discontinuous_galerkin/> | ||
3570 | 192 | </viscosity_scheme> | ||
3571 | 193 | <advection_scheme> | ||
3572 | 194 | <none/> | ||
3573 | 195 | <integrate_advection_by_parts> | ||
3574 | 196 | <twice/> | ||
3575 | 197 | </integrate_advection_by_parts> | ||
3576 | 198 | </advection_scheme> | ||
3577 | 199 | </discontinuous_galerkin> | ||
3578 | 200 | <conservative_advection> | ||
3579 | 201 | <real_value rank="0">0.0</real_value> | ||
3580 | 202 | </conservative_advection> | ||
3581 | 203 | </spatial_discretisation> | ||
3582 | 204 | <temporal_discretisation> | ||
3583 | 205 | <theta> | ||
3584 | 206 | <real_value rank="0">1.0</real_value> | ||
3585 | 207 | </theta> | ||
3586 | 208 | <relaxation> | ||
3587 | 209 | <real_value rank="0">1.0</real_value> | ||
3588 | 210 | </relaxation> | ||
3589 | 211 | </temporal_discretisation> | ||
3590 | 212 | <solver> | ||
3591 | 213 | <iterative_method name="gmres"> | ||
3592 | 214 | <restart> | ||
3593 | 215 | <integer_value rank="0">30</integer_value> | ||
3594 | 216 | </restart> | ||
3595 | 217 | </iterative_method> | ||
3596 | 218 | <preconditioner name="sor"/> | ||
3597 | 219 | <relative_error> | ||
3598 | 220 | <real_value rank="0">1.0e-10</real_value> | ||
3599 | 221 | </relative_error> | ||
3600 | 222 | <max_iterations> | ||
3601 | 223 | <integer_value rank="0">1000</integer_value> | ||
3602 | 224 | </max_iterations> | ||
3603 | 225 | <never_ignore_solver_failures/> | ||
3604 | 226 | <diagnostics> | ||
3605 | 227 | <monitors/> | ||
3606 | 228 | </diagnostics> | ||
3607 | 229 | </solver> | ||
3608 | 230 | <initial_condition name="WholeMesh"> | ||
3609 | 231 | <constant> | ||
3610 | 232 | <real_value shape="3" dim1="dim" rank="1">0.0 0.0 0.0</real_value> | ||
3611 | 233 | </constant> | ||
3612 | 234 | </initial_condition> | ||
3613 | 235 | <boundary_conditions name="left_inflow"> | ||
3614 | 236 | <surface_ids> | ||
3615 | 237 | <integer_value shape="1" rank="1">3</integer_value> | ||
3616 | 238 | </surface_ids> | ||
3617 | 239 | <type name="dirichlet"> | ||
3618 | 240 | <apply_weakly/> | ||
3619 | 241 | <align_bc_with_cartesian> | ||
3620 | 242 | <x_component> | ||
3621 | 243 | <constant> | ||
3622 | 244 | <real_value rank="0">5.0</real_value> | ||
3623 | 245 | </constant> | ||
3624 | 246 | </x_component> | ||
3625 | 247 | </align_bc_with_cartesian> | ||
3626 | 248 | </type> | ||
3627 | 249 | </boundary_conditions> | ||
3628 | 250 | <boundary_conditions name="no_outflow_top_bottom"> | ||
3629 | 251 | <surface_ids> | ||
3630 | 252 | <integer_value shape="2" rank="1">1 2</integer_value> | ||
3631 | 253 | </surface_ids> | ||
3632 | 254 | <type name="no_normal_flow"/> | ||
3633 | 255 | </boundary_conditions> | ||
3634 | 256 | <boundary_conditions name="no_outflow_front_back"> | ||
3635 | 257 | <surface_ids> | ||
3636 | 258 | <integer_value shape="2" rank="1">5 6</integer_value> | ||
3637 | 259 | </surface_ids> | ||
3638 | 260 | <type name="no_normal_flow"/> | ||
3639 | 261 | </boundary_conditions> | ||
3640 | 262 | <vector_field name="Absorption" rank="1"> | ||
3641 | 263 | <diagnostic> | ||
3642 | 264 | <mesh name="DGP0"/> | ||
3643 | 265 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
3644 | 266 | <string_value lines="20" type="python"># get the prescribed fields | ||
3645 | 267 | perm = states["fluid"].scalar_fields["Permeability"] | ||
3646 | 268 | visc = states["fluid"].scalar_fields["Viscosity"] | ||
3647 | 269 | |||
3648 | 270 | # loop the DMmesh_p0 nodes (which are element centred) | ||
3649 | 271 | for n in range(field.node_count): | ||
3650 | 272 | perm_n = perm.node_val(n) | ||
3651 | 273 | visc_n = visc.node_val(n) | ||
3652 | 274 | |||
3653 | 275 | # calc the absorption term | ||
3654 | 276 | sigma_n = visc_n/perm_n | ||
3655 | 277 | |||
3656 | 278 | # set the absorption term | ||
3657 | 279 | field.set(n,sigma_n)</string_value> | ||
3658 | 280 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
3659 | 281 | |||
3660 | 282 | also assume that the velocity is dg</comment> | ||
3661 | 283 | </algorithm> | ||
3662 | 284 | <output/> | ||
3663 | 285 | <stat> | ||
3664 | 286 | <include_in_stat/> | ||
3665 | 287 | </stat> | ||
3666 | 288 | <convergence> | ||
3667 | 289 | <include_in_convergence/> | ||
3668 | 290 | </convergence> | ||
3669 | 291 | <detectors> | ||
3670 | 292 | <include_in_detectors/> | ||
3671 | 293 | </detectors> | ||
3672 | 294 | <steady_state> | ||
3673 | 295 | <include_in_steady_state/> | ||
3674 | 296 | </steady_state> | ||
3675 | 297 | </diagnostic> | ||
3676 | 298 | <include_pressure_correction/> | ||
3677 | 299 | </vector_field> | ||
3678 | 300 | <output/> | ||
3679 | 301 | <stat> | ||
3680 | 302 | <include_in_stat/> | ||
3681 | 303 | <previous_time_step> | ||
3682 | 304 | <exclude_from_stat/> | ||
3683 | 305 | </previous_time_step> | ||
3684 | 306 | <nonlinear_field> | ||
3685 | 307 | <exclude_from_stat/> | ||
3686 | 308 | </nonlinear_field> | ||
3687 | 309 | </stat> | ||
3688 | 310 | <convergence> | ||
3689 | 311 | <include_in_convergence/> | ||
3690 | 312 | </convergence> | ||
3691 | 313 | <detectors> | ||
3692 | 314 | <include_in_detectors/> | ||
3693 | 315 | </detectors> | ||
3694 | 316 | <steady_state> | ||
3695 | 317 | <include_in_steady_state/> | ||
3696 | 318 | </steady_state> | ||
3697 | 319 | <consistent_interpolation/> | ||
3698 | 320 | </prognostic> | ||
3699 | 321 | </vector_field> | ||
3700 | 322 | <scalar_field name="Porosity" rank="0"> | ||
3701 | 323 | <prescribed> | ||
3702 | 324 | <mesh name="DGP0"/> | ||
3703 | 325 | <value name="WholeMesh"> | ||
3704 | 326 | <constant> | ||
3705 | 327 | <real_value rank="0">0.5</real_value> | ||
3706 | 328 | </constant> | ||
3707 | 329 | </value> | ||
3708 | 330 | <output/> | ||
3709 | 331 | <stat/> | ||
3710 | 332 | <detectors> | ||
3711 | 333 | <exclude_from_detectors/> | ||
3712 | 334 | </detectors> | ||
3713 | 335 | </prescribed> | ||
3714 | 336 | </scalar_field> | ||
3715 | 337 | <scalar_field name="Permeability" rank="0"> | ||
3716 | 338 | <prescribed> | ||
3717 | 339 | <mesh name="DGP0"/> | ||
3718 | 340 | <value name="WholeMesh"> | ||
3719 | 341 | <constant> | ||
3720 | 342 | <real_value rank="0">1.0e-10</real_value> | ||
3721 | 343 | </constant> | ||
3722 | 344 | </value> | ||
3723 | 345 | <output/> | ||
3724 | 346 | <stat/> | ||
3725 | 347 | <detectors> | ||
3726 | 348 | <exclude_from_detectors/> | ||
3727 | 349 | </detectors> | ||
3728 | 350 | </prescribed> | ||
3729 | 351 | </scalar_field> | ||
3730 | 352 | <scalar_field name="Viscosity" rank="0"> | ||
3731 | 353 | <prescribed> | ||
3732 | 354 | <mesh name="DGP0"/> | ||
3733 | 355 | <value name="WholeMesh"> | ||
3734 | 356 | <constant> | ||
3735 | 357 | <real_value rank="0">1.0e-04</real_value> | ||
3736 | 358 | </constant> | ||
3737 | 359 | </value> | ||
3738 | 360 | <output/> | ||
3739 | 361 | <stat/> | ||
3740 | 362 | <detectors> | ||
3741 | 363 | <exclude_from_detectors/> | ||
3742 | 364 | </detectors> | ||
3743 | 365 | </prescribed> | ||
3744 | 366 | </scalar_field> | ||
3745 | 367 | <vector_field name="interstitial_velocity" rank="1"> | ||
3746 | 368 | <diagnostic> | ||
3747 | 369 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
3748 | 370 | <string_value lines="20" type="python">phi = states["fluid"].scalar_fields["Porosity"] | ||
3749 | 371 | darcy_vel = states["fluid"].vector_fields["Velocity"] | ||
3750 | 372 | |||
3751 | 373 | for ele in range(field.element_count): | ||
3752 | 374 | phi_ele = phi.node_val(ele) | ||
3753 | 375 | |||
3754 | 376 | factor_ele = 1.0/max(phi_ele,1.0e-08) | ||
3755 | 377 | |||
3756 | 378 | vel_ele = [] | ||
3757 | 379 | for i in range(len(darcy_vel.ele_val(ele))): | ||
3758 | 380 | vel_ele.append(factor_ele*darcy_vel.ele_val(ele)[i]) | ||
3759 | 381 | |||
3760 | 382 | field.set(darcy_vel.ele_nodes(ele),vel_ele)</string_value> | ||
3761 | 383 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
3762 | 384 | |||
3763 | 385 | also assume that the velocity is dg</comment> | ||
3764 | 386 | </algorithm> | ||
3765 | 387 | <mesh name="VelocityMesh"/> | ||
3766 | 388 | <output/> | ||
3767 | 389 | <stat> | ||
3768 | 390 | <include_in_stat/> | ||
3769 | 391 | </stat> | ||
3770 | 392 | <convergence> | ||
3771 | 393 | <include_in_convergence/> | ||
3772 | 394 | </convergence> | ||
3773 | 395 | <detectors> | ||
3774 | 396 | <include_in_detectors/> | ||
3775 | 397 | </detectors> | ||
3776 | 398 | <steady_state> | ||
3777 | 399 | <include_in_steady_state/> | ||
3778 | 400 | </steady_state> | ||
3779 | 401 | </diagnostic> | ||
3780 | 402 | </vector_field> | ||
3781 | 403 | </material_phase> | ||
3782 | 404 | </fluidity_options> | ||
3783 | 0 | 405 | ||
3784 | === added file 'tests/darcy_p0p1_test_cty_cv_velBCinlet/square.geo' | |||
3785 | --- tests/darcy_p0p1_test_cty_cv_velBCinlet/square.geo 1970-01-01 00:00:00 +0000 | |||
3786 | +++ tests/darcy_p0p1_test_cty_cv_velBCinlet/square.geo 2011-12-23 12:05:25 +0000 | |||
3787 | @@ -0,0 +1,22 @@ | |||
3788 | 1 | // define a layer variable | ||
3789 | 2 | lay = 5; | ||
3790 | 3 | |||
3791 | 4 | // define a len variable | ||
3792 | 5 | len = 300.0; | ||
3793 | 6 | |||
3794 | 7 | Point(1) = {0.0, 0.0, 0.0, 1.0}; | ||
3795 | 8 | |||
3796 | 9 | Extrude {len, 0.0, 0.0} { | ||
3797 | 10 | Point{1}; Layers{lay}; | ||
3798 | 11 | } | ||
3799 | 12 | |||
3800 | 13 | Extrude {0.0, len, 0.0} { | ||
3801 | 14 | Line{1}; Layers{lay}; | ||
3802 | 15 | } | ||
3803 | 16 | |||
3804 | 17 | Physical Line(7) = {1}; | ||
3805 | 18 | Physical Line(8) = {4}; | ||
3806 | 19 | Physical Line(9) = {2}; | ||
3807 | 20 | Physical Line(10) = {3}; | ||
3808 | 21 | |||
3809 | 22 | Physical Surface(11) = {5}; | ||
3810 | 0 | 23 | ||
3811 | === added directory 'tests/darcy_p0p1cv_pressBCinlet' | |||
3812 | === added file 'tests/darcy_p0p1cv_pressBCinlet/Makefile' | |||
3813 | --- tests/darcy_p0p1cv_pressBCinlet/Makefile 1970-01-01 00:00:00 +0000 | |||
3814 | +++ tests/darcy_p0p1cv_pressBCinlet/Makefile 2011-12-23 12:05:25 +0000 | |||
3815 | @@ -0,0 +1,32 @@ | |||
3816 | 1 | SHELL = sh | ||
3817 | 2 | |||
3818 | 3 | SIM = darcy_p0p1cv_pressBCinlet | ||
3819 | 4 | |||
3820 | 5 | # options for 1d mesh interval script | ||
3821 | 6 | MESH_SIZE = 100.0 | ||
3822 | 7 | LEFT_X = 0.0 | ||
3823 | 8 | RIGHT_X = 300.0 | ||
3824 | 9 | |||
3825 | 10 | input: clean | ||
3826 | 11 | interval --dx=$(MESH_SIZE) $(LEFT_X) $(RIGHT_X) $(SIM)_1d | ||
3827 | 12 | gmsh -2 square.geo -o square.msh | ||
3828 | 13 | gmsh -3 cube.geo -o cube.msh | ||
3829 | 14 | |||
3830 | 15 | clean: | ||
3831 | 16 | rm -f *.ele | ||
3832 | 17 | rm -f *.node | ||
3833 | 18 | rm -f *.bound | ||
3834 | 19 | rm -f *.edge | ||
3835 | 20 | rm -f *.face | ||
3836 | 21 | rm -f *.vtu | ||
3837 | 22 | rm -f *.pvtu | ||
3838 | 23 | rm -f *.s | ||
3839 | 24 | rm -f *.stat | ||
3840 | 25 | rm -f *.log-0 | ||
3841 | 26 | rm -f *.err-0 | ||
3842 | 27 | rm -f *.msh | ||
3843 | 28 | rm -f *.halo | ||
3844 | 29 | rm -f fluidity.err* | ||
3845 | 30 | rm -f fluidity.log* | ||
3846 | 31 | rm -f matrixdump* | ||
3847 | 32 | rm -f first_timestep_adapted_mesh* | ||
3848 | 0 | 33 | ||
3849 | === added file 'tests/darcy_p0p1cv_pressBCinlet/cube.geo' | |||
3850 | --- tests/darcy_p0p1cv_pressBCinlet/cube.geo 1970-01-01 00:00:00 +0000 | |||
3851 | +++ tests/darcy_p0p1cv_pressBCinlet/cube.geo 2011-12-23 12:05:25 +0000 | |||
3852 | @@ -0,0 +1,39 @@ | |||
3853 | 1 | // define a layer variable | ||
3854 | 2 | lay = 5; | ||
3855 | 3 | |||
3856 | 4 | // define a len variable | ||
3857 | 5 | len = 300.0; | ||
3858 | 6 | |||
3859 | 7 | Point(1) = {0.0, 0.0, 0.0, 1.0}; | ||
3860 | 8 | |||
3861 | 9 | Extrude {len, 0.0, 0.0} { | ||
3862 | 10 | Point{1}; Layers{lay}; | ||
3863 | 11 | } | ||
3864 | 12 | |||
3865 | 13 | Extrude {0.0, len, 0.0} { | ||
3866 | 14 | Line{1}; Layers{lay}; | ||
3867 | 15 | } | ||
3868 | 16 | |||
3869 | 17 | Extrude {0.0, 0.0, len} { | ||
3870 | 18 | Surface{5}; Layers{lay}; | ||
3871 | 19 | } | ||
3872 | 20 | |||
3873 | 21 | // bottom | ||
3874 | 22 | Physical Surface(1) = {5}; | ||
3875 | 23 | |||
3876 | 24 | // top | ||
3877 | 25 | Physical Surface(2) = {27}; | ||
3878 | 26 | |||
3879 | 27 | // left | ||
3880 | 28 | Physical Surface(3) = {26}; | ||
3881 | 29 | |||
3882 | 30 | // right | ||
3883 | 31 | Physical Surface(4) = {18}; | ||
3884 | 32 | |||
3885 | 33 | // front | ||
3886 | 34 | Physical Surface(5) = {14}; | ||
3887 | 35 | |||
3888 | 36 | // back | ||
3889 | 37 | Physical Surface(6) = {22}; | ||
3890 | 38 | |||
3891 | 39 | Physical Volume(1) = {1}; | ||
3892 | 0 | 40 | ||
3893 | === added file 'tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet.xml' | |||
3894 | --- tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet.xml 1970-01-01 00:00:00 +0000 | |||
3895 | +++ tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet.xml 2011-12-23 12:05:25 +0000 | |||
3896 | @@ -0,0 +1,94 @@ | |||
3897 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
3898 | 2 | <!DOCTYPE testproblem SYSTEM "regressiontest.dtd"> | ||
3899 | 3 | |||
3900 | 4 | <testproblem> | ||
3901 | 5 | <name>darcy_p0p1cv_pressBCinlet</name> | ||
3902 | 6 | <owner userid="btollit"/> | ||
3903 | 7 | <tags>flml darcy</tags> | ||
3904 | 8 | <problem_definition length="short" nprocs="1"> | ||
3905 | 9 | <command_line> | ||
3906 | 10 | ../../bin/fluidity darcy_p0p1cv_pressBCinlet_1d.flml | ||
3907 | 11 | ../../bin/fluidity darcy_p0p1cv_pressBCinlet_2d.flml | ||
3908 | 12 | ../../bin/fluidity darcy_p0p1cv_pressBCinlet_3d.flml | ||
3909 | 13 | </command_line> | ||
3910 | 14 | <!-- One/two/three dimensional problem for darcy flow with one region and one material using p0p1cv element type testing the pressure gradient against analytic and the interstitial velocity. This tests using a diagnostic velocity absorption field associated with a mesh and momentum dg for darcy flow. This also tests the use of pressure BC for CV pressure.--> | ||
3911 | 15 | </problem_definition> | ||
3912 | 16 | <variables> | ||
3913 | 17 | <variable name="pressure_1d" language="python"> | ||
3914 | 18 | import vtktools | ||
3915 | 19 | v = vtktools.vtu("darcy_p0p1cv_pressBCinlet_1d_1.vtu") | ||
3916 | 20 | pressure_1d = v.GetScalarRange("Pressure") | ||
3917 | 21 | </variable> | ||
3918 | 22 | <variable name="inter_vel_1d" language="python"> | ||
3919 | 23 | import vtktools | ||
3920 | 24 | v = vtktools.vtu("darcy_p0p1cv_pressBCinlet_1d_1.vtu") | ||
3921 | 25 | inter_vel_1d = max(v.GetScalarRange("interstitial_velocity")) | ||
3922 | 26 | </variable> | ||
3923 | 27 | <variable name="pressure_2d" language="python"> | ||
3924 | 28 | import vtktools | ||
3925 | 29 | v = vtktools.vtu("darcy_p0p1cv_pressBCinlet_2d_1.vtu") | ||
3926 | 30 | pressure_2d = v.GetScalarRange("Pressure") | ||
3927 | 31 | </variable> | ||
3928 | 32 | <variable name="inter_vel_2d" language="python"> | ||
3929 | 33 | import vtktools | ||
3930 | 34 | v = vtktools.vtu("darcy_p0p1cv_pressBCinlet_2d_1.vtu") | ||
3931 | 35 | inter_vel_2d = max(v.GetScalarRange("interstitial_velocity")) | ||
3932 | 36 | </variable> | ||
3933 | 37 | <variable name="pressure_3d" language="python"> | ||
3934 | 38 | import vtktools | ||
3935 | 39 | v = vtktools.vtu("darcy_p0p1cv_pressBCinlet_3d_1.vtu") | ||
3936 | 40 | pressure_3d = v.GetScalarRange("Pressure") | ||
3937 | 41 | </variable> | ||
3938 | 42 | <variable name="inter_vel_3d" language="python"> | ||
3939 | 43 | import vtktools | ||
3940 | 44 | v = vtktools.vtu("darcy_p0p1cv_pressBCinlet_3d_1.vtu") | ||
3941 | 45 | inter_vel_3d = max(v.GetScalarRange("interstitial_velocity")) | ||
3942 | 46 | </variable> | ||
3943 | 47 | </variables> | ||
3944 | 48 | <pass_tests> | ||
3945 | 49 | <test name="change_P for 1d should equal domain_length*visc*darcy_vel_BC/perm, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
3946 | 50 | change_P = abs(max(pressure_1d) - min(pressure_1d)) | ||
3947 | 51 | visc = 1.0e-04 | ||
3948 | 52 | darcy_vel_BC = 5.0 | ||
3949 | 53 | perm = 1.0e-10 | ||
3950 | 54 | domain_length = 300.0 | ||
3951 | 55 | print 'Relative error of pressure difference: ',abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) | ||
3952 | 56 | assert abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) < 1.0e-09 | ||
3953 | 57 | </test> | ||
3954 | 58 | <test name="interstitial velocity 1d should equal darcy_vel/porosity, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
3955 | 59 | analytic_vel = 10.0 | ||
3956 | 60 | print 'Relative error of interstitial velocity: ',abs((inter_vel_1d - analytic_vel)/analytic_vel) | ||
3957 | 61 | assert abs((inter_vel_1d - analytic_vel)/analytic_vel) < 1.0e-09 | ||
3958 | 62 | </test> | ||
3959 | 63 | <test name="change_P for 2d should equal domain_length*visc*darcy_vel_BC/perm, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
3960 | 64 | change_P = abs(max(pressure_2d) - min(pressure_2d)) | ||
3961 | 65 | visc = 1.0e-04 | ||
3962 | 66 | darcy_vel_BC = 5.0 | ||
3963 | 67 | perm = 1.0e-10 | ||
3964 | 68 | domain_length = 300.0 | ||
3965 | 69 | print 'Relative error of pressure difference: ',abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) | ||
3966 | 70 | assert abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) < 1.0e-09 | ||
3967 | 71 | </test> | ||
3968 | 72 | <test name="interstitial velocity 2d should equal darcy_vel/porosity, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
3969 | 73 | analytic_vel = 10.0 | ||
3970 | 74 | print 'Relative error of interstitial velocity: ',abs((inter_vel_2d - analytic_vel)/analytic_vel) | ||
3971 | 75 | assert abs((inter_vel_2d - analytic_vel)/analytic_vel) < 1.0e-09 | ||
3972 | 76 | </test> | ||
3973 | 77 | <test name="change_P for 3d should equal domain_length*visc*darcy_vel_BC/perm, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
3974 | 78 | change_P = abs(max(pressure_3d) - min(pressure_3d)) | ||
3975 | 79 | visc = 1.0e-04 | ||
3976 | 80 | darcy_vel_BC = 5.0 | ||
3977 | 81 | perm = 1.0e-10 | ||
3978 | 82 | domain_length = 300.0 | ||
3979 | 83 | print 'Relative error of pressure difference: ',abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) | ||
3980 | 84 | assert abs((change_P - domain_length*visc*darcy_vel_BC/perm)/(domain_length*visc*darcy_vel_BC/perm)) < 1.0e-09 | ||
3981 | 85 | </test> | ||
3982 | 86 | <test name="interstitial velocity 3d should equal darcy_vel/porosity, check relative difference to be under tolerance 1.0e-09" language="python"> | ||
3983 | 87 | analytic_vel = 10.0 | ||
3984 | 88 | print 'Relative error of interstitial velocity: ',abs((inter_vel_3d - analytic_vel)/analytic_vel) | ||
3985 | 89 | assert abs((inter_vel_3d - analytic_vel)/analytic_vel) < 1.0e-09 | ||
3986 | 90 | </test> | ||
3987 | 91 | </pass_tests> | ||
3988 | 92 | <warn_tests> | ||
3989 | 93 | </warn_tests> | ||
3990 | 94 | </testproblem> | ||
3991 | 0 | 95 | ||
3992 | === added file 'tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_1d.flml' | |||
3993 | --- tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_1d.flml 1970-01-01 00:00:00 +0000 | |||
3994 | +++ tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_1d.flml 2011-12-23 12:05:25 +0000 | |||
3995 | @@ -0,0 +1,384 @@ | |||
3996 | 1 | <?xml version='1.0' encoding='utf-8'?> | ||
3997 | 2 | <fluidity_options> | ||
3998 | 3 | <simulation_name> | ||
3999 | 4 | <string_value lines="1">darcy_p0p1cv_pressBCinlet_1d</string_value> | ||
4000 | 5 | <comment>a simple short test case for darcy flow using the element type p0p1cv for velocity-pressure | ||
4001 | 6 | |||
4002 | 7 | the darcy velocity is solved for and the interstitial velocity is a diagnostic from this (assuming a dg solution) | ||
4003 | 8 | |||
4004 | 9 | it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct | ||
4005 | 10 | |||
4006 | 11 | the darcy flow equation is | ||
4007 | 12 | |||
4008 | 13 | sigma*darcy_vel = - grad P | ||
4009 | 14 | |||
4010 | 15 | sigma is a function of viscosity and permeability which are two input fields that are named in the flml - not on fluidity special names (ie. this doesnt use the porous media object options) | ||
4011 | 16 | |||
4012 | 17 | python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity | ||
4013 | 18 | |||
4014 | 19 | this case has a 1 region 1 material with pressure boundary condition inflow. | ||
4015 | 20 | |||
4016 | 21 | to get a darcy equation the time, stress and advection terms are not included in a bousinessq formulation (to avoid needing to specify a density). Ideally it would be better to actually have a darcy momentum option to simplify the input. | ||
4017 | 22 | |||
4018 | 23 | the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation) | ||
4019 | 24 | |||
4020 | 25 | the geometry is 1d and one time step is done (as nothing depends on time).</comment> | ||
4021 | 26 | </simulation_name> | ||
4022 | 27 | <problem_type> | ||
4023 | 28 | <string_value lines="1">fluids</string_value> | ||
4024 | 29 | </problem_type> | ||
4025 | 30 | <geometry> | ||
4026 | 31 | <dimension> | ||
4027 | 32 | <integer_value rank="0">1</integer_value> | ||
4028 | 33 | </dimension> | ||
4029 | 34 | <mesh name="CoordinateMesh"> | ||
4030 | 35 | <from_file file_name="darcy_p0p1cv_pressBCinlet_1d"> | ||
4031 | 36 | <format name="triangle"/> | ||
4032 | 37 | <stat> | ||
4033 | 38 | <include_in_stat/> | ||
4034 | 39 | </stat> | ||
4035 | 40 | </from_file> | ||
4036 | 41 | </mesh> | ||
4037 | 42 | <mesh name="VelocityMesh"> | ||
4038 | 43 | <from_mesh> | ||
4039 | 44 | <mesh name="CoordinateMesh"/> | ||
4040 | 45 | <mesh_shape> | ||
4041 | 46 | <polynomial_degree> | ||
4042 | 47 | <integer_value rank="0">0</integer_value> | ||
4043 | 48 | </polynomial_degree> | ||
4044 | 49 | </mesh_shape> | ||
4045 | 50 | <mesh_continuity> | ||
4046 | 51 | <string_value>discontinuous</string_value> | ||
4047 | 52 | </mesh_continuity> | ||
4048 | 53 | <stat> | ||
4049 | 54 | <exclude_from_stat/> | ||
4050 | 55 | </stat> | ||
4051 | 56 | </from_mesh> | ||
4052 | 57 | </mesh> | ||
4053 | 58 | <mesh name="PressureMesh"> | ||
4054 | 59 | <from_mesh> | ||
4055 | 60 | <mesh name="CoordinateMesh"/> | ||
4056 | 61 | <mesh_shape> | ||
4057 | 62 | <polynomial_degree> | ||
4058 | 63 | <integer_value rank="0">1</integer_value> | ||
4059 | 64 | </polynomial_degree> | ||
4060 | 65 | </mesh_shape> | ||
4061 | 66 | <stat> | ||
4062 | 67 | <exclude_from_stat/> | ||
4063 | 68 | </stat> | ||
4064 | 69 | </from_mesh> | ||
4065 | 70 | </mesh> | ||
4066 | 71 | <mesh name="DGP0"> | ||
4067 | 72 | <from_mesh> | ||
4068 | 73 | <mesh name="CoordinateMesh"/> | ||
4069 | 74 | <mesh_shape> | ||
4070 | 75 | <polynomial_degree> | ||
4071 | 76 | <integer_value rank="0">0</integer_value> | ||
4072 | 77 | </polynomial_degree> | ||
4073 | 78 | </mesh_shape> | ||
4074 | 79 | <mesh_continuity> | ||
4075 | 80 | <string_value>discontinuous</string_value> | ||
4076 | 81 | </mesh_continuity> | ||
4077 | 82 | <stat> | ||
4078 | 83 | <exclude_from_stat/> | ||
4079 | 84 | </stat> | ||
4080 | 85 | </from_mesh> | ||
4081 | 86 | </mesh> | ||
4082 | 87 | <mesh name="OutputMesh"> | ||
4083 | 88 | <from_mesh> | ||
4084 | 89 | <mesh name="CoordinateMesh"/> | ||
4085 | 90 | <mesh_continuity> | ||
4086 | 91 | <string_value>discontinuous</string_value> | ||
4087 | 92 | </mesh_continuity> | ||
4088 | 93 | <stat> | ||
4089 | 94 | <exclude_from_stat/> | ||
4090 | 95 | </stat> | ||
4091 | 96 | </from_mesh> | ||
4092 | 97 | </mesh> | ||
4093 | 98 | <quadrature> | ||
4094 | 99 | <degree> | ||
4095 | 100 | <integer_value rank="0">3</integer_value> | ||
4096 | 101 | </degree> | ||
4097 | 102 | </quadrature> | ||
4098 | 103 | </geometry> | ||
4099 | 104 | <io> | ||
4100 | 105 | <dump_format> | ||
4101 | 106 | <string_value>vtk</string_value> | ||
4102 | 107 | </dump_format> | ||
4103 | 108 | <dump_period_in_timesteps> | ||
4104 | 109 | <constant> | ||
4105 | 110 | <integer_value rank="0">0</integer_value> | ||
4106 | 111 | </constant> | ||
4107 | 112 | </dump_period_in_timesteps> | ||
4108 | 113 | <output_mesh name="OutputMesh"/> | ||
4109 | 114 | <stat/> | ||
4110 | 115 | </io> | ||
4111 | 116 | <timestepping> | ||
4112 | 117 | <current_time> | ||
4113 | 118 | <real_value rank="0">0.0</real_value> | ||
4114 | 119 | </current_time> | ||
4115 | 120 | <timestep> | ||
4116 | 121 | <real_value rank="0">1.0</real_value> | ||
4117 | 122 | </timestep> | ||
4118 | 123 | <finish_time> | ||
4119 | 124 | <real_value rank="0">1.0</real_value> | ||
4120 | 125 | </finish_time> | ||
4121 | 126 | </timestepping> | ||
4122 | 127 | <material_phase name="fluid"> | ||
4123 | 128 | <scalar_field name="Pressure" rank="0"> | ||
4124 | 129 | <prognostic> | ||
4125 | 130 | <mesh name="PressureMesh"/> | ||
4126 | 131 | <spatial_discretisation> | ||
4127 | 132 | <control_volumes/> | ||
4128 | 133 | </spatial_discretisation> | ||
4129 | 134 | <scheme> | ||
4130 | 135 | <poisson_pressure_solution> | ||
4131 | 136 | <string_value lines="1">never</string_value> | ||
4132 | 137 | </poisson_pressure_solution> | ||
4133 | 138 | <use_projection_method/> | ||
4134 | 139 | </scheme> | ||
4135 | 140 | <solver> | ||
4136 | 141 | <iterative_method name="cg"/> | ||
4137 | 142 | <preconditioner name="sor"/> | ||
4138 | 143 | <relative_error> | ||
4139 | 144 | <real_value rank="0">1.0e-10</real_value> | ||
4140 | 145 | </relative_error> | ||
4141 | 146 | <max_iterations> | ||
4142 | 147 | <integer_value rank="0">1000</integer_value> | ||
4143 | 148 | </max_iterations> | ||
4144 | 149 | <never_ignore_solver_failures/> | ||
4145 | 150 | <diagnostics> | ||
4146 | 151 | <monitors/> | ||
4147 | 152 | </diagnostics> | ||
4148 | 153 | </solver> | ||
4149 | 154 | <boundary_conditions name="right_outflow"> | ||
4150 | 155 | <surface_ids> | ||
4151 | 156 | <integer_value shape="1" rank="1">2</integer_value> | ||
4152 | 157 | </surface_ids> | ||
4153 | 158 | <type name="dirichlet"> | ||
4154 | 159 | <constant> | ||
4155 | 160 | <real_value rank="0">0.0</real_value> | ||
4156 | 161 | </constant> | ||
4157 | 162 | </type> | ||
4158 | 163 | </boundary_conditions> | ||
4159 | 164 | <boundary_conditions name="left_inflow"> | ||
4160 | 165 | <surface_ids> | ||
4161 | 166 | <integer_value shape="1" rank="1">1</integer_value> | ||
4162 | 167 | </surface_ids> | ||
4163 | 168 | <type name="dirichlet"> | ||
4164 | 169 | <constant> | ||
4165 | 170 | <real_value rank="0">1.5e+09</real_value> | ||
4166 | 171 | </constant> | ||
4167 | 172 | </type> | ||
4168 | 173 | </boundary_conditions> | ||
4169 | 174 | <output/> | ||
4170 | 175 | <stat/> | ||
4171 | 176 | <convergence> | ||
4172 | 177 | <include_in_convergence/> | ||
4173 | 178 | </convergence> | ||
4174 | 179 | <detectors> | ||
4175 | 180 | <exclude_from_detectors/> | ||
4176 | 181 | </detectors> | ||
4177 | 182 | <steady_state> | ||
4178 | 183 | <include_in_steady_state/> | ||
4179 | 184 | </steady_state> | ||
4180 | 185 | <no_interpolation/> | ||
4181 | 186 | </prognostic> | ||
4182 | 187 | </scalar_field> | ||
4183 | 188 | <vector_field name="Velocity" rank="1"> | ||
4184 | 189 | <prognostic> | ||
4185 | 190 | <mesh name="VelocityMesh"/> | ||
4186 | 191 | <equation name="Boussinesq"/> | ||
4187 | 192 | <spatial_discretisation> | ||
4188 | 193 | <discontinuous_galerkin> | ||
4189 | 194 | <mass_terms> | ||
4190 | 195 | <exclude_mass_terms/> | ||
4191 | 196 | </mass_terms> | ||
4192 | 197 | <viscosity_scheme> | ||
4193 | 198 | <compact_discontinuous_galerkin/> | ||
4194 | 199 | </viscosity_scheme> | ||
4195 | 200 | <advection_scheme> | ||
4196 | 201 | <none/> | ||
4197 | 202 | <integrate_advection_by_parts> | ||
4198 | 203 | <twice/> | ||
4199 | 204 | </integrate_advection_by_parts> | ||
4200 | 205 | </advection_scheme> | ||
4201 | 206 | </discontinuous_galerkin> | ||
4202 | 207 | <conservative_advection> | ||
4203 | 208 | <real_value rank="0">0.0</real_value> | ||
4204 | 209 | </conservative_advection> | ||
4205 | 210 | </spatial_discretisation> | ||
4206 | 211 | <temporal_discretisation> | ||
4207 | 212 | <theta> | ||
4208 | 213 | <real_value rank="0">1.0</real_value> | ||
4209 | 214 | </theta> | ||
4210 | 215 | <relaxation> | ||
4211 | 216 | <real_value rank="0">1.0</real_value> | ||
4212 | 217 | </relaxation> | ||
4213 | 218 | </temporal_discretisation> | ||
4214 | 219 | <solver> | ||
4215 | 220 | <iterative_method name="gmres"> | ||
4216 | 221 | <restart> | ||
4217 | 222 | <integer_value rank="0">30</integer_value> | ||
4218 | 223 | </restart> | ||
4219 | 224 | </iterative_method> | ||
4220 | 225 | <preconditioner name="sor"/> | ||
4221 | 226 | <relative_error> | ||
4222 | 227 | <real_value rank="0">1.0e-10</real_value> | ||
4223 | 228 | </relative_error> | ||
4224 | 229 | <max_iterations> | ||
4225 | 230 | <integer_value rank="0">1000</integer_value> | ||
4226 | 231 | </max_iterations> | ||
4227 | 232 | <never_ignore_solver_failures/> | ||
4228 | 233 | <diagnostics> | ||
4229 | 234 | <monitors/> | ||
4230 | 235 | </diagnostics> | ||
4231 | 236 | </solver> | ||
4232 | 237 | <initial_condition name="WholeMesh"> | ||
4233 | 238 | <constant> | ||
4234 | 239 | <real_value shape="1" dim1="dim" rank="1">0.0</real_value> | ||
4235 | 240 | </constant> | ||
4236 | 241 | </initial_condition> | ||
4237 | 242 | <vector_field name="Absorption" rank="1"> | ||
4238 | 243 | <diagnostic> | ||
4239 | 244 | <mesh name="DGP0"/> | ||
4240 | 245 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
4241 | 246 | <string_value lines="20" type="python"># get the prescribed fields | ||
4242 | 247 | perm = states["fluid"].scalar_fields["Permeability"] | ||
4243 | 248 | visc = states["fluid"].scalar_fields["Viscosity"] | ||
4244 | 249 | |||
4245 | 250 | # loop the DMmesh_p0 nodes (which are element centred) | ||
4246 | 251 | for n in range(field.node_count): | ||
4247 | 252 | perm_n = perm.node_val(n) | ||
4248 | 253 | visc_n = visc.node_val(n) | ||
4249 | 254 | |||
4250 | 255 | # calc the absorption term | ||
4251 | 256 | sigma_n = visc_n/perm_n | ||
4252 | 257 | |||
4253 | 258 | # set the absorption term | ||
4254 | 259 | field.set(n,sigma_n)</string_value> | ||
4255 | 260 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
4256 | 261 | |||
4257 | 262 | also assume that the velocity is dg</comment> | ||
4258 | 263 | </algorithm> | ||
4259 | 264 | <output/> | ||
4260 | 265 | <stat> | ||
4261 | 266 | <include_in_stat/> | ||
4262 | 267 | </stat> | ||
4263 | 268 | <convergence> | ||
4264 | 269 | <include_in_convergence/> | ||
4265 | 270 | </convergence> | ||
4266 | 271 | <detectors> | ||
4267 | 272 | <include_in_detectors/> | ||
4268 | 273 | </detectors> | ||
4269 | 274 | <steady_state> | ||
4270 | 275 | <include_in_steady_state/> | ||
4271 | 276 | </steady_state> | ||
4272 | 277 | </diagnostic> | ||
4273 | 278 | <include_pressure_correction/> | ||
4274 | 279 | </vector_field> | ||
4275 | 280 | <output/> | ||
4276 | 281 | <stat> | ||
4277 | 282 | <include_in_stat/> | ||
4278 | 283 | <previous_time_step> | ||
4279 | 284 | <exclude_from_stat/> | ||
4280 | 285 | </previous_time_step> | ||
4281 | 286 | <nonlinear_field> | ||
4282 | 287 | <exclude_from_stat/> | ||
4283 | 288 | </nonlinear_field> | ||
4284 | 289 | </stat> | ||
4285 | 290 | <convergence> | ||
4286 | 291 | <include_in_convergence/> | ||
4287 | 292 | </convergence> | ||
4288 | 293 | <detectors> | ||
4289 | 294 | <include_in_detectors/> | ||
4290 | 295 | </detectors> | ||
4291 | 296 | <steady_state> | ||
4292 | 297 | <include_in_steady_state/> | ||
4293 | 298 | </steady_state> | ||
4294 | 299 | <consistent_interpolation/> | ||
4295 | 300 | </prognostic> | ||
4296 | 301 | </vector_field> | ||
4297 | 302 | <scalar_field name="Porosity" rank="0"> | ||
4298 | 303 | <prescribed> | ||
4299 | 304 | <mesh name="DGP0"/> | ||
4300 | 305 | <value name="WholeMesh"> | ||
4301 | 306 | <constant> | ||
4302 | 307 | <real_value rank="0">0.5</real_value> | ||
4303 | 308 | </constant> | ||
4304 | 309 | </value> | ||
4305 | 310 | <output/> | ||
4306 | 311 | <stat/> | ||
4307 | 312 | <detectors> | ||
4308 | 313 | <exclude_from_detectors/> | ||
4309 | 314 | </detectors> | ||
4310 | 315 | </prescribed> | ||
4311 | 316 | </scalar_field> | ||
4312 | 317 | <scalar_field name="Permeability" rank="0"> | ||
4313 | 318 | <prescribed> | ||
4314 | 319 | <mesh name="DGP0"/> | ||
4315 | 320 | <value name="WholeMesh"> | ||
4316 | 321 | <constant> | ||
4317 | 322 | <real_value rank="0">1.0e-10</real_value> | ||
4318 | 323 | </constant> | ||
4319 | 324 | </value> | ||
4320 | 325 | <output/> | ||
4321 | 326 | <stat/> | ||
4322 | 327 | <detectors> | ||
4323 | 328 | <exclude_from_detectors/> | ||
4324 | 329 | </detectors> | ||
4325 | 330 | </prescribed> | ||
4326 | 331 | </scalar_field> | ||
4327 | 332 | <scalar_field name="Viscosity" rank="0"> | ||
4328 | 333 | <prescribed> | ||
4329 | 334 | <mesh name="DGP0"/> | ||
4330 | 335 | <value name="WholeMesh"> | ||
4331 | 336 | <constant> | ||
4332 | 337 | <real_value rank="0">1.0e-04</real_value> | ||
4333 | 338 | </constant> | ||
4334 | 339 | </value> | ||
4335 | 340 | <output/> | ||
4336 | 341 | <stat/> | ||
4337 | 342 | <detectors> | ||
4338 | 343 | <exclude_from_detectors/> | ||
4339 | 344 | </detectors> | ||
4340 | 345 | </prescribed> | ||
4341 | 346 | </scalar_field> | ||
4342 | 347 | <vector_field name="interstitial_velocity" rank="1"> | ||
4343 | 348 | <diagnostic> | ||
4344 | 349 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
4345 | 350 | <string_value lines="20" type="python">phi = states["fluid"].scalar_fields["Porosity"] | ||
4346 | 351 | darcy_vel = states["fluid"].vector_fields["Velocity"] | ||
4347 | 352 | |||
4348 | 353 | for ele in range(field.element_count): | ||
4349 | 354 | phi_ele = phi.node_val(ele) | ||
4350 | 355 | |||
4351 | 356 | factor_ele = 1.0/max(phi_ele,1.0e-08) | ||
4352 | 357 | |||
4353 | 358 | vel_ele = [] | ||
4354 | 359 | for i in range(len(darcy_vel.ele_val(ele))): | ||
4355 | 360 | vel_ele.append(factor_ele*darcy_vel.ele_val(ele)[i]) | ||
4356 | 361 | |||
4357 | 362 | field.set(darcy_vel.ele_nodes(ele),vel_ele)</string_value> | ||
4358 | 363 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
4359 | 364 | |||
4360 | 365 | also assume that the velocity is dg</comment> | ||
4361 | 366 | </algorithm> | ||
4362 | 367 | <mesh name="VelocityMesh"/> | ||
4363 | 368 | <output/> | ||
4364 | 369 | <stat> | ||
4365 | 370 | <include_in_stat/> | ||
4366 | 371 | </stat> | ||
4367 | 372 | <convergence> | ||
4368 | 373 | <include_in_convergence/> | ||
4369 | 374 | </convergence> | ||
4370 | 375 | <detectors> | ||
4371 | 376 | <include_in_detectors/> | ||
4372 | 377 | </detectors> | ||
4373 | 378 | <steady_state> | ||
4374 | 379 | <include_in_steady_state/> | ||
4375 | 380 | </steady_state> | ||
4376 | 381 | </diagnostic> | ||
4377 | 382 | </vector_field> | ||
4378 | 383 | </material_phase> | ||
4379 | 384 | </fluidity_options> | ||
4380 | 0 | 385 | ||
4381 | === added file 'tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_2d.flml' | |||
4382 | --- tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_2d.flml 1970-01-01 00:00:00 +0000 | |||
4383 | +++ tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_2d.flml 2011-12-23 12:05:25 +0000 | |||
4384 | @@ -0,0 +1,392 @@ | |||
4385 | 1 | <?xml version='1.0' encoding='utf-8'?> | ||
4386 | 2 | <fluidity_options> | ||
4387 | 3 | <simulation_name> | ||
4388 | 4 | <string_value lines="1">darcy_p0p1cv_pressBCinlet_2d</string_value> | ||
4389 | 5 | <comment>a simple short test case for darcy flow using the element type p0p1cv for velocity-pressure | ||
4390 | 6 | |||
4391 | 7 | the darcy velocity is solved for and the interstitial velocity is a diagnostic from this (assuming a dg solution) | ||
4392 | 8 | |||
4393 | 9 | it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct | ||
4394 | 10 | |||
4395 | 11 | the darcy flow equation is | ||
4396 | 12 | |||
4397 | 13 | sigma*darcy_vel = - grad P | ||
4398 | 14 | |||
4399 | 15 | sigma is a function of viscosity and permeability which are two input fields that are named in the flml - not on fluidity special names (ie. this doesnt use the porous media object options) | ||
4400 | 16 | |||
4401 | 17 | python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity | ||
4402 | 18 | |||
4403 | 19 | this case has a 1 region 1 material with pressure boundary condition inflow. | ||
4404 | 20 | |||
4405 | 21 | to get a darcy equation the time, stress and advection terms are not included in a bousinessq formulation (to avoid needing to specify a density). Ideally it would be better to actually have a darcy momentum option to simplify the input. | ||
4406 | 22 | |||
4407 | 23 | the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation) | ||
4408 | 24 | |||
4409 | 25 | the geometry is 2d (although this is a 1d problem) and one time step is done (as nothing depends on time).</comment> | ||
4410 | 26 | </simulation_name> | ||
4411 | 27 | <problem_type> | ||
4412 | 28 | <string_value lines="1">fluids</string_value> | ||
4413 | 29 | </problem_type> | ||
4414 | 30 | <geometry> | ||
4415 | 31 | <dimension> | ||
4416 | 32 | <integer_value rank="0">2</integer_value> | ||
4417 | 33 | </dimension> | ||
4418 | 34 | <mesh name="CoordinateMesh"> | ||
4419 | 35 | <from_file file_name="square"> | ||
4420 | 36 | <format name="gmsh"/> | ||
4421 | 37 | <stat> | ||
4422 | 38 | <include_in_stat/> | ||
4423 | 39 | </stat> | ||
4424 | 40 | </from_file> | ||
4425 | 41 | </mesh> | ||
4426 | 42 | <mesh name="VelocityMesh"> | ||
4427 | 43 | <from_mesh> | ||
4428 | 44 | <mesh name="CoordinateMesh"/> | ||
4429 | 45 | <mesh_shape> | ||
4430 | 46 | <polynomial_degree> | ||
4431 | 47 | <integer_value rank="0">0</integer_value> | ||
4432 | 48 | </polynomial_degree> | ||
4433 | 49 | </mesh_shape> | ||
4434 | 50 | <mesh_continuity> | ||
4435 | 51 | <string_value>discontinuous</string_value> | ||
4436 | 52 | </mesh_continuity> | ||
4437 | 53 | <stat> | ||
4438 | 54 | <exclude_from_stat/> | ||
4439 | 55 | </stat> | ||
4440 | 56 | </from_mesh> | ||
4441 | 57 | </mesh> | ||
4442 | 58 | <mesh name="PressureMesh"> | ||
4443 | 59 | <from_mesh> | ||
4444 | 60 | <mesh name="CoordinateMesh"/> | ||
4445 | 61 | <mesh_shape> | ||
4446 | 62 | <polynomial_degree> | ||
4447 | 63 | <integer_value rank="0">1</integer_value> | ||
4448 | 64 | </polynomial_degree> | ||
4449 | 65 | </mesh_shape> | ||
4450 | 66 | <stat> | ||
4451 | 67 | <exclude_from_stat/> | ||
4452 | 68 | </stat> | ||
4453 | 69 | </from_mesh> | ||
4454 | 70 | </mesh> | ||
4455 | 71 | <mesh name="DGP0"> | ||
4456 | 72 | <from_mesh> | ||
4457 | 73 | <mesh name="CoordinateMesh"/> | ||
4458 | 74 | <mesh_shape> | ||
4459 | 75 | <polynomial_degree> | ||
4460 | 76 | <integer_value rank="0">0</integer_value> | ||
4461 | 77 | </polynomial_degree> | ||
4462 | 78 | </mesh_shape> | ||
4463 | 79 | <mesh_continuity> | ||
4464 | 80 | <string_value>discontinuous</string_value> | ||
4465 | 81 | </mesh_continuity> | ||
4466 | 82 | <stat> | ||
4467 | 83 | <exclude_from_stat/> | ||
4468 | 84 | </stat> | ||
4469 | 85 | </from_mesh> | ||
4470 | 86 | </mesh> | ||
4471 | 87 | <mesh name="OutputMesh"> | ||
4472 | 88 | <from_mesh> | ||
4473 | 89 | <mesh name="CoordinateMesh"/> | ||
4474 | 90 | <mesh_continuity> | ||
4475 | 91 | <string_value>discontinuous</string_value> | ||
4476 | 92 | </mesh_continuity> | ||
4477 | 93 | <stat> | ||
4478 | 94 | <exclude_from_stat/> | ||
4479 | 95 | </stat> | ||
4480 | 96 | </from_mesh> | ||
4481 | 97 | </mesh> | ||
4482 | 98 | <quadrature> | ||
4483 | 99 | <degree> | ||
4484 | 100 | <integer_value rank="0">3</integer_value> | ||
4485 | 101 | </degree> | ||
4486 | 102 | </quadrature> | ||
4487 | 103 | </geometry> | ||
4488 | 104 | <io> | ||
4489 | 105 | <dump_format> | ||
4490 | 106 | <string_value>vtk</string_value> | ||
4491 | 107 | </dump_format> | ||
4492 | 108 | <dump_period_in_timesteps> | ||
4493 | 109 | <constant> | ||
4494 | 110 | <integer_value rank="0">0</integer_value> | ||
4495 | 111 | </constant> | ||
4496 | 112 | </dump_period_in_timesteps> | ||
4497 | 113 | <output_mesh name="OutputMesh"/> | ||
4498 | 114 | <stat/> | ||
4499 | 115 | </io> | ||
4500 | 116 | <timestepping> | ||
4501 | 117 | <current_time> | ||
4502 | 118 | <real_value rank="0">0.0</real_value> | ||
4503 | 119 | </current_time> | ||
4504 | 120 | <timestep> | ||
4505 | 121 | <real_value rank="0">1.0</real_value> | ||
4506 | 122 | </timestep> | ||
4507 | 123 | <finish_time> | ||
4508 | 124 | <real_value rank="0">1.0</real_value> | ||
4509 | 125 | </finish_time> | ||
4510 | 126 | </timestepping> | ||
4511 | 127 | <material_phase name="fluid"> | ||
4512 | 128 | <scalar_field name="Pressure" rank="0"> | ||
4513 | 129 | <prognostic> | ||
4514 | 130 | <mesh name="PressureMesh"/> | ||
4515 | 131 | <spatial_discretisation> | ||
4516 | 132 | <control_volumes/> | ||
4517 | 133 | </spatial_discretisation> | ||
4518 | 134 | <scheme> | ||
4519 | 135 | <poisson_pressure_solution> | ||
4520 | 136 | <string_value lines="1">never</string_value> | ||
4521 | 137 | </poisson_pressure_solution> | ||
4522 | 138 | <use_projection_method/> | ||
4523 | 139 | </scheme> | ||
4524 | 140 | <solver> | ||
4525 | 141 | <iterative_method name="cg"/> | ||
4526 | 142 | <preconditioner name="sor"/> | ||
4527 | 143 | <relative_error> | ||
4528 | 144 | <real_value rank="0">1.0e-10</real_value> | ||
4529 | 145 | </relative_error> | ||
4530 | 146 | <max_iterations> | ||
4531 | 147 | <integer_value rank="0">1000</integer_value> | ||
4532 | 148 | </max_iterations> | ||
4533 | 149 | <never_ignore_solver_failures/> | ||
4534 | 150 | <diagnostics> | ||
4535 | 151 | <monitors/> | ||
4536 | 152 | </diagnostics> | ||
4537 | 153 | </solver> | ||
4538 | 154 | <boundary_conditions name="right_outflow"> | ||
4539 | 155 | <surface_ids> | ||
4540 | 156 | <integer_value shape="1" rank="1">8</integer_value> | ||
4541 | 157 | </surface_ids> | ||
4542 | 158 | <type name="dirichlet"> | ||
4543 | 159 | <apply_weakly/> | ||
4544 | 160 | <constant> | ||
4545 | 161 | <real_value rank="0">0.0</real_value> | ||
4546 | 162 | </constant> | ||
4547 | 163 | </type> | ||
4548 | 164 | </boundary_conditions> | ||
4549 | 165 | <boundary_conditions name="left_inflow"> | ||
4550 | 166 | <surface_ids> | ||
4551 | 167 | <integer_value shape="1" rank="1">10</integer_value> | ||
4552 | 168 | </surface_ids> | ||
4553 | 169 | <type name="dirichlet"> | ||
4554 | 170 | <apply_weakly/> | ||
4555 | 171 | <constant> | ||
4556 | 172 | <real_value rank="0">1.5e+09</real_value> | ||
4557 | 173 | </constant> | ||
4558 | 174 | </type> | ||
4559 | 175 | </boundary_conditions> | ||
4560 | 176 | <output/> | ||
4561 | 177 | <stat/> | ||
4562 | 178 | <convergence> | ||
4563 | 179 | <include_in_convergence/> | ||
4564 | 180 | </convergence> | ||
4565 | 181 | <detectors> | ||
4566 | 182 | <exclude_from_detectors/> | ||
4567 | 183 | </detectors> | ||
4568 | 184 | <steady_state> | ||
4569 | 185 | <include_in_steady_state/> | ||
4570 | 186 | </steady_state> | ||
4571 | 187 | <no_interpolation/> | ||
4572 | 188 | </prognostic> | ||
4573 | 189 | </scalar_field> | ||
4574 | 190 | <vector_field name="Velocity" rank="1"> | ||
4575 | 191 | <prognostic> | ||
4576 | 192 | <mesh name="VelocityMesh"/> | ||
4577 | 193 | <equation name="Boussinesq"/> | ||
4578 | 194 | <spatial_discretisation> | ||
4579 | 195 | <discontinuous_galerkin> | ||
4580 | 196 | <mass_terms> | ||
4581 | 197 | <exclude_mass_terms/> | ||
4582 | 198 | </mass_terms> | ||
4583 | 199 | <viscosity_scheme> | ||
4584 | 200 | <compact_discontinuous_galerkin/> | ||
4585 | 201 | </viscosity_scheme> | ||
4586 | 202 | <advection_scheme> | ||
4587 | 203 | <none/> | ||
4588 | 204 | <integrate_advection_by_parts> | ||
4589 | 205 | <twice/> | ||
4590 | 206 | </integrate_advection_by_parts> | ||
4591 | 207 | </advection_scheme> | ||
4592 | 208 | </discontinuous_galerkin> | ||
4593 | 209 | <conservative_advection> | ||
4594 | 210 | <real_value rank="0">0.0</real_value> | ||
4595 | 211 | </conservative_advection> | ||
4596 | 212 | </spatial_discretisation> | ||
4597 | 213 | <temporal_discretisation> | ||
4598 | 214 | <theta> | ||
4599 | 215 | <real_value rank="0">1.0</real_value> | ||
4600 | 216 | </theta> | ||
4601 | 217 | <relaxation> | ||
4602 | 218 | <real_value rank="0">1.0</real_value> | ||
4603 | 219 | </relaxation> | ||
4604 | 220 | </temporal_discretisation> | ||
4605 | 221 | <solver> | ||
4606 | 222 | <iterative_method name="gmres"> | ||
4607 | 223 | <restart> | ||
4608 | 224 | <integer_value rank="0">30</integer_value> | ||
4609 | 225 | </restart> | ||
4610 | 226 | </iterative_method> | ||
4611 | 227 | <preconditioner name="sor"/> | ||
4612 | 228 | <relative_error> | ||
4613 | 229 | <real_value rank="0">1.0e-10</real_value> | ||
4614 | 230 | </relative_error> | ||
4615 | 231 | <max_iterations> | ||
4616 | 232 | <integer_value rank="0">1000</integer_value> | ||
4617 | 233 | </max_iterations> | ||
4618 | 234 | <never_ignore_solver_failures/> | ||
4619 | 235 | <diagnostics> | ||
4620 | 236 | <monitors/> | ||
4621 | 237 | </diagnostics> | ||
4622 | 238 | </solver> | ||
4623 | 239 | <initial_condition name="WholeMesh"> | ||
4624 | 240 | <constant> | ||
4625 | 241 | <real_value shape="2" dim1="dim" rank="1">0.0 0.0</real_value> | ||
4626 | 242 | </constant> | ||
4627 | 243 | </initial_condition> | ||
4628 | 244 | <boundary_conditions name="no_outflow_top_bottom"> | ||
4629 | 245 | <surface_ids> | ||
4630 | 246 | <integer_value shape="2" rank="1">7 9</integer_value> | ||
4631 | 247 | </surface_ids> | ||
4632 | 248 | <type name="no_normal_flow"/> | ||
4633 | 249 | </boundary_conditions> | ||
4634 | 250 | <vector_field name="Absorption" rank="1"> | ||
4635 | 251 | <diagnostic> | ||
4636 | 252 | <mesh name="DGP0"/> | ||
4637 | 253 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
4638 | 254 | <string_value lines="20" type="python"># get the prescribed fields | ||
4639 | 255 | perm = states["fluid"].scalar_fields["Permeability"] | ||
4640 | 256 | visc = states["fluid"].scalar_fields["Viscosity"] | ||
4641 | 257 | |||
4642 | 258 | # loop the DMmesh_p0 nodes (which are element centred) | ||
4643 | 259 | for n in range(field.node_count): | ||
4644 | 260 | perm_n = perm.node_val(n) | ||
4645 | 261 | visc_n = visc.node_val(n) | ||
4646 | 262 | |||
4647 | 263 | # calc the absorption term | ||
4648 | 264 | sigma_n = visc_n/perm_n | ||
4649 | 265 | |||
4650 | 266 | # set the absorption term | ||
4651 | 267 | field.set(n,sigma_n)</string_value> | ||
4652 | 268 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
4653 | 269 | |||
4654 | 270 | also assume that the velocity is dg</comment> | ||
4655 | 271 | </algorithm> | ||
4656 | 272 | <output/> | ||
4657 | 273 | <stat> | ||
4658 | 274 | <include_in_stat/> | ||
4659 | 275 | </stat> | ||
4660 | 276 | <convergence> | ||
4661 | 277 | <include_in_convergence/> | ||
4662 | 278 | </convergence> | ||
4663 | 279 | <detectors> | ||
4664 | 280 | <include_in_detectors/> | ||
4665 | 281 | </detectors> | ||
4666 | 282 | <steady_state> | ||
4667 | 283 | <include_in_steady_state/> | ||
4668 | 284 | </steady_state> | ||
4669 | 285 | </diagnostic> | ||
4670 | 286 | <include_pressure_correction/> | ||
4671 | 287 | </vector_field> | ||
4672 | 288 | <output/> | ||
4673 | 289 | <stat> | ||
4674 | 290 | <include_in_stat/> | ||
4675 | 291 | <previous_time_step> | ||
4676 | 292 | <exclude_from_stat/> | ||
4677 | 293 | </previous_time_step> | ||
4678 | 294 | <nonlinear_field> | ||
4679 | 295 | <exclude_from_stat/> | ||
4680 | 296 | </nonlinear_field> | ||
4681 | 297 | </stat> | ||
4682 | 298 | <convergence> | ||
4683 | 299 | <include_in_convergence/> | ||
4684 | 300 | </convergence> | ||
4685 | 301 | <detectors> | ||
4686 | 302 | <include_in_detectors/> | ||
4687 | 303 | </detectors> | ||
4688 | 304 | <steady_state> | ||
4689 | 305 | <include_in_steady_state/> | ||
4690 | 306 | </steady_state> | ||
4691 | 307 | <consistent_interpolation/> | ||
4692 | 308 | </prognostic> | ||
4693 | 309 | </vector_field> | ||
4694 | 310 | <scalar_field name="Porosity" rank="0"> | ||
4695 | 311 | <prescribed> | ||
4696 | 312 | <mesh name="DGP0"/> | ||
4697 | 313 | <value name="WholeMesh"> | ||
4698 | 314 | <constant> | ||
4699 | 315 | <real_value rank="0">0.5</real_value> | ||
4700 | 316 | </constant> | ||
4701 | 317 | </value> | ||
4702 | 318 | <output/> | ||
4703 | 319 | <stat/> | ||
4704 | 320 | <detectors> | ||
4705 | 321 | <exclude_from_detectors/> | ||
4706 | 322 | </detectors> | ||
4707 | 323 | </prescribed> | ||
4708 | 324 | </scalar_field> | ||
4709 | 325 | <scalar_field name="Permeability" rank="0"> | ||
4710 | 326 | <prescribed> | ||
4711 | 327 | <mesh name="DGP0"/> | ||
4712 | 328 | <value name="WholeMesh"> | ||
4713 | 329 | <constant> | ||
4714 | 330 | <real_value rank="0">1.0e-10</real_value> | ||
4715 | 331 | </constant> | ||
4716 | 332 | </value> | ||
4717 | 333 | <output/> | ||
4718 | 334 | <stat/> | ||
4719 | 335 | <detectors> | ||
4720 | 336 | <exclude_from_detectors/> | ||
4721 | 337 | </detectors> | ||
4722 | 338 | </prescribed> | ||
4723 | 339 | </scalar_field> | ||
4724 | 340 | <scalar_field name="Viscosity" rank="0"> | ||
4725 | 341 | <prescribed> | ||
4726 | 342 | <mesh name="DGP0"/> | ||
4727 | 343 | <value name="WholeMesh"> | ||
4728 | 344 | <constant> | ||
4729 | 345 | <real_value rank="0">1.0e-04</real_value> | ||
4730 | 346 | </constant> | ||
4731 | 347 | </value> | ||
4732 | 348 | <output/> | ||
4733 | 349 | <stat/> | ||
4734 | 350 | <detectors> | ||
4735 | 351 | <exclude_from_detectors/> | ||
4736 | 352 | </detectors> | ||
4737 | 353 | </prescribed> | ||
4738 | 354 | </scalar_field> | ||
4739 | 355 | <vector_field name="interstitial_velocity" rank="1"> | ||
4740 | 356 | <diagnostic> | ||
4741 | 357 | <algorithm name="vector_python_diagnostic" material_phase_support="multiple"> | ||
4742 | 358 | <string_value lines="20" type="python">phi = states["fluid"].scalar_fields["Porosity"] | ||
4743 | 359 | darcy_vel = states["fluid"].vector_fields["Velocity"] | ||
4744 | 360 | |||
4745 | 361 | for ele in range(field.element_count): | ||
4746 | 362 | phi_ele = phi.node_val(ele) | ||
4747 | 363 | |||
4748 | 364 | factor_ele = 1.0/max(phi_ele,1.0e-08) | ||
4749 | 365 | |||
4750 | 366 | vel_ele = [] | ||
4751 | 367 | for i in range(len(darcy_vel.ele_val(ele))): | ||
4752 | 368 | vel_ele.append(factor_ele*darcy_vel.ele_val(ele)[i]) | ||
4753 | 369 | |||
4754 | 370 | field.set(darcy_vel.ele_nodes(ele),vel_ele)</string_value> | ||
4755 | 371 | <comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements | ||
4756 | 372 | |||
4757 | 373 | also assume that the velocity is dg</comment> | ||
4758 | 374 | </algorithm> | ||
4759 | 375 | <mesh name="VelocityMesh"/> | ||
4760 | 376 | <output/> | ||
4761 | 377 | <stat> | ||
4762 | 378 | <include_in_stat/> | ||
4763 | 379 | </stat> | ||
4764 | 380 | <convergence> | ||
4765 | 381 | <include_in_convergence/> | ||
4766 | 382 | </convergence> | ||
4767 | 383 | <detectors> | ||
4768 | 384 | <include_in_detectors/> | ||
4769 | 385 | </detectors> | ||
4770 | 386 | <steady_state> | ||
4771 | 387 | <include_in_steady_state/> | ||
4772 | 388 | </steady_state> | ||
4773 | 389 | </diagnostic> | ||
4774 | 390 | </vector_field> | ||
4775 | 391 | </material_phase> | ||
4776 | 392 | </fluidity_options> | ||
4777 | 0 | 393 | ||
4778 | === added file 'tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_3d.flml' | |||
4779 | --- tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_3d.flml 1970-01-01 00:00:00 +0000 | |||
4780 | +++ tests/darcy_p0p1cv_pressBCinlet/darcy_p0p1cv_pressBCinlet_3d.flml 2011-12-23 12:05:25 +0000 | |||
4781 | @@ -0,0 +1,398 @@ | |||
4782 | 1 | <?xml version='1.0' encoding='utf-8'?> | ||
4783 | 2 | <fluidity_options> | ||
4784 | 3 | <simulation_name> | ||
4785 | 4 | <string_value lines="1">darcy_p0p1cv_pressBCinlet_3d</string_value> | ||
4786 | 5 | <comment>a simple short test case for darcy flow using the element type p0p1cv for velocity-pressure | ||
4787 | 6 | |||
4788 | 7 | the darcy velocity is solved for and the interstitial velocity is a diagnostic from this (assuming a dg solution) | ||
4789 | 8 | |||
4790 | 9 | it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct | ||
4791 | 10 | |||
4792 | 11 | the darcy flow equation is | ||
4793 | 12 | |||
4794 | 13 | sigma*darcy_vel = - grad P | ||
4795 | 14 | |||
4796 | 15 | sigma is a function of viscosity and permeability which are two input fields that are named in the flml - not on fluidity special names (ie. this doesnt use the porous media object options) | ||
4797 | 16 | |||
4798 | 17 | python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity | ||
4799 | 18 | |||
4800 | 19 | this case has a 1 region 1 material with pressure boundary condition inflow. | ||
4801 | 20 | |||
4802 | 21 | to get a darcy equation the time, stress and advection terms are not included in a bousinessq formulation (to avoid needing to specify a density). Ideally it would be better to actually have a darcy momentum option to simplify the input. | ||
4803 | 22 | |||
4804 | 23 | the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation) | ||
4805 | 24 | |||
4806 | 25 | the geometry is 3d (although this is a 1d problem) and one time step is done (as nothing depends on time).</comment> | ||
4807 | 26 | </simulation_name> | ||
4808 | 27 | <problem_type> | ||
4809 | 28 | <string_value lines="1">fluids</string_value> | ||
4810 | 29 | </problem_type> | ||
4811 | 30 | <geometry> | ||
4812 | 31 | <dimension> | ||
4813 | 32 | <integer_value rank="0">3</integer_value> | ||
4814 | 33 | </dimension> | ||
4815 | 34 | <mesh name="CoordinateMesh"> | ||
4816 | 35 | <from_file file_name="cube"> | ||
4817 | 36 | <format name="gmsh"/> | ||
4818 | 37 | <stat> | ||
4819 | 38 | <include_in_stat/> | ||
4820 | 39 | </stat> | ||
4821 | 40 | </from_file> | ||
4822 | 41 | </mesh> | ||
4823 | 42 | <mesh name="VelocityMesh"> | ||
4824 | 43 | <from_mesh> | ||
4825 | 44 | <mesh name="CoordinateMesh"/> | ||
4826 | 45 | <mesh_shape> | ||
4827 | 46 | <polynomial_degree> | ||
4828 | 47 | <integer_value rank="0">0</integer_value> | ||
4829 | 48 | </polynomial_degree> | ||
4830 | 49 | </mesh_shape> | ||
4831 | 50 | <mesh_continuity> | ||
4832 | 51 | <string_value>discontinuous</string_value> | ||
4833 | 52 | </mesh_continuity> | ||
4834 | 53 | <stat> | ||
4835 | 54 | <exclude_from_stat/> | ||
4836 | 55 | </stat> | ||
4837 | 56 | </from_mesh> | ||
4838 | 57 | </mesh> | ||
4839 | 58 | <mesh name="PressureMesh"> | ||
4840 | 59 | <from_mesh> | ||
4841 | 60 | <mesh name="CoordinateMesh"/> | ||
4842 | 61 | <mesh_shape> | ||
4843 | 62 | <polynomial_degree> | ||
4844 | 63 | <integer_value rank="0">1</integer_value> | ||
4845 | 64 | </polynomial_degree> | ||
4846 | 65 | </mesh_shape> | ||
4847 | 66 | <stat> | ||
4848 | 67 | <exclude_from_stat/> | ||
4849 | 68 | </stat> | ||
4850 | 69 | </from_mesh> | ||
4851 | 70 | </mesh> | ||
4852 | 71 | <mesh name="DGP0"> | ||
4853 | 72 | <from_mesh> | ||
4854 | 73 | <mesh name="CoordinateMesh"/> | ||
4855 | 74 | <mesh_shape> | ||
4856 | 75 | <polynomial_degree> | ||
4857 | 76 | <integer_value rank="0">0</integer_value> | ||
4858 | 77 | </polynomial_degree> | ||
4859 | 78 | </mesh_shape> | ||
4860 | 79 | <mesh_continuity> | ||
4861 | 80 | <string_value>discontinuous</string_value> | ||
4862 | 81 | </mesh_continuity> | ||
4863 | 82 | <stat> | ||
4864 | 83 | <exclude_from_stat/> | ||
4865 | 84 | </stat> | ||
4866 | 85 | </from_mesh> | ||
4867 | 86 | </mesh> | ||
4868 | 87 | <mesh name="OutputMesh"> | ||
4869 | 88 | <from_mesh> | ||
4870 | 89 | <mesh name="CoordinateMesh"/> | ||
4871 | 90 | <mesh_continuity> | ||
4872 | 91 | <string_value>discontinuous</string_value> | ||
4873 | 92 | </mesh_continuity> | ||
4874 | 93 | <stat> | ||
4875 | 94 | <exclude_from_stat/> | ||
4876 | 95 | </stat> | ||
4877 | 96 | </from_mesh> | ||
4878 | 97 | </mesh> | ||
4879 | 98 | <quadrature> | ||
4880 | 99 | <degree> | ||
4881 | 100 | <integer_value rank="0">3</integer_value> | ||
4882 | 101 | </degree> | ||
4883 | 102 | </quadrature> | ||
4884 | 103 | </geometry> | ||
4885 | 104 | <io> | ||
4886 | 105 | <dump_format> | ||
4887 | 106 | <string_value>vtk</string_value> | ||
4888 | 107 | </dump_format> | ||
4889 | 108 | <dump_period_in_timesteps> | ||
4890 | 109 | <constant> | ||
4891 | 110 | <integer_value rank="0">0</integer_value> | ||
4892 | 111 | </constant> | ||
4893 | 112 | </dump_period_in_timesteps> | ||
4894 | 113 | <output_mesh name="OutputMesh"/> | ||
4895 | 114 | <stat/> | ||
4896 | 115 | </io> | ||
4897 | 116 | <timestepping> | ||
4898 | 117 | <current_time> | ||
4899 | 118 | <real_value rank="0">0.0</real_value> | ||
4900 | 119 | </current_time> | ||
4901 | 120 | <timestep> | ||
4902 | 121 | <real_value rank="0">1.0</real_value> | ||
4903 | 122 | </timestep> | ||
4904 | 123 | <finish_time> | ||
4905 | 124 | <real_value rank="0">1.0</real_value> | ||
4906 | 125 | </finish_time> | ||
4907 | 126 | </timestepping> | ||
4908 | 127 | <material_phase name="fluid"> | ||
4909 | 128 | <scalar_field name="Pressure" rank="0"> | ||
4910 | 129 | <prognostic> | ||
4911 | 130 | <mesh name="PressureMesh"/> | ||
4912 | 131 | <spatial_discretisation> | ||
4913 | 132 | <control_volumes/> | ||
4914 | 133 | </spatial_discretisation> | ||
4915 | 134 | <scheme> | ||
4916 | 135 | <poisson_pressure_solution> | ||
4917 | 136 | <string_value lines="1">never</string_value> | ||
4918 | 137 | </poisson_pressure_solution> | ||
4919 | 138 | <use_projection_method/> | ||
4920 | 139 | </scheme> | ||
4921 | 140 | <solver> | ||
4922 | 141 | <iterative_method name="cg"/> | ||
4923 | 142 | <preconditioner name="sor"/> | ||
4924 | 143 | <relative_error> | ||
4925 | 144 | <real_value rank="0">1.0e-10</real_value> | ||
4926 | 145 | </relative_error> | ||
4927 | 146 | <max_iterations> | ||
4928 | 147 | <integer_value rank="0">1000</integer_value> | ||
4929 | 148 | </max_iterations> | ||
4930 | 149 | <never_ignore_solver_failures/> | ||
4931 | 150 | <diagnostics> | ||
4932 | 151 | <monitors/> | ||
4933 | 152 | </diagnostics> | ||
4934 | 153 | </solver> | ||
4935 | 154 | <boundary_conditions name="right_outflow"> | ||
4936 | 155 | <surface_ids> | ||
4937 | 156 | <integer_value shape="1" rank="1">4</integer_value> | ||
4938 | 157 | </surface_ids> | ||
4939 | 158 | <type name="dirichlet"> | ||
4940 | 159 | <apply_weakly/> | ||
4941 | 160 | <constant> | ||
4942 | 161 | <real_value rank="0">0.0</real_value> | ||
4943 | 162 | </constant> | ||
4944 | 163 | </type> | ||
4945 | 164 | </boundary_conditions> | ||
4946 | 165 | <boundary_conditions name="left_inflow"> | ||
4947 | 166 | <surface_ids> | ||
4948 | 167 | <integer_value shape="1" rank="1">3</integer_value> | ||
4949 | 168 | </surface_ids> | ||
4950 | 169 | <type name="dirichlet"> | ||
4951 | 170 | <apply_weakly/> | ||
4952 | 171 | <constant> | ||
4953 | 172 | <real_value rank="0">1.5e+09</real_value> | ||
4954 | 173 | </constant> | ||
4955 | 174 | </type> | ||
4956 | 175 | </boundary_conditions> | ||
4957 | 176 | <output/> | ||
4958 | 177 | <stat/> | ||
4959 | 178 | <convergence> | ||
4960 | 179 | <include_in_convergence/> | ||
4961 | 180 | </convergence> | ||
4962 | 181 | <detectors> | ||
4963 | 182 | <exclude_from_detectors/> | ||
4964 | 183 | </detectors> | ||
4965 | 184 | <steady_state> | ||
4966 | 185 | <include_in_steady_state/> | ||
4967 | 186 | </steady_state> | ||
4968 | 187 | <no_interpolation/> | ||
4969 | 188 | </prognostic> | ||
4970 | 189 | </scalar_field> | ||
4971 | 190 | <vector_field name="Velocity" rank="1"> | ||
4972 | 191 | <prognostic> | ||
4973 | 192 | <mesh name="VelocityMesh"/> | ||
4974 | 193 | <equation name="Boussinesq"/> | ||
4975 | 194 | <spatial_discretisation> | ||
4976 | 195 | <discontinuous_galerkin> | ||
4977 | 196 | <mass_terms> | ||
4978 | 197 | <exclude_mass_terms/> | ||
4979 | 198 | </mass_terms> | ||
4980 | 199 | <viscosity_scheme> | ||
4981 | 200 | <compact_discontinuous_galerkin/> | ||
4982 | 201 | </viscosity_scheme> | ||
4983 | 202 | <advection_scheme> | ||
4984 | 203 | <none/> | ||
4985 | 204 | <integrate_advection_by_parts> | ||
4986 | 205 | <twice/> | ||
4987 | 206 | </integrate_advection_by_parts> | ||
4988 | 207 | </advection_scheme> | ||
4989 | 208 | </discontinuous_galerkin> | ||
4990 | 209 | <conservative_advection> | ||
4991 | 210 | <real_value rank="0">0.0</real_value> | ||
4992 | 211 | </conservative_advection> | ||
4993 | 212 | </spatial_discretisation> | ||
4994 | 213 | <temporal_discretisation> | ||
4995 | 214 | <theta> | ||
4996 | 215 | <real_value rank="0">1.0</real_value> | ||
4997 | 216 | </theta> | ||
4998 | 217 | <relaxation> | ||
4999 | 218 | <real_value rank="0">1.0</real_value> | ||
5000 | 219 | </relaxation> |
Since original merge request, added a very small change to a comment.
Merged latest trunk into branch and re-ran branch buildbot which is green.
Needs a volunteer to review please!