95 PUBLIC navier_stokes_analytic_functions_evaluate
97 PUBLIC navierstokes_equationssetspecificationset
99 PUBLIC navierstokes_equationssetsolutionmethodset
101 PUBLIC navier_stokes_equations_set_setup
103 PUBLIC navierstokes_presolvealeupdateparameters,navierstokes_presolveupdateboundaryconditions, &
104 & navier_stokes_pre_solve_ale_update_mesh
106 PUBLIC navier_stokes_pre_solve, navier_stokes_post_solve
108 PUBLIC navierstokes_problemspecificationset
110 PUBLIC navier_stokes_problem_setup
112 PUBLIC navierstokes_finiteelementresidualevaluate,navierstokes_finiteelementjacobianevaluate
114 PUBLIC navierstokes_boundaryconditionsanalyticcalculate
116 PUBLIC navierstokes_residualbasedstabilisation
118 PUBLIC navierstokes_couple1d0d
120 PUBLIC navierstokes_couplecharacteristics
122 PUBLIC navierstokes_finiteelementpreresidualevaluate
124 PUBLIC navierstokes_controllooppostloop
126 PUBLIC navierstokes_updatemultiscaleboundary
135 SUBROUTINE navierstokes_equationssetsolutionmethodset(EQUATIONS_SET,SOLUTION_METHOD,ERR,ERROR,*)
139 INTEGER(INTG),
INTENT(IN) :: SOLUTION_METHOD
140 INTEGER(INTG),
INTENT(OUT) :: ERR
145 enters(
"NavierStokes_EquationsSetSolutionMethodSet",err,error,*999)
147 IF(
ASSOCIATED(equations_set))
THEN 148 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 149 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
150 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 151 CALL flagerror(
"Equations set specification must have three entries for a Navier-Stokes type equations set.", &
154 SELECT CASE(equations_set%SPECIFICATION(3))
169 SELECT CASE(solution_method)
175 CALL flagerror(
"Not implemented.",err,error,*999)
177 CALL flagerror(
"Not implemented.",err,error,*999)
179 CALL flagerror(
"Not implemented.",err,error,*999)
181 CALL flagerror(
"Not implemented.",err,error,*999)
183 CALL flagerror(
"Not implemented.",err,error,*999)
185 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))// &
187 CALL flagerror(local_error,err,error,*999)
190 local_error=
"Equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
191 &
" is not valid for a Navier-Stokes flow equation type of a fluid mechanics equations set class." 192 CALL flagerror(local_error,err,error,*999)
195 CALL flagerror(
"Equations set is not associated.",err,error,*999)
198 exits(
"NavierStokes_EquationsSetSolutionMethodSet")
200 999 errorsexits(
"NavierStokes_EquationsSetSolutionMethodSet",err,error)
203 END SUBROUTINE navierstokes_equationssetsolutionmethodset
210 SUBROUTINE navierstokes_equationssetspecificationset(equationsSet,specification,err,error,*)
214 INTEGER(INTG),
INTENT(IN) :: specification(:)
215 INTEGER(INTG),
INTENT(OUT) :: err
219 INTEGER(INTG) :: subtype
221 enters(
"NavierStokes_EquationsSetSpecificationSet",err,error,*999)
223 IF(
ASSOCIATED(equationsset))
THEN 224 IF(
SIZE(specification,1)/=3)
THEN 225 CALL flagerror(
"Equations set specification must have three entries for a Navier-Stokes type equations set.", &
228 subtype=specification(3)
246 CALL flagerror(
"Not implemented yet.",err,error,*999)
248 localerror=
"The third equations set specification of "//
trim(
numbertovstring(specification(3),
"*",err,error))// &
249 &
" is not valid for a Navier-Stokes fluid mechanics equations set." 250 CALL flagerror(localerror,err,error,*999)
253 IF(
ALLOCATED(equationsset%specification))
THEN 254 CALL flagerror(
"Equations set specification is already allocated.",err,error,*999)
256 ALLOCATE(equationsset%specification(3),stat=err)
257 IF(err/=0)
CALL flagerror(
"Could not allocate equations set specification.",err,error,*999)
261 CALL flagerror(
"Equations set is not associated.",err,error,*999)
264 exits(
"NavierStokes_EquationsSetSpecificationSet")
266 999
errors(
"NavierStokes_EquationsSetSpecificationSet",err,error)
267 exits(
"NavierStokes_EquationsSetSpecificationSet")
270 END SUBROUTINE navierstokes_equationssetspecificationset
277 SUBROUTINE navier_stokes_equations_set_setup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
282 INTEGER(INTG),
INTENT(OUT) :: ERR
292 TYPE(
field_type),
POINTER :: EQUATIONS_SET_FIELD_FIELD,ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD
294 INTEGER(INTG) :: GEOMETRIC_SCALING_TYPE,GEOMETRIC_MESH_COMPONENT,INDEPENDENT_FIELD_NUMBER_OF_COMPONENTS
295 INTEGER(INTG) :: NUMBER_OF_ANALYTIC_COMPONENTS,DEPENDENT_FIELD_NUMBER_OF_VARIABLES,DEPENDENT_FIELD_NUMBER_OF_COMPONENTS
296 INTEGER(INTG) :: NUMBER_OF_DIMENSIONS,GEOMETRIC_COMPONENT_NUMBER,I,componentIdx,INDEPENDENT_FIELD_NUMBER_OF_VARIABLES
297 INTEGER(INTG) :: MATERIAL_FIELD_NUMBER_OF_VARIABLES,MATERIAL_FIELD_NUMBER_OF_COMPONENTS1,MATERIAL_FIELD_NUMBER_OF_COMPONENTS2
298 INTEGER(INTG) :: elementBasedComponents,nodeBasedComponents,constantBasedComponents
299 INTEGER(INTG) :: EQUATIONS_SET_FIELD_NUMBER_OF_VARIABLES,EQUATIONS_SET_FIELD_NUMBER_OF_COMPONENTS
301 enters(
"NAVIER_STOKES_EQUATIONS_SET_SETUP",err,error,*999)
304 NULLIFY(equations_mapping)
305 NULLIFY(equations_matrices)
306 NULLIFY(geometric_decomposition)
307 NULLIFY(equations_equations_set_field)
308 NULLIFY(equations_set_field_field)
310 IF(
ASSOCIATED(equations_set))
THEN 311 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 312 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
313 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 314 CALL flagerror(
"Equations set specification must have three entries for a Navier-Stokes type equations set.", &
317 SELECT CASE(equations_set%SPECIFICATION(3))
332 SELECT CASE(equations_set_setup%SETUP_TYPE)
337 SELECT CASE(equations_set%SPECIFICATION(3))
341 SELECT CASE(equations_set_setup%ACTION_TYPE)
343 CALL navierstokes_equationssetsolutionmethodset(equations_set, &
351 & setup_type,
"*",err,error))//
" is not implemented for a Navier-Stokes fluid." 352 CALL flagerror(local_error,err,error,*999)
358 SELECT CASE(equations_set_setup%ACTION_TYPE)
360 CALL navierstokes_equationssetsolutionmethodset(equations_set, &
363 equations_set_field_number_of_variables = 1
364 equations_set_field_number_of_components = 1
365 equations_equations_set_field=>equations_set%EQUATIONS_SET_FIELD
366 IF(equations_equations_set_field%EQUATIONS_SET_FIELD_AUTO_CREATED)
THEN 368 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
369 & equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,err,error,*999)
370 equations_set_field_field=>equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD
371 CALL field_label_set(equations_set_field_field,
"Equations Set Field",err,error,*999)
372 CALL field_type_set_and_lock(equations_set_field_field,field_general_type,&
374 CALL field_number_of_variables_set(equations_set_field_field, &
375 & equations_set_field_number_of_variables,err,error,*999)
376 CALL field_variable_types_set_and_lock(equations_set_field_field,&
377 & [field_u_variable_type],err,error,*999)
378 CALL field_variable_label_set(equations_set_field_field,field_u_variable_type, &
379 &
"Penalty Coefficient",err,error,*999)
380 CALL field_data_type_set_and_lock(equations_set_field_field,field_u_variable_type, &
381 & field_dp_type,err,error,*999)
382 CALL field_number_of_components_set_and_lock(equations_set_field_field,&
383 & field_u_variable_type,equations_set_field_number_of_components,err,error,*999)
386 IF(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_AUTO_CREATED)
THEN 387 CALL field_create_finish(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD,err,error,*999)
389 CALL field_component_values_initialise(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
390 & field_u_variable_type,field_values_set_type,1,1.0e4_dp,err,error,*999)
395 & setup_type,
"*",err,error))//
" is not implemented for a Navier-Stokes fluid." 396 CALL flagerror(local_error,err,error,*999)
402 SELECT CASE(equations_set_setup%ACTION_TYPE)
404 CALL navierstokes_equationssetsolutionmethodset(equations_set, &
407 equations_set_field_number_of_variables = 3
408 nodebasedcomponents = 1
409 elementbasedcomponents = 10
410 constantbasedcomponents = 4
411 equations_equations_set_field=>equations_set%EQUATIONS_SET_FIELD
412 IF(equations_equations_set_field%EQUATIONS_SET_FIELD_AUTO_CREATED)
THEN 414 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
415 & equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,err,error,*999)
416 equations_set_field_field=>equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD
417 CALL field_label_set(equations_set_field_field,
"Equations Set Field",err,error,*999)
418 CALL field_type_set_and_lock(equations_set_field_field,field_general_type,&
420 CALL field_number_of_variables_set(equations_set_field_field, &
421 & equations_set_field_number_of_variables,err,error,*999)
422 CALL field_variable_types_set_and_lock(equations_set_field_field,&
423 & [field_u_variable_type,field_v_variable_type,field_u1_variable_type],err,error,*999)
424 CALL field_variable_label_set(equations_set_field_field,field_u_variable_type, &
425 &
"BoundaryFlow",err,error,*999)
426 CALL field_variable_label_set(equations_set_field_field,field_v_variable_type, &
427 &
"ElementMetrics",err,error,*999)
428 CALL field_variable_label_set(equations_set_field_field,field_u1_variable_type, &
429 &
"EquationsConstants",err,error,*999)
430 CALL field_data_type_set_and_lock(equations_set_field_field,field_u_variable_type, &
431 & field_dp_type,err,error,*999)
432 CALL field_data_type_set_and_lock(equations_set_field_field,field_v_variable_type, &
433 & field_dp_type,err,error,*999)
434 CALL field_data_type_set_and_lock(equations_set_field_field,field_u1_variable_type, &
435 & field_dp_type,err,error,*999)
436 CALL field_number_of_components_set_and_lock(equations_set_field_field,&
437 & field_u_variable_type,nodebasedcomponents,err,error,*999)
438 CALL field_number_of_components_set_and_lock(equations_set_field_field,&
439 & field_v_variable_type,elementbasedcomponents,err,error,*999)
440 CALL field_number_of_components_set_and_lock(equations_set_field_field,&
441 & field_u1_variable_type,constantbasedcomponents,err,error,*999)
443 local_error=
"User-specified fields are not yet implemented for an equations set field field & 445 & setup_type,
"*",err,error))//
" for a Navier-Stokes fluid." 448 IF(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_AUTO_CREATED)
THEN 449 CALL field_create_finish(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD,err,error,*999)
451 nodebasedcomponents = 1
452 elementbasedcomponents = 10
453 constantbasedcomponents = 4
455 CALL field_component_values_initialise(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
456 & field_u_variable_type,field_values_set_type,1,0.0_dp,err,error,*999)
458 DO componentidx=1,elementbasedcomponents-1
459 CALL field_component_values_initialise(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
460 & field_v_variable_type,field_values_set_type,componentidx,0.0_dp,err,error,*999)
463 CALL field_component_values_initialise(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
464 & field_v_variable_type,field_values_set_type,elementbasedcomponents,-1.0_dp,err,error,*999)
466 CALL field_component_values_initialise(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
467 & field_u1_variable_type,field_values_set_type,1,0.0_dp,err,error,*999)
469 CALL field_component_values_initialise(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
470 & field_u1_variable_type,field_values_set_type,2,1.0_dp,err,error,*999)
472 CALL field_component_values_initialise(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
473 & field_u1_variable_type,field_values_set_type,3,0.0_dp,err,error,*999)
475 CALL field_component_values_initialise(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
476 & field_u1_variable_type,field_values_set_type,4,1.0_dp,err,error,*999)
478 local_error=
"User-specified fields are not yet implemented for an equations set field field & 480 & setup_type,
"*",err,error))//
" for a Navier-Stokes fluid." 485 & setup_type,
"*",err,error))//
" is not implemented for a Navier-Stokes fluid." 486 CALL flagerror(local_error,err,error,*999)
489 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
491 &
" is invalid for a Navier-Stokes equation." 492 CALL flagerror(local_error,err,error,*999)
498 SELECT CASE(equations_set%SPECIFICATION(3))
507 SELECT CASE(equations_set_setup%ACTION_TYPE)
509 equations_set_field_number_of_components = 1
510 equations_equations_set_field=>equations_set%EQUATIONS_SET_FIELD
511 equations_set_field_field=>equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD
512 IF(equations_equations_set_field%EQUATIONS_SET_FIELD_AUTO_CREATED)
THEN 513 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
514 CALL field_mesh_decomposition_set_and_lock(equations_set_field_field,&
515 & geometric_decomposition,err,error,*999)
516 CALL field_geometric_field_set_and_lock(equations_set_field_field,&
517 & equations_set%GEOMETRY%GEOMETRIC_FIELD,err,error,*999)
518 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
519 & 1,geometric_component_number,err,error,*999)
520 DO componentidx = 1, equations_set_field_number_of_components
521 CALL field_component_mesh_component_set_and_lock(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
522 & field_u_variable_type,componentidx,geometric_component_number,err,error,*999)
523 CALL field_component_interpolation_set_and_lock(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
524 & field_u_variable_type,componentidx,field_constant_interpolation,err,error,*999)
527 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
528 CALL field_scaling_type_set(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD,geometric_scaling_type, &
534 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
536 &
" is invalid for a linear diffusion equation." 537 CALL flagerror(local_error,err,error,*999)
543 SELECT CASE(equations_set_setup%ACTION_TYPE)
545 nodebasedcomponents = 1
546 elementbasedcomponents = 10
547 constantbasedcomponents = 4
548 equations_equations_set_field=>equations_set%EQUATIONS_SET_FIELD
549 equations_set_field_field=>equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD
550 IF(equations_equations_set_field%EQUATIONS_SET_FIELD_AUTO_CREATED)
THEN 551 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
552 CALL field_mesh_decomposition_set_and_lock(equations_set_field_field,&
553 & geometric_decomposition,err,error,*999)
554 CALL field_geometric_field_set_and_lock(equations_set_field_field,&
555 & equations_set%GEOMETRY%GEOMETRIC_FIELD,err,error,*999)
556 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
557 & 1,geometric_component_number,err,error,*999)
558 CALL field_component_mesh_component_set_and_lock(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
559 & field_u_variable_type,1,geometric_component_number,err,error,*999)
560 CALL field_component_interpolation_set_and_lock(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
561 & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
563 DO componentidx = 1, elementbasedcomponents
564 CALL field_component_mesh_component_set_and_lock(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
565 & field_v_variable_type,componentidx,geometric_component_number,err,error,*999)
566 CALL field_component_interpolation_set_and_lock(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
567 & field_v_variable_type,componentidx,field_element_based_interpolation,err,error,*999)
570 DO componentidx = 1, constantbasedcomponents
571 CALL field_component_mesh_component_set_and_lock(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
572 & field_u1_variable_type,componentidx,geometric_component_number,err,error,*999)
573 CALL field_component_interpolation_set_and_lock(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
574 & field_u1_variable_type,componentidx,field_constant_interpolation,err,error,*999)
577 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
578 CALL field_scaling_type_set(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD,geometric_scaling_type, &
586 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
588 &
" is invalid for a linear diffusion equation." 589 CALL flagerror(local_error,err,error,*999)
592 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
593 &
" is invalid for a Navier-Stokes equation." 594 CALL flagerror(local_error,err,error,*999)
600 SELECT CASE(equations_set%SPECIFICATION(3))
608 SELECT CASE(equations_set_setup%ACTION_TYPE)
611 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 613 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
614 & equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
615 CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,
"Dependent Field",err,error,*999)
616 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
617 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
618 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
619 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
620 & geometric_decomposition,err,error,*999)
621 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
622 & geometric_field,err,error,*999)
623 dependent_field_number_of_variables=2
624 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
625 & dependent_field_number_of_variables,err,error,*999)
626 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,[field_u_variable_type, &
627 & field_deludeln_variable_type],err,error,*999)
628 CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
629 &
"U",err,error,*999)
630 CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
631 &
"del U/del n",err,error,*999)
632 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
633 & field_vector_dimension_type,err,error,*999)
634 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
635 & field_vector_dimension_type,err,error,*999)
636 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
637 & field_dp_type,err,error,*999)
638 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
639 & field_dp_type,err,error,*999)
640 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
641 & number_of_dimensions,err,error,*999)
643 dependent_field_number_of_components=number_of_dimensions+1
644 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
645 & field_u_variable_type,dependent_field_number_of_components,err,error,*999)
646 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
647 & field_deludeln_variable_type,dependent_field_number_of_components,err,error,*999)
649 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
650 & 1,geometric_mesh_component,err,error,*999)
651 DO componentidx=1,dependent_field_number_of_components
652 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
653 & field_u_variable_type,componentidx,geometric_mesh_component,err,error,*999)
654 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
655 & field_deludeln_variable_type,componentidx,geometric_mesh_component,err,error,*999)
657 SELECT CASE(equations_set%SOLUTION_METHOD)
659 DO componentidx=1,dependent_field_number_of_components
660 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
661 & field_u_variable_type,componentidx,field_node_based_interpolation,err,error,*999)
662 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
663 & field_deludeln_variable_type,componentidx,field_node_based_interpolation,err,error,*999)
666 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
667 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
670 CALL flagerror(
"Not implemented.",err,error,*999)
672 CALL flagerror(
"Not implemented.",err,error,*999)
674 CALL flagerror(
"Not implemented.",err,error,*999)
676 CALL flagerror(
"Not implemented.",err,error,*999)
678 CALL flagerror(
"Not implemented.",err,error,*999)
680 local_error=
"The solution method of " &
682 CALL flagerror(local_error,err,error,*999)
686 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
687 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
688 dependent_field_number_of_variables=2
689 CALL field_number_of_variables_check(equations_set_setup%FIELD,dependent_field_number_of_variables,err,error,*999)
690 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type, &
691 & field_deludeln_variable_type],err,error,*999)
692 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
693 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type, &
695 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
697 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
698 & field_vector_dimension_type,err,error,*999)
699 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
700 & number_of_dimensions,err,error,*999)
702 dependent_field_number_of_components=number_of_dimensions+1
703 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
704 & dependent_field_number_of_components,err,error,*999)
705 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
706 & dependent_field_number_of_components,err,error,*999)
707 SELECT CASE(equations_set%SOLUTION_METHOD)
709 DO componentidx=1,dependent_field_number_of_components
710 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type, &
711 & componentidx,field_node_based_interpolation,err,error,*999)
712 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
713 & componentidx,field_node_based_interpolation,err,error,*999)
716 CALL flagerror(
"Not implemented.",err,error,*999)
718 CALL flagerror(
"Not implemented.",err,error,*999)
720 CALL flagerror(
"Not implemented.",err,error,*999)
722 CALL flagerror(
"Not implemented.",err,error,*999)
724 CALL flagerror(
"Not implemented.",err,error,*999)
727 &
"*",err,error))//
" is invalid." 728 CALL flagerror(local_error,err,error,*999)
733 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 734 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
735 CALL field_number_of_components_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
736 & dependent_field_number_of_components,err,error,*999)
740 CALL field_parameter_set_create(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
741 & field_pressure_values_set_type,err,error,*999)
742 DO componentidx=1,dependent_field_number_of_components
743 CALL field_component_values_initialise(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
744 & field_pressure_values_set_type,componentidx,0.0_dp,err,error,*999)
751 &
"*",err,error))//
" is invalid for a Navier-Stokes fluid." 752 CALL flagerror(local_error,err,error,*999)
756 SELECT CASE(equations_set_setup%ACTION_TYPE)
760 dependent_field_number_of_variables=5
762 dependent_field_number_of_components=2
763 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 766 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
767 & equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
769 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
771 CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,
"Dependent Field",err,error,*999)
773 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
774 & field_dependent_type,err,error,*999)
776 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
779 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
780 & geometric_decomposition,err,error,*999)
782 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
783 & geometric_field,err,error,*999)
785 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
786 & dependent_field_number_of_variables,err,error,*999)
787 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,[field_u_variable_type, &
788 & field_deludeln_variable_type,field_v_variable_type,field_u1_variable_type,field_u2_variable_type], &
790 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
791 & field_vector_dimension_type,err,error,*999)
792 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
793 & field_vector_dimension_type,err,error,*999)
794 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_v_variable_type, &
795 & field_vector_dimension_type,err,error,*999)
796 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u1_variable_type, &
797 & field_vector_dimension_type,err,error,*999)
798 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u2_variable_type, &
799 & field_vector_dimension_type,err,error,*999)
801 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
802 & field_dp_type,err,error,*999)
803 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
804 & field_dp_type,err,error,*999)
805 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_v_variable_type, &
806 & field_dp_type,err,error,*999)
807 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u1_variable_type, &
808 & field_dp_type,err,error,*999)
809 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u2_variable_type, &
810 & field_dp_type,err,error,*999)
812 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
813 & number_of_dimensions,err,error,*999)
815 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
816 & field_u_variable_type,dependent_field_number_of_components,err,error,*999)
817 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
818 & field_deludeln_variable_type,dependent_field_number_of_components,err,error,*999)
820 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
821 & field_v_variable_type,dependent_field_number_of_components,err,error,*999)
822 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
823 & field_u1_variable_type,dependent_field_number_of_components,err,error,*999)
824 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
825 & field_u2_variable_type,dependent_field_number_of_components,err,error,*999)
826 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
827 & number_of_dimensions,geometric_mesh_component,err,error,*999)
829 DO i=1,dependent_field_number_of_components
830 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
831 & field_u_variable_type,i,geometric_mesh_component,err,error,*999)
832 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
833 & field_deludeln_variable_type,i,geometric_mesh_component,err,error,*999)
834 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
835 & field_v_variable_type,i,geometric_mesh_component,err,error,*999)
836 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
837 & field_u1_variable_type,i,geometric_mesh_component,err,error,*999)
838 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
839 & field_u2_variable_type,i,geometric_mesh_component,err,error,*999)
841 SELECT CASE(equations_set%SOLUTION_METHOD)
844 DO i=1,dependent_field_number_of_components
845 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
846 & field_u_variable_type,i,field_node_based_interpolation,err,error,*999)
847 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
848 & field_deludeln_variable_type,i,field_node_based_interpolation,err,error,*999)
849 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
850 & field_u1_variable_type,1,field_node_based_interpolation,err,error,*999)
851 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
852 & field_u2_variable_type,1,field_node_based_interpolation,err,error,*999)
854 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
856 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type, &
859 CALL flagerror(
"Not implemented.",err,error,*999)
861 CALL flagerror(
"Not implemented.",err,error,*999)
863 CALL flagerror(
"Not implemented.",err,error,*999)
865 CALL flagerror(
"Not implemented.",err,error,*999)
867 CALL flagerror(
"Not implemented.",err,error,*999)
869 local_error=
"The solution method of " &
871 CALL flagerror(local_error,err,error,*999)
875 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
876 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
877 CALL field_number_of_variables_check(equations_set_setup%FIELD,dependent_field_number_of_variables, &
879 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type, &
880 & field_deludeln_variable_type,field_v_variable_type,field_u1_variable_type,field_u2_variable_type], &
882 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
883 & field_vector_dimension_type,err,error,*999)
884 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
885 & field_vector_dimension_type,err,error,*999)
886 CALL field_dimension_check(equations_set_setup%FIELD,field_v_variable_type, &
887 & field_vector_dimension_type,err,error,*999)
888 CALL field_dimension_check(equations_set_setup%FIELD,field_u1_variable_type, &
889 & field_vector_dimension_type,err,error,*999)
890 CALL field_dimension_check(equations_set_setup%FIELD,field_u2_variable_type, &
891 & field_vector_dimension_type,err,error,*999)
893 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
894 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type, &
896 CALL field_data_type_check(equations_set_setup%FIELD,field_v_variable_type,field_dp_type,err,error,*999)
897 CALL field_data_type_check(equations_set_setup%FIELD,field_u1_variable_type,field_dp_type,err,error,*999)
898 CALL field_data_type_check(equations_set_setup%FIELD,field_u2_variable_type,field_dp_type,err,error,*999)
899 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
900 & number_of_dimensions,err,error,*999)
902 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
903 & dependent_field_number_of_components,err,error,*999)
904 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
905 & dependent_field_number_of_components,err,error,*999)
907 CALL field_number_of_components_check(equations_set_setup%FIELD,field_v_variable_type, &
908 & dependent_field_number_of_components,err,error,*999)
909 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u1_variable_type, &
910 & dependent_field_number_of_components,err,error,*999)
911 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u2_variable_type, &
912 & dependent_field_number_of_components,err,error,*999)
913 SELECT CASE(equations_set%SOLUTION_METHOD)
915 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
916 & field_node_based_interpolation,err,error,*999)
917 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
918 & field_node_based_interpolation,err,error,*999)
919 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_v_variable_type,1, &
920 & field_node_based_interpolation,err,error,*999)
921 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u1_variable_type,1, &
922 & field_node_based_interpolation,err,error,*999)
923 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u2_variable_type,1, &
924 & field_node_based_interpolation,err,error,*999)
926 CALL flagerror(
"Not implemented.",err,error,*999)
928 CALL flagerror(
"Not implemented.",err,error,*999)
930 CALL flagerror(
"Not implemented.",err,error,*999)
932 CALL flagerror(
"Not implemented.",err,error,*999)
934 CALL flagerror(
"Not implemented.",err,error,*999)
937 &
"*",err,error))//
" is invalid." 938 CALL flagerror(local_error,err,error,*999)
943 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 944 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
949 &
"*",err,error))//
" is invalid for a Navier-Stokes fluid." 950 CALL flagerror(local_error,err,error,*999)
954 SELECT CASE(equations_set_setup%ACTION_TYPE)
957 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 960 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
961 & equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
963 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
965 CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,
"Dependent Field",err,error,*999)
967 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
968 & field_dependent_type,err,error,*999)
970 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
973 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
974 & geometric_decomposition,err,error,*999)
976 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
977 & geometric_field,err,error,*999)
979 dependent_field_number_of_variables=5
980 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
981 & dependent_field_number_of_variables,err,error,*999)
983 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,[field_u_variable_type, &
984 & field_deludeln_variable_type,field_v_variable_type,field_u1_variable_type,field_u2_variable_type, &
985 & field_u3_variable_type],err,error,*999)
987 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,[field_u_variable_type, &
988 & field_deludeln_variable_type,field_v_variable_type,field_u1_variable_type,field_u2_variable_type], &
991 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
992 & field_vector_dimension_type,err,error,*999)
993 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
994 & field_vector_dimension_type,err,error,*999)
995 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_v_variable_type, &
996 & field_vector_dimension_type,err,error,*999)
997 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u1_variable_type, &
998 & field_vector_dimension_type,err,error,*999)
999 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u2_variable_type, &
1000 & field_vector_dimension_type,err,error,*999)
1001 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
1002 & field_dp_type,err,error,*999)
1003 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
1004 & field_dp_type,err,error,*999)
1005 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_v_variable_type, &
1006 & field_dp_type,err,error,*999)
1007 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u1_variable_type, &
1008 & field_dp_type,err,error,*999)
1009 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u2_variable_type, &
1010 & field_dp_type,err,error,*999)
1011 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1012 & number_of_dimensions,err,error,*999)
1014 dependent_field_number_of_components=2
1015 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1016 & field_u_variable_type,dependent_field_number_of_components,err,error,*999)
1017 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1018 & field_deludeln_variable_type,dependent_field_number_of_components,err,error,*999)
1019 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1020 & field_v_variable_type,dependent_field_number_of_components,err,error,*999)
1021 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1022 & field_u1_variable_type,1,err,error,*999)
1023 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1024 & field_u2_variable_type,1,err,error,*999)
1025 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1026 & number_of_dimensions,geometric_mesh_component,err,error,*999)
1028 DO i=1,dependent_field_number_of_components
1029 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1030 & field_u_variable_type,i,geometric_mesh_component,err,error,*999)
1031 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1032 & field_deludeln_variable_type,i,geometric_mesh_component,err,error,*999)
1033 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1034 & field_v_variable_type,i,geometric_mesh_component,err,error,*999)
1035 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1036 & field_u1_variable_type,i,geometric_mesh_component,err,error,*999)
1037 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1038 & field_u2_variable_type,i,geometric_mesh_component,err,error,*999)
1040 SELECT CASE(equations_set%SOLUTION_METHOD)
1043 DO i=1,dependent_field_number_of_components
1044 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1045 & field_u_variable_type,i,field_node_based_interpolation,err,error,*999)
1046 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1047 & field_deludeln_variable_type,i,field_node_based_interpolation,err,error,*999)
1048 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1049 & field_v_variable_type,i,field_node_based_interpolation,err,error,*999)
1050 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1051 & field_u1_variable_type,i,field_node_based_interpolation,err,error,*999)
1052 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1053 & field_u2_variable_type,i,field_node_based_interpolation,err,error,*999)
1055 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
1057 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type, &
1060 CALL flagerror(
"Not implemented.",err,error,*999)
1062 CALL flagerror(
"Not implemented.",err,error,*999)
1064 CALL flagerror(
"Not implemented.",err,error,*999)
1066 CALL flagerror(
"Not implemented.",err,error,*999)
1068 CALL flagerror(
"Not implemented.",err,error,*999)
1070 local_error=
"The solution method of " &
1072 CALL flagerror(local_error,err,error,*999)
1076 dependent_field_number_of_variables=5
1078 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1079 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
1080 CALL field_number_of_variables_check(equations_set_setup%FIELD,dependent_field_number_of_variables,err,error,*999)
1081 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type, &
1082 & field_deludeln_variable_type,field_v_variable_type,field_u1_variable_type,field_u2_variable_type], &
1084 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
1085 & field_vector_dimension_type,err,error,*999)
1086 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
1087 & field_vector_dimension_type,err,error,*999)
1088 CALL field_dimension_check(equations_set_setup%FIELD,field_v_variable_type, &
1089 & field_vector_dimension_type,err,error,*999)
1090 CALL field_dimension_check(equations_set_setup%FIELD,field_u1_variable_type, &
1091 & field_vector_dimension_type,err,error,*999)
1092 CALL field_dimension_check(equations_set_setup%FIELD,field_u2_variable_type, &
1093 & field_vector_dimension_type,err,error,*999)
1094 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1095 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type, &
1097 CALL field_data_type_check(equations_set_setup%FIELD,field_v_variable_type,field_dp_type,err,error,*999)
1098 CALL field_data_type_check(equations_set_setup%FIELD,field_u1_variable_type,field_dp_type,err,error,*999)
1099 CALL field_data_type_check(equations_set_setup%FIELD,field_u2_variable_type,field_dp_type,err,error,*999)
1100 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1101 & number_of_dimensions,err,error,*999)
1103 dependent_field_number_of_components=2
1104 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1105 & dependent_field_number_of_components,err,error,*999)
1106 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
1107 & dependent_field_number_of_components,err,error,*999)
1108 CALL field_number_of_components_check(equations_set_setup%FIELD,field_v_variable_type, &
1109 & dependent_field_number_of_components,err,error,*999)
1110 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u1_variable_type, &
1111 & dependent_field_number_of_components,err,error,*999)
1112 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u2_variable_type, &
1113 & dependent_field_number_of_components,err,error,*999)
1114 SELECT CASE(equations_set%SOLUTION_METHOD)
1116 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1117 & field_node_based_interpolation,err,error,*999)
1118 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
1119 & field_node_based_interpolation,err,error,*999)
1120 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_v_variable_type,1, &
1121 & field_node_based_interpolation,err,error,*999)
1122 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u1_variable_type,1, &
1123 & field_node_based_interpolation,err,error,*999)
1124 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u2_variable_type,1, &
1125 & field_node_based_interpolation,err,error,*999)
1127 CALL flagerror(
"Not implemented.",err,error,*999)
1129 CALL flagerror(
"Not implemented.",err,error,*999)
1131 CALL flagerror(
"Not implemented.",err,error,*999)
1133 CALL flagerror(
"Not implemented.",err,error,*999)
1135 CALL flagerror(
"Not implemented.",err,error,*999)
1138 &
"*",err,error))//
" is invalid." 1139 CALL flagerror(local_error,err,error,*999)
1144 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 1145 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
1150 &
"*",err,error))//
" is invalid for a Navier-Stokes fluid." 1151 CALL flagerror(local_error,err,error,*999)
1154 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
1155 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1156 &
" is invalid for a Navier-Stokes equation." 1157 CALL flagerror(local_error,err,error,*999)
1163 SELECT CASE(equations_set%SPECIFICATION(3))
1165 SELECT CASE(equations_set_setup%ACTION_TYPE)
1168 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 1170 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
1171 & equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1172 CALL field_label_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,
"Independent Field",err,error,*999)
1173 CALL field_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_general_type,err,error,*999)
1174 CALL field_dependent_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1175 & field_independent_type,err,error,*999)
1176 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
1178 CALL field_mesh_decomposition_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1179 & geometric_decomposition,err,error,*999)
1180 CALL field_geometric_field_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,equations_set% &
1181 & geometry%GEOMETRIC_FIELD,err,error,*999)
1182 independent_field_number_of_variables=1
1183 CALL field_number_of_variables_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1184 & independent_field_number_of_variables,err,error,*999)
1185 CALL field_variable_types_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1186 & [field_u_variable_type],err,error,*999)
1187 CALL field_variable_label_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1188 &
"U",err,error,*999)
1189 CALL field_dimension_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1190 & field_vector_dimension_type,err,error,*999)
1191 CALL field_data_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1192 & field_dp_type,err,error,*999)
1193 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1194 & number_of_dimensions,err,error,*999)
1196 independent_field_number_of_components=number_of_dimensions
1197 CALL field_number_of_components_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1198 & field_u_variable_type,independent_field_number_of_components,err,error,*999)
1200 DO componentidx=1,independent_field_number_of_components
1201 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1202 & componentidx,geometric_mesh_component,err,error,*999)
1203 CALL field_component_mesh_component_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1204 & field_u_variable_type,componentidx,geometric_mesh_component,err,error,*999)
1206 SELECT CASE(equations_set%SOLUTION_METHOD)
1209 DO componentidx=1,independent_field_number_of_components
1210 CALL field_component_interpolation_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1211 & field_u_variable_type,componentidx,field_node_based_interpolation,err,error,*999)
1214 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1215 CALL field_scaling_type_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
1218 local_error=
"The solution method of " &
1220 CALL flagerror(local_error,err,error,*999)
1224 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1225 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1226 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1227 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1228 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1229 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1231 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1232 & number_of_dimensions,err,error,*999)
1234 independent_field_number_of_components=number_of_dimensions
1235 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1236 & independent_field_number_of_components,err,error,*999)
1237 SELECT CASE(equations_set%SOLUTION_METHOD)
1239 DO componentidx=1,independent_field_number_of_components
1240 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1241 & field_node_based_interpolation,err,error,*999)
1245 &
"*",err,error))//
" is invalid." 1246 CALL flagerror(local_error,err,error,*999)
1251 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 1252 CALL field_create_finish(equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1253 CALL field_parameter_set_create(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1254 & field_mesh_displacement_set_type,err,error,*999)
1255 CALL field_parameter_set_create(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1256 & field_mesh_velocity_set_type,err,error,*999)
1257 CALL field_parameter_set_create(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1258 & field_boundary_set_type,err,error,*999)
1261 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1262 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1263 &
" is invalid for a standard Navier-Stokes fluid" 1264 CALL flagerror(local_error,err,error,*999)
1268 SELECT CASE(equations_set_setup%ACTION_TYPE)
1272 independent_field_number_of_variables=1
1274 independent_field_number_of_components=2
1276 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 1278 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
1279 & equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1281 CALL field_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_general_type,err,error,*999)
1283 CALL field_label_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,
"Independent Field",err,error, &
1286 CALL field_dependent_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1287 & field_independent_type,err,error,*999)
1289 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
1292 CALL field_mesh_decomposition_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1293 & geometric_decomposition,err,error,*999)
1295 CALL field_geometric_field_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,equations_set% &
1296 & geometry%GEOMETRIC_FIELD,err,error,*999)
1298 CALL field_number_of_variables_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1299 & independent_field_number_of_variables,err,error,*999)
1300 CALL field_variable_types_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1301 & [field_u_variable_type],err,error,*999)
1302 CALL field_dimension_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1303 & field_vector_dimension_type,err,error,*999)
1304 CALL field_data_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1305 & field_dp_type,err,error,*999)
1307 CALL field_number_of_components_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1308 & field_u_variable_type,independent_field_number_of_components,err,error,*999)
1309 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1310 & 1,geometric_mesh_component,err,error,*999)
1312 DO i=1,independent_field_number_of_components
1313 CALL field_component_mesh_component_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1314 & field_u_variable_type,i,geometric_mesh_component,err,error,*999)
1316 SELECT CASE(equations_set%SOLUTION_METHOD)
1319 DO componentidx=1,independent_field_number_of_components
1320 CALL field_component_interpolation_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1321 & field_u_variable_type,componentidx,field_node_based_interpolation,err,error,*999)
1323 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
1325 CALL field_scaling_type_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,geometric_scaling_type, &
1328 DO componentidx=1,independent_field_number_of_components
1329 CALL field_component_interpolation_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1330 & field_u_variable_type,componentidx,field_node_based_interpolation,err,error,*999)
1332 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
1334 CALL field_scaling_type_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,geometric_scaling_type, &
1337 local_error=
"The solution method of " &
1339 CALL flagerror(local_error,err,error,*999)
1343 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1344 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1345 CALL field_number_of_variables_check(equations_set_setup%FIELD,independent_field_number_of_variables, &
1347 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1348 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1350 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1351 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1352 & independent_field_number_of_components,err,error,*999)
1356 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 1357 CALL field_create_finish(equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1360 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1361 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1362 &
" is invalid for a standard Navier-Stokes fluid" 1363 CALL flagerror(local_error,err,error,*999)
1367 SELECT CASE(equations_set_setup%ACTION_TYPE)
1371 independent_field_number_of_variables=1
1373 independent_field_number_of_components=2
1375 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 1379 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1380 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1381 CALL field_number_of_variables_check(equations_set_setup%FIELD,independent_field_number_of_variables, &
1383 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1384 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1386 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1387 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1388 & independent_field_number_of_components,err,error,*999)
1392 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 1393 CALL field_create_finish(equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1396 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1397 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1398 &
" is invalid for a standard Navier-Stokes fluid" 1399 CALL flagerror(local_error,err,error,*999)
1404 SELECT CASE(equations_set_setup%ACTION_TYPE)
1407 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 1409 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
1410 & equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1411 CALL field_label_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,
"Independent Field",err,error,*999)
1412 CALL field_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_general_type,err,error,*999)
1413 CALL field_dependent_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1414 & field_independent_type,err,error,*999)
1415 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
1417 CALL field_mesh_decomposition_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1418 & geometric_decomposition,err,error,*999)
1419 CALL field_geometric_field_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,equations_set% &
1420 & geometry%GEOMETRIC_FIELD,err,error,*999)
1421 independent_field_number_of_variables=1
1422 CALL field_number_of_variables_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1423 & independent_field_number_of_variables,err,error,*999)
1424 CALL field_variable_types_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1425 & [field_u_variable_type],err,error,*999)
1426 CALL field_variable_label_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1427 &
"U",err,error,*999)
1428 CALL field_dimension_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1429 & field_vector_dimension_type,err,error,*999)
1430 CALL field_data_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1431 & field_dp_type,err,error,*999)
1432 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1433 & number_of_dimensions,err,error,*999)
1435 independent_field_number_of_components=number_of_dimensions
1436 CALL field_number_of_components_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1437 & field_u_variable_type,independent_field_number_of_components,err,error,*999)
1439 DO componentidx=1,independent_field_number_of_components
1440 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1441 & componentidx,geometric_mesh_component,err,error,*999)
1442 CALL field_component_mesh_component_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1443 & field_u_variable_type,componentidx,geometric_mesh_component,err,error,*999)
1445 SELECT CASE(equations_set%SOLUTION_METHOD)
1448 DO componentidx=1,independent_field_number_of_components
1449 CALL field_component_interpolation_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1450 & field_u_variable_type,componentidx,field_node_based_interpolation,err,error,*999)
1453 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1454 CALL field_scaling_type_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
1457 local_error=
"The solution method of " &
1459 CALL flagerror(local_error,err,error,*999)
1463 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1464 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1465 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1466 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1467 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1468 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1470 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1471 & number_of_dimensions,err,error,*999)
1473 independent_field_number_of_components=number_of_dimensions
1474 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1475 & independent_field_number_of_components,err,error,*999)
1476 SELECT CASE(equations_set%SOLUTION_METHOD)
1478 DO componentidx=1,independent_field_number_of_components
1479 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1480 & field_node_based_interpolation,err,error,*999)
1484 &
"*",err,error))//
" is invalid." 1485 CALL flagerror(local_error,err,error,*999)
1490 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 1491 CALL field_create_finish(equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1492 CALL field_parameter_set_create(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1493 & field_mesh_displacement_set_type,err,error,*999)
1494 CALL field_parameter_set_create(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1495 & field_mesh_velocity_set_type,err,error,*999)
1496 CALL field_parameter_set_create(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1497 & field_boundary_set_type,err,error,*999)
1500 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1501 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1502 &
" is invalid for a standard Navier-Stokes fluid" 1503 CALL flagerror(local_error,err,error,*999)
1506 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
1507 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1508 &
" is invalid for a Navier-Stokes equation." 1509 CALL flagerror(local_error,err,error,*999)
1515 SELECT CASE(equations_set%SPECIFICATION(3))
1528 SELECT CASE(equations_set_setup%ACTION_TYPE)
1531 equations_analytic=>equations_set%ANALYTIC
1532 IF(
ASSOCIATED(equations_analytic))
THEN 1533 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 1534 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1535 IF(
ASSOCIATED(dependent_field))
THEN 1536 equations_materials=>equations_set%MATERIALS
1537 IF(
ASSOCIATED(equations_materials))
THEN 1538 IF(equations_materials%MATERIALS_FINISHED)
THEN 1539 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
1540 IF(
ASSOCIATED(geometric_field))
THEN 1541 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1542 & number_of_dimensions,err,error,*999)
1543 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
1548 IF(number_of_dimensions/=2)
THEN 1549 local_error=
"The number of geometric dimensions of "// &
1551 &
" is invalid. The analytic function type of "// &
1553 &
" requires that there be 2 geometric dimensions." 1554 CALL flagerror(local_error,err,error,*999)
1557 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1558 & 1,field_constant_interpolation,err,error,*999)
1559 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1560 & 2,field_constant_interpolation,err,error,*999)
1562 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_setup%ANALYTIC_FUNCTION_TYPE
1563 number_of_analytic_components=4
1574 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_setup%ANALYTIC_FUNCTION_TYPE
1576 number_of_analytic_components=2
1578 local_error=
"The third equations set specification must by a TRANSIENT1D or COUPLED1D0D "// &
1579 &
"to use an analytic function of type "// &
1581 CALL flagerror(local_error,err,error,*999)
1585 IF(number_of_dimensions<2 .OR. number_of_dimensions>3)
THEN 1586 local_error=
"The number of geometric dimensions of "// &
1588 &
" is invalid. The analytic function type of "// &
1590 &
" requires that there be 2 or 3 geometric dimensions." 1591 CALL flagerror(local_error,err,error,*999)
1594 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_setup%ANALYTIC_FUNCTION_TYPE
1596 number_of_analytic_components=10
1601 IF(number_of_dimensions/=2)
THEN 1602 local_error=
"The number of geometric dimensions of "// &
1604 &
" is invalid. The analytic function type of "// &
1606 &
" requires that there be 2 geometric dimensions." 1607 CALL flagerror(local_error,err,error,*999)
1610 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1611 & 1,field_constant_interpolation,err,error,*999)
1612 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1613 & 2,field_constant_interpolation,err,error,*999)
1615 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE=equations_set_setup%ANALYTIC_FUNCTION_TYPE
1616 number_of_analytic_components=2
1651 local_error=
"The specified analytic function type of "// &
1653 &
" is invalid for an analytic Navier-Stokes problem." 1654 CALL flagerror(local_error,err,error,*999)
1657 IF(number_of_analytic_components>=1)
THEN 1658 IF(equations_analytic%ANALYTIC_FIELD_AUTO_CREATED)
THEN 1660 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
1661 & equations_analytic%ANALYTIC_FIELD,err,error,*999)
1662 CALL field_label_set(equations_analytic%ANALYTIC_FIELD,
"Analytic Field",err,error,*999)
1663 CALL field_type_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_general_type,err,error,*999)
1664 CALL field_dependent_type_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_independent_type, &
1666 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
1668 CALL field_mesh_decomposition_set_and_lock(equations_analytic%ANALYTIC_FIELD, &
1669 & geometric_decomposition,err,error,*999)
1670 CALL field_geometric_field_set_and_lock(equations_analytic%ANALYTIC_FIELD,equations_set%GEOMETRY% &
1671 & geometric_field,err,error,*999)
1672 CALL field_number_of_variables_set_and_lock(equations_analytic%ANALYTIC_FIELD,1,err,error,*999)
1673 CALL field_variable_types_set_and_lock(equations_analytic%ANALYTIC_FIELD,[field_u_variable_type], &
1675 CALL field_variable_label_set(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1676 &
"Analytic",err,error,*999)
1677 CALL field_dimension_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1678 & field_vector_dimension_type,err,error,*999)
1679 CALL field_data_type_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1680 & field_dp_type,err,error,*999)
1682 CALL field_number_of_components_set_and_lock(equations_analytic%ANALYTIC_FIELD, &
1683 & field_u_variable_type,number_of_analytic_components,err,error,*999)
1685 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD, &
1686 & field_u_variable_type,1,geometric_mesh_component,err,error,*999)
1687 DO componentidx=1,number_of_analytic_components
1688 CALL field_component_mesh_component_set(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1689 & componentidx,geometric_mesh_component,err,error,*999)
1690 IF(equations_set_setup%ANALYTIC_FUNCTION_TYPE == &
1692 CALL field_component_interpolation_set(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1693 & componentidx,field_node_based_interpolation,err,error,*999)
1695 CALL field_component_interpolation_set(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1696 & componentidx,field_constant_interpolation,err,error,*999)
1700 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
1702 CALL field_scaling_type_set(equations_analytic%ANALYTIC_FIELD,geometric_scaling_type,err,error,*999)
1705 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1706 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1707 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1708 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1709 IF(number_of_analytic_components==1)
THEN 1710 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
1711 & field_scalar_dimension_type,err,error,*999)
1713 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
1714 & field_vector_dimension_type,err,error,*999)
1716 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type, &
1718 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1719 & number_of_analytic_components,err,error,*999)
1723 CALL flagerror(
"Equations set materials is not finished.",err,error,*999)
1726 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
1729 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
1732 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
1735 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
1738 CALL flagerror(
"Equations analytic is not associated.",err,error,*999)
1741 equations_analytic=>equations_set%ANALYTIC
1742 IF(
ASSOCIATED(equations_analytic))
THEN 1743 analytic_field=>equations_analytic%ANALYTIC_FIELD
1744 IF(
ASSOCIATED(analytic_field))
THEN 1745 IF(equations_analytic%ANALYTIC_FIELD_AUTO_CREATED)
THEN 1747 CALL field_create_finish(equations_analytic%ANALYTIC_FIELD,err,error,*999)
1749 SELECT CASE(equations_set%SPECIFICATION(3))
1752 SELECT CASE(equations_analytic%ANALYTIC_FUNCTION_TYPE)
1755 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1756 & field_values_set_type,1,0.0_dp,err,error,*999)
1757 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1758 & field_values_set_type,2,0.0_dp,err,error,*999)
1759 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1760 & field_values_set_type,3,0.0_dp,err,error,*999)
1761 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1762 & field_values_set_type,4,0.0_dp,err,error,*999)
1764 local_error=
"The analytic function type of "// &
1766 &
" is invalid for an analytical static Navier-Stokes equation." 1767 CALL flagerror(local_error,err,error,*999)
1773 SELECT CASE(equations_analytic%ANALYTIC_FUNCTION_TYPE)
1776 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1777 & field_values_set_type,1,0.0_dp,err,error,*999)
1778 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1779 & field_values_set_type,2,0.0_dp,err,error,*999)
1782 number_of_analytic_components = 10
1783 DO componentidx = 1,number_of_analytic_components
1784 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1785 & field_values_set_type,componentidx,0.0_dp,err,error,*999)
1788 local_error=
"The analytic function type of "// &
1790 &
" is invalid for an analytical transient Navier-Stokes equation." 1791 CALL flagerror(local_error,err,error,*999)
1797 SELECT CASE(equations_analytic%ANALYTIC_FUNCTION_TYPE)
1803 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
1804 & field_values_set_type,1,0.0_dp,err,error,*999)
1806 local_error=
"The analytic function type of "// &
1808 &
" is invalid for a 1D Navier-Stokes equation." 1809 CALL flagerror(local_error,err,error,*999)
1812 local_error=
"The third equations set specification of "// &
1814 &
" is invalid for an analytical Navier-Stokes equation set." 1815 CALL flagerror(local_error,err,error,*999)
1820 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
1823 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1824 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1825 &
" is invalid for an analytic Navier-Stokes problem." 1826 CALL flagerror(local_error,err,error,*999)
1829 local_error=
"The third equations set specification of "// &
1831 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1832 &
" is invalid for a Navier-Stokes equation set." 1833 CALL flagerror(local_error,err,error,*999)
1839 SELECT CASE(equations_set%SPECIFICATION(3))
1846 material_field_number_of_variables=1
1847 material_field_number_of_components1=2
1848 SELECT CASE(equations_set_setup%ACTION_TYPE)
1851 equations_materials=>equations_set%MATERIALS
1852 IF(
ASSOCIATED(equations_materials))
THEN 1853 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 1856 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
1857 & equations_set%MATERIALS%MATERIALS_FIELD,err,error,*999)
1858 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
1860 CALL field_label_set(equations_materials%MATERIALS_FIELD,
"Materials Field",err,error,*999)
1861 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type, &
1863 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
1866 CALL field_mesh_decomposition_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD, &
1867 & geometric_decomposition,err,error,*999)
1869 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
1870 & geometric_field,err,error,*999)
1871 CALL field_number_of_variables_set(equations_materials%MATERIALS_FIELD, &
1872 & material_field_number_of_variables,err,error,*999)
1873 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD, &
1874 &[field_u_variable_type],err,error,*999)
1875 CALL field_variable_label_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1876 &
"Materials",err,error,*999)
1877 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1878 & field_vector_dimension_type,err,error,*999)
1879 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1880 & field_dp_type,err,error,*999)
1881 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD, &
1882 & field_u_variable_type,material_field_number_of_components1,err,error,*999)
1883 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD, &
1884 & field_u_variable_type,1,geometric_component_number,err,error,*999)
1885 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1886 & 1,geometric_component_number,err,error,*999)
1887 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1888 & 1,field_constant_interpolation,err,error,*999)
1889 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1890 & 2,field_constant_interpolation,err,error,*999)
1892 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
1894 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
1897 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
1898 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1899 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1900 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1901 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
1902 & field_vector_dimension_type,err,error,*999)
1903 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type, &
1905 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1906 & number_of_dimensions,err,error,*999)
1907 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
1910 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
1914 equations_materials=>equations_set%MATERIALS
1915 IF(
ASSOCIATED(equations_materials))
THEN 1916 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 1918 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
1921 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1922 & field_values_set_type,1,1.0_dp,err,error,*999)
1923 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1924 & field_values_set_type,2,1.0_dp,err,error,*999)
1927 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
1931 & err,error))//
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*", &
1932 & err,error))//
" is invalid for Navier-Stokes equation." 1933 CALL flagerror(local_error,err,error,*999)
1936 material_field_number_of_variables=2
1937 material_field_number_of_components1=2
1938 material_field_number_of_components2=2
1939 SELECT CASE(equations_set_setup%ACTION_TYPE)
1942 equations_materials=>equations_set%MATERIALS
1943 IF(
ASSOCIATED(equations_materials))
THEN 1944 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 1947 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
1948 & equations_set%MATERIALS%MATERIALS_FIELD,err,error,*999)
1949 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
1951 CALL field_label_set(equations_materials%MATERIALS_FIELD,
"MaterialsField",err,error,*999)
1952 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type, &
1954 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
1957 CALL field_mesh_decomposition_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD, &
1958 & geometric_decomposition,err,error,*999)
1960 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
1961 & geometric_field,err,error,*999)
1962 CALL field_number_of_variables_set(equations_materials%MATERIALS_FIELD, &
1963 & material_field_number_of_variables,err,error,*999)
1964 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD, &
1965 &[field_u_variable_type,field_v_variable_type],err,error,*999)
1967 CALL field_variable_label_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1968 &
"MaterialsConstants",err,error,*999)
1969 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1970 & field_vector_dimension_type,err,error,*999)
1971 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1972 & field_dp_type,err,error,*999)
1973 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD, &
1974 & field_u_variable_type,material_field_number_of_components1,err,error,*999)
1975 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD, &
1976 & field_u_variable_type,1,geometric_component_number,err,error,*999)
1977 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1978 & 1,geometric_component_number,err,error,*999)
1979 DO componentidx=1,material_field_number_of_components2
1980 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1981 & componentidx,field_constant_interpolation,err,error,*999)
1984 CALL field_variable_label_set(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1985 &
"ConstitutiveValues",err,error,*999)
1986 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1987 & field_vector_dimension_type,err,error,*999)
1988 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1989 & field_dp_type,err,error,*999)
1990 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD, &
1991 & field_v_variable_type,material_field_number_of_components2,err,error,*999)
1992 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD, &
1993 & field_u_variable_type,1,geometric_component_number,err,error,*999)
1994 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1995 & 1,geometric_component_number,err,error,*999)
1996 DO componentidx=1,material_field_number_of_components2
1997 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1998 & componentidx,field_gauss_point_based_interpolation,err,error,*999)
2001 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
2003 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
2006 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
2007 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
2008 CALL field_number_of_variables_check(equations_set_setup%FIELD,material_field_number_of_variables,err,error,*999)
2009 CALL field_variable_types_check(equations_set_setup%FIELD, &
2010 & [field_u_variable_type,field_v_variable_type],err,error,*999)
2012 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
2013 & field_vector_dimension_type,err,error,*999)
2014 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type, &
2016 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2017 & number_of_dimensions,err,error,*999)
2018 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
2019 & material_field_number_of_components1,err,error,*999)
2021 CALL field_dimension_check(equations_set_setup%FIELD,field_v_variable_type, &
2022 & field_vector_dimension_type,err,error,*999)
2023 CALL field_data_type_check(equations_set_setup%FIELD,field_v_variable_type,field_dp_type, &
2025 CALL field_number_of_components_check(equations_set_setup%FIELD,field_v_variable_type, &
2026 & material_field_number_of_components2,err,error,*999)
2029 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2033 equations_materials=>equations_set%MATERIALS
2034 IF(
ASSOCIATED(equations_materials))
THEN 2035 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 2037 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
2039 DO componentidx=1,material_field_number_of_components2
2040 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2041 & field_values_set_type,componentidx,1.0_dp,err,error,*999)
2044 DO componentidx=1,material_field_number_of_components2
2045 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
2046 & field_values_set_type,componentidx,1.0_dp,err,error,*999)
2050 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2054 & err,error))//
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*", &
2055 & err,error))//
" is invalid for Navier-Stokes equation." 2056 CALL flagerror(local_error,err,error,*999)
2063 material_field_number_of_variables=2
2064 material_field_number_of_components1=8
2065 material_field_number_of_components2=3
2066 SELECT CASE(equations_set_setup%ACTION_TYPE)
2069 equations_materials=>equations_set%MATERIALS
2070 IF(
ASSOCIATED(equations_materials))
THEN 2071 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 2074 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
2075 & equations_set%MATERIALS%MATERIALS_FIELD,err,error,*999)
2076 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
2078 CALL field_label_set(equations_materials%MATERIALS_FIELD,
"Materials Field",err,error,*999)
2079 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type, &
2081 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
2084 CALL field_mesh_decomposition_set_and_lock(equations_set%MATERIALS%MATERIALS_FIELD, &
2085 & geometric_decomposition,err,error,*999)
2087 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
2088 & geometric_field,err,error,*999)
2089 CALL field_number_of_variables_set(equations_materials%MATERIALS_FIELD, &
2090 & material_field_number_of_variables,err,error,*999)
2092 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD, &
2093 &[field_u_variable_type,field_v_variable_type,field_u1_variable_type],err,error,*999)
2094 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2095 & field_vector_dimension_type,err,error,*999)
2096 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
2097 & field_vector_dimension_type,err,error,*999)
2099 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2100 & field_dp_type,err,error,*999)
2101 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
2102 & field_dp_type,err,error,*999)
2103 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD, &
2104 & field_u_variable_type,material_field_number_of_components1,err,error,*999)
2105 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD, &
2106 & field_v_variable_type,material_field_number_of_components2,err,error,*999)
2107 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD, &
2108 & field_u_variable_type,1,geometric_component_number,err,error,*999)
2109 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2110 & 1,geometric_component_number,err,error,*999)
2111 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
2112 & 1,geometric_component_number,err,error,*999)
2113 DO i=1,material_field_number_of_components1
2114 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2115 & i,field_constant_interpolation,err,error,*999)
2117 DO i=1,material_field_number_of_components2
2118 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
2119 & i,field_node_based_interpolation,err,error,*999)
2122 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD, &
2123 & field_u_variable_type,1,geometric_component_number,err,error,*999)
2125 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
2127 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
2130 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
2131 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
2132 CALL field_number_of_variables_check(equations_set_setup%FIELD,material_field_number_of_variables,err,error,*999)
2133 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type,field_v_variable_type], &
2136 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
2137 & field_vector_dimension_type,err,error,*999)
2138 CALL field_dimension_check(equations_set_setup%FIELD,field_v_variable_type, &
2139 & field_vector_dimension_type,err,error,*999)
2140 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type, &
2142 CALL field_data_type_check(equations_set_setup%FIELD,field_v_variable_type,field_dp_type, &
2144 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
2145 & material_field_number_of_components1,err,error,*999)
2146 CALL field_number_of_components_check(equations_set_setup%FIELD,field_v_variable_type, &
2147 & material_field_number_of_components2,err,error,*999)
2150 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2154 equations_materials=>equations_set%MATERIALS
2155 IF(
ASSOCIATED(equations_materials))
THEN 2156 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 2158 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
2161 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2165 & err,error))//
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*", &
2166 & err,error))//
" is invalid for Navier-Stokes equation." 2167 CALL flagerror(local_error,err,error,*999)
2170 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
2171 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2172 &
" is invalid for a Navier-Stokes equation." 2173 CALL flagerror(local_error,err,error,*999)
2179 SELECT CASE(equations_set%SPECIFICATION(3))
2188 SELECT CASE(equations_set_setup%ACTION_TYPE)
2196 & err,error))//
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*", &
2197 & err,error))//
" is invalid for a Navier-Stokes fluid." 2198 CALL flagerror(local_error,err,error,*999)
2201 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
2202 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2203 &
" is invalid for a Navier-Stokes equation." 2204 CALL flagerror(local_error,err,error,*999)
2210 SELECT CASE(equations_set%SPECIFICATION(3))
2214 SELECT CASE(equations_set_setup%ACTION_TYPE)
2216 equations_materials=>equations_set%MATERIALS
2217 IF(
ASSOCIATED(equations_materials))
THEN 2218 IF(equations_materials%MATERIALS_FINISHED)
THEN 2223 CALL flagerror(
"Equations set materials has not been finished.",err,error,*999)
2226 CALL flagerror(
"Equations materials is not associated.",err,error,*999)
2229 SELECT CASE(equations_set%SOLUTION_METHOD)
2247 SELECT CASE(equations%SPARSITY_TYPE)
2263 local_error=
"The equations matrices sparsity type of "// &
2265 CALL flagerror(local_error,err,error,*999)
2285 SELECT CASE(equations%SPARSITY_TYPE)
2301 local_error=
"The equations matrices sparsity type of "// &
2303 CALL flagerror(local_error,err,error,*999)
2307 CALL flagerror(
"Not implemented.",err,error,*999)
2309 CALL flagerror(
"Not implemented.",err,error,*999)
2311 CALL flagerror(
"Not implemented.",err,error,*999)
2313 CALL flagerror(
"Not implemented.",err,error,*999)
2315 CALL flagerror(
"Not implemented.",err,error,*999)
2318 &
"*",err,error))//
" is invalid." 2319 CALL flagerror(local_error,err,error,*999)
2322 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2323 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2324 &
" is invalid for a Navier-stokes equation." 2325 CALL flagerror(local_error,err,error,*999)
2338 SELECT CASE(equations_set_setup%ACTION_TYPE)
2340 equations_materials=>equations_set%MATERIALS
2341 IF(
ASSOCIATED(equations_materials))
THEN 2342 IF(equations_materials%MATERIALS_FINISHED)
THEN 2347 CALL flagerror(
"Equations set materials has not been finished.",err,error,*999)
2350 CALL flagerror(
"Equations materials is not associated.",err,error,*999)
2353 SELECT CASE(equations_set%SOLUTION_METHOD)
2372 SELECT CASE(equations%SPARSITY_TYPE)
2389 local_error=
"The equations matrices sparsity type of "// &
2391 CALL flagerror(local_error,err,error,*999)
2395 CALL flagerror(
"Not implemented.",err,error,*999)
2397 CALL flagerror(
"Not implemented.",err,error,*999)
2399 CALL flagerror(
"Not implemented.",err,error,*999)
2401 CALL flagerror(
"Not implemented.",err,error,*999)
2403 CALL flagerror(
"Not implemented.",err,error,*999)
2406 &
"*",err,error))//
" is invalid." 2407 CALL flagerror(local_error,err,error,*999)
2410 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2411 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2412 &
" is invalid for a Navier-Stokes equation." 2413 CALL flagerror(local_error,err,error,*999)
2416 SELECT CASE(equations_set_setup%ACTION_TYPE)
2418 equations_materials=>equations_set%MATERIALS
2419 IF(
ASSOCIATED(equations_materials))
THEN 2420 IF(equations_materials%MATERIALS_FINISHED)
THEN 2425 CALL flagerror(
"Equations set materials has not been finished.",err,error,*999)
2428 CALL flagerror(
"Equations materials is not associated.",err,error,*999)
2431 SELECT CASE(equations_set%SOLUTION_METHOD)
2449 SELECT CASE(equations%SPARSITY_TYPE)
2465 local_error=
"The equations matrices sparsity type of "// &
2467 CALL flagerror(local_error,err,error,*999)
2471 CALL flagerror(
"Not implemented.",err,error,*999)
2473 CALL flagerror(
"Not implemented.",err,error,*999)
2475 CALL flagerror(
"Not implemented.",err,error,*999)
2477 CALL flagerror(
"Not implemented.",err,error,*999)
2479 CALL flagerror(
"Not implemented.",err,error,*999)
2482 &
"*",err,error))//
" is invalid." 2483 CALL flagerror(local_error,err,error,*999)
2486 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2487 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2488 &
" is invalid for a Navier-Stokes equation." 2489 CALL flagerror(local_error,err,error,*999)
2492 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
2493 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2494 &
" is invalid for a Navier-Stokes equation." 2495 CALL flagerror(local_error,err,error,*999)
2498 local_error=
"The setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2499 &
" is invalid for a Navier-Stokes fluid." 2500 CALL flagerror(local_error,err,error,*999)
2503 local_error=
"The equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
2504 &
" does not equal a Navier-Stokes fluid subtype." 2505 CALL flagerror(local_error,err,error,*999)
2508 CALL flagerror(
"Equations set is not associated.",err,error,*999)
2511 exits(
"NAVIER_STOKES_EQUATIONS_SET_SETUP")
2513 999 errorsexits(
"NAVIER_STOKES_EQUATIONS_SET_SETUP",err,error)
2516 END SUBROUTINE navier_stokes_equations_set_setup
2523 SUBROUTINE navier_stokes_pre_solve(SOLVER,ERR,ERROR,*)
2527 INTEGER(INTG),
INTENT(OUT) :: ERR
2540 TYPE(
solver_type),
POINTER :: SOLVER2,cellmlSolver
2543 INTEGER(INTG) :: solver_matrix_idx,iteration
2544 REAL(DP) :: timeIncrement,currentTime
2548 enters(
"NAVIER_STOKES_PRE_SOLVE",err,error,*999)
2550 IF(
ASSOCIATED(solver))
THEN 2551 solvers=>solver%SOLVERS
2552 IF(
ASSOCIATED(solvers))
THEN 2553 control_loop=>solvers%CONTROL_LOOP
2554 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 2555 IF(.NOT.
ALLOCATED(control_loop%problem%specification))
THEN 2556 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
2557 ELSE IF(
SIZE(control_loop%problem%specification,1)<3)
THEN 2558 CALL flagerror(
"Problem specification must have three entries for a Navier-Stokes problem.",err,error,*999)
2562 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(1))
2564 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
2566 solver_equations=>solver%SOLVER_EQUATIONS
2567 IF(
ASSOCIATED(solver_equations))
THEN 2568 solver_mapping=>solver_equations%SOLVER_MAPPING
2569 IF(
ASSOCIATED(solver_mapping))
THEN 2571 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
2572 IF(
ASSOCIATED(equations_set))
THEN 2573 equations_analytic=>equations_set%ANALYTIC
2574 IF(
ASSOCIATED(equations_analytic))
THEN 2576 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2579 CALL flagerror(
"Equations set is not associated.",err,error,*999)
2582 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
2585 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
2589 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2592 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2595 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2597 nonlinearsolver=>solver%DYNAMIC_SOLVER%NONLINEAR_SOLVER%NONLINEAR_SOLVER
2598 IF(
ASSOCIATED(nonlinearsolver))
THEN 2600 cellmlsolver=>nonlinearsolver%NEWTON_SOLVER%CELLML_EVALUATOR_SOLVER
2601 IF(
ASSOCIATED(cellmlsolver))
THEN 2606 CALL flagerror(
"Nonlinear solver is not associated.",err,error,*999)
2616 SELECT CASE(solver%SOLVE_TYPE)
2623 iteration = control_loop%WHILE_LOOP%ITERATION_NUMBER
2624 equations_set=>solver%SOLVER_EQUATIONS%SOLVER_MAPPING%EQUATIONS_SETS(1)%PTR
2625 dependentfield=>equations_set%DEPENDENT%DEPENDENT_FIELD
2629 NULLIFY(fieldvariable)
2630 CALL field_variable_get(dependentfield,field_u_variable_type,fieldvariable,err,error,*999)
2631 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_input_data1_set_type)%PTR))
THEN 2632 CALL field_parameter_set_create(dependentfield,field_u_variable_type, &
2633 & field_input_data1_set_type,err,error,*999)
2634 CALL field_parameter_set_create(dependentfield,field_u_variable_type, &
2635 & field_input_data2_set_type,err,error,*999)
2637 CALL field_parameter_sets_copy(dependentfield,field_u_variable_type,field_values_set_type, &
2638 & field_input_data1_set_type,1.0_dp,err,error,*999)
2639 CALL field_parameter_sets_copy(dependentfield,field_u_variable_type,field_residual_set_type, &
2640 & field_input_data2_set_type,1.0_dp,err,error,*999)
2642 IF(iteration == 1)
THEN 2643 NULLIFY(fieldvariable)
2644 CALL field_variable_get(dependentfield,field_u_variable_type,fieldvariable,err,error,*999)
2645 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_upwind_values_set_type)%PTR))
THEN 2646 CALL field_parameter_set_create(dependentfield,field_u_variable_type, &
2647 & field_upwind_values_set_type,err,error,*999)
2656 IF(solver%global_number==2)
THEN 2658 solver_equations=>solver%SOLVER_EQUATIONS
2659 IF(
ASSOCIATED(solver_equations))
THEN 2660 solver_mapping=>solver_equations%SOLVER_MAPPING
2661 IF(
ASSOCIATED(solver_mapping))
THEN 2662 solver_matrices=>solver_equations%SOLVER_MATRICES
2663 IF(
ASSOCIATED(solver_matrices))
THEN 2664 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
2665 solver_matrix=>solver_matrices%MATRICES(solver_matrix_idx)%PTR
2666 IF(
ASSOCIATED(solver_matrix))
THEN 2667 solver_matrix%UPDATE_MATRIX=.true.
2669 CALL flagerror(
"Solver Matrix is not associated.",err,error,*999)
2673 CALL flagerror(
"Solver Matrices is not associated.",err,error,*999)
2675 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
2676 IF(
ASSOCIATED(equations_set))
THEN 2677 dependentfield=>equations_set%DEPENDENT%DEPENDENT_FIELD
2678 IF(
ASSOCIATED(dependentfield))
THEN 2679 CALL field_parameter_sets_copy(dependentfield,field_u_variable_type,field_input_data1_set_type, &
2680 & field_values_set_type,1.0_dp,err,error,*999)
2681 CALL field_parameter_sets_copy(dependentfield,field_u_variable_type,field_input_data2_set_type, &
2682 & field_residual_set_type,1.0_dp,err,error,*999)
2684 CALL flagerror(
"Dependent field is not associated.",err,error,*999)
2687 CALL flagerror(
"Equations set is not associated.",err,error,*999)
2690 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
2693 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
2700 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2715 &
" is invalid for a 1D Navier-Stokes problem." 2716 CALL flagerror(local_error,err,error,*999)
2721 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2725 CALL navier_stokes_pre_solve_ale_update_mesh(solver,err,error,*999)
2727 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2733 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2735 IF(
ASSOCIATED(solver2%DYNAMIC_SOLVER))
THEN 2736 solver2%DYNAMIC_SOLVER%ALE=.false.
2738 CALL flagerror(
"Dynamic solver is not associated for ALE problem.",err,error,*999)
2741 CALL navierstokes_presolvealeupdateparameters(solver,err,error,*999)
2745 IF(solver%DYNAMIC_SOLVER%ALE)
THEN 2747 CALL navier_stokes_pre_solve_ale_update_mesh(solver,err,error,*999)
2749 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2751 CALL flagerror(
"Mesh motion calculation not successful for ALE problem.",err,error,*999)
2754 CALL flagerror(
"Solver type is not associated for ALE problem.",err,error,*999)
2757 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
2758 &
" is not valid for a Navier-Stokes fluid type of a fluid mechanics problem class." 2759 CALL flagerror(local_error,err,error,*999)
2762 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(2))
2764 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
2772 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2774 IF(
ASSOCIATED(solver2%DYNAMIC_SOLVER))
THEN 2775 solver2%DYNAMIC_SOLVER%ALE=.false.
2777 CALL flagerror(
"Dynamic solver is not associated for ALE problem.",err,error,*999)
2780 CALL navierstokes_presolvealeupdateparameters(solver,err,error,*999)
2784 IF(solver%DYNAMIC_SOLVER%ALE)
THEN 2786 CALL navierstokes_presolveupdateboundaryconditions(solver,err,error,*999)
2788 CALL flagerror(
"Mesh motion calculation not successful for ALE problem.",err,error,*999)
2791 CALL flagerror(
"Solver type is not associated for ALE problem.",err,error,*999)
2794 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
2795 &
" is not valid for a FiniteElasticity-NavierStokes type of a multi physics problem class." 2796 CALL flagerror(local_error,err,error,*999)
2799 local_error=
"Problem type "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(2),
"*",err,error))// &
2800 &
" is not valid for NAVIER_STOKES_PRE_SOLVE of a multi physics problem class." 2801 CALL flagerror(local_error,err,error,*999)
2804 local_error=
"Problem class "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(1),
"*",err,error))// &
2805 &
" is not valid for Navier-Stokes fluid types." 2806 CALL flagerror(local_error,err,error,*999)
2809 CALL flagerror(
"Problem is not associated.",err,error,*999)
2812 CALL flagerror(
"Solvers are not associated.",err,error,*999)
2815 CALL flagerror(
"Solver is not associated.",err,error,*999)
2818 exits(
"NAVIER_STOKES_PRE_SOLVE")
2820 999 errorsexits(
"NAVIER_STOKES_PRE_SOLVE",err,error)
2823 END SUBROUTINE navier_stokes_pre_solve
2830 SUBROUTINE navierstokes_problemspecificationset(problem,problemSpecification,err,error,*)
2834 INTEGER(INTG),
INTENT(IN) :: problemSpecification(:)
2835 INTEGER(INTG),
INTENT(OUT) :: err
2839 INTEGER(INTG) :: problemSubtype
2841 enters(
"NavierStokes_ProblemSpecificationSet",err,error,*999)
2843 IF(
ASSOCIATED(problem))
THEN 2844 IF(
SIZE(problemspecification,1)==3)
THEN 2845 problemsubtype=problemspecification(3)
2846 SELECT CASE(problemsubtype)
2863 CALL flagerror(
"Not implemented yet.",err,error,*999)
2865 localerror=
"The third problem specification of "//
trim(
numbertovstring(problemsubtype,
"*",err,error))// &
2866 &
" is not valid for a Navier-Stokes fluid mechanics problem." 2867 CALL flagerror(localerror,err,error,*999)
2869 IF(
ALLOCATED(problem%specification))
THEN 2870 CALL flagerror(
"Problem specification is already allocated.",err,error,*999)
2872 ALLOCATE(problem%specification(3),stat=err)
2873 IF(err/=0)
CALL flagerror(
"Could not allocate problem specification.",err,error,*999)
2877 CALL flagerror(
"Navier-Stokes problem specification must have three entries.",err,error,*999)
2880 CALL flagerror(
"Problem is not associated.",err,error,*999)
2883 exits(
"NavierStokes_ProblemSpecificationSet")
2885 999
errors(
"NavierStokes_ProblemSpecificationSet",err,error)
2886 exits(
"NavierStokes_ProblemSpecificationSet")
2889 END SUBROUTINE navierstokes_problemspecificationset
2896 SUBROUTINE navier_stokes_problem_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
2901 INTEGER(INTG),
INTENT(OUT) :: ERR
2906 TYPE(
control_loop_type),
POINTER :: iterativeWhileLoop,iterativeWhileLoop2,simpleLoop
2909 TYPE(
solver_type),
POINTER :: SOLVER, MESH_SOLVER,BIF_SOLVER,cellmlSolver
2912 enters(
"NAVIER_STOKES_PROBLEM_SETUP",err,error,*999)
2915 NULLIFY(bif_solver_equations)
2916 NULLIFY(cellmlsolver)
2917 NULLIFY(cellml_equations)
2918 NULLIFY(control_loop)
2919 NULLIFY(control_loop_root)
2920 NULLIFY(mesh_solver)
2921 NULLIFY(mesh_solver_equations)
2923 NULLIFY(solver_equations)
2926 IF(
ASSOCIATED(problem))
THEN 2927 IF(.NOT.
ALLOCATED(problem%specification))
THEN 2928 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
2929 ELSE IF(
SIZE(problem%specification,1)<3)
THEN 2930 CALL flagerror(
"Problem specification must have three entries for a Navier-Stokes problem.",err,error,*999)
2932 SELECT CASE(problem%SPECIFICATION(3))
2936 SELECT CASE(problem_setup%SETUP_TYPE)
2938 SELECT CASE(problem_setup%ACTION_TYPE)
2944 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
2946 &
" is invalid for a Navier-Stokes fluid." 2947 CALL flagerror(local_error,err,error,*999)
2950 SELECT CASE(problem_setup%ACTION_TYPE)
2956 control_loop_root=>problem%CONTROL_LOOP
2960 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
2962 &
" is invalid for a Navier-Stokes fluid." 2963 CALL flagerror(local_error,err,error,*999)
2967 control_loop_root=>problem%CONTROL_LOOP
2969 SELECT CASE(problem_setup%ACTION_TYPE)
2985 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
2987 &
" is invalid for a Navier-Stokes fluid." 2988 CALL flagerror(local_error,err,error,*999)
2991 SELECT CASE(problem_setup%ACTION_TYPE)
2994 control_loop_root=>problem%CONTROL_LOOP
3006 control_loop_root=>problem%CONTROL_LOOP
3015 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
3017 &
" is invalid for a Navier-Stokes fluid." 3018 CALL flagerror(local_error,err,error,*999)
3021 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
3022 &
" is invalid for a Navier-Stokes fluid." 3023 CALL flagerror(local_error,err,error,*999)
3030 SELECT CASE(problem_setup%SETUP_TYPE)
3032 SELECT CASE(problem_setup%ACTION_TYPE)
3038 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
3040 &
" is invalid for a transient Navier-Stokes fluid." 3041 CALL flagerror(local_error,err,error,*999)
3044 SELECT CASE(problem_setup%ACTION_TYPE)
3051 control_loop_root=>problem%CONTROL_LOOP
3055 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
3057 &
" is invalid for a transient Navier-Stokes fluid." 3058 CALL flagerror(local_error,err,error,*999)
3062 control_loop_root=>problem%CONTROL_LOOP
3064 SELECT CASE(problem_setup%ACTION_TYPE)
3091 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
3093 &
" is invalid for a transient Navier-Stokes fluid." 3094 CALL flagerror(local_error,err,error,*999)
3097 SELECT CASE(problem_setup%ACTION_TYPE)
3100 control_loop_root=>problem%CONTROL_LOOP
3113 control_loop_root=>problem%CONTROL_LOOP
3122 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
3124 &
" is invalid for a Navier-Stokes fluid." 3125 CALL flagerror(local_error,err,error,*999)
3128 SELECT CASE(problem_setup%ACTION_TYPE)
3131 control_loop_root=>problem%CONTROL_LOOP
3143 control_loop_root=>problem%CONTROL_LOOP
3155 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
3157 &
" is invalid for a CellML setup for a transient Navier-Stokes equation." 3158 CALL flagerror(local_error,err,error,*999)
3161 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
3162 &
" is invalid for a transient Navier-Stokes fluid." 3163 CALL flagerror(local_error,err,error,*999)
3172 SELECT CASE(problem_setup%SETUP_TYPE)
3174 SELECT CASE(problem_setup%ACTION_TYPE)
3180 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
3182 &
" is invalid for Coupled1dDaeNavierStokes equation." 3183 CALL flagerror(local_error,err,error,*999)
3186 SELECT CASE(problem_setup%ACTION_TYPE)
3188 NULLIFY(control_loop_root)
3192 NULLIFY(iterativewhileloop)
3194 NULLIFY(iterativewhileloop)
3201 CALL control_loop_label_set(iterativewhileloop,
"1D-0D Iterative Coupling Convergence Loop",err,error,*999)
3208 NULLIFY(iterativewhileloop2)
3217 NULLIFY(iterativewhileloop)
3224 CALL control_loop_label_set(iterativewhileloop,
"1D-0D Iterative Coupling Convergence Loop",err,error,*999)
3231 NULLIFY(iterativewhileloop2)
3245 NULLIFY(iterativewhileloop)
3252 CALL control_loop_label_set(iterativewhileloop,
"1D Characteristic/NSE branch value convergence Loop",err,error,*999)
3254 NULLIFY(iterativewhileloop)
3261 CALL control_loop_label_set(iterativewhileloop,
"1D Characteristic/NSE branch value convergence Loop",err,error,*999)
3268 NULLIFY(iterativewhileloop)
3275 CALL control_loop_label_set(iterativewhileloop,
"1D-0D Iterative Coupling Convergence Loop",err,error,*999)
3282 NULLIFY(iterativewhileloop2)
3291 NULLIFY(iterativewhileloop)
3298 CALL control_loop_label_set(iterativewhileloop,
"1D-0D Iterative Coupling Convergence Loop",err,error,*999)
3305 NULLIFY(iterativewhileloop2)
3320 control_loop_root=>problem%CONTROL_LOOP
3324 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
3326 &
" is invalid for a 1d transient Navier-Stokes fluid." 3327 CALL flagerror(local_error,err,error,*999)
3332 control_loop_root=>problem%CONTROL_LOOP
3333 NULLIFY(control_loop)
3335 SELECT CASE(problem_setup%ACTION_TYPE)
3337 SELECT CASE(problem%specification(3))
3341 NULLIFY(iterativewhileloop)
3363 NULLIFY(iterativewhileloop)
3402 NULLIFY(iterativewhileloop)
3420 NULLIFY(iterativewhileloop2)
3460 NULLIFY(iterativewhileloop)
3477 NULLIFY(iterativewhileloop2)
3516 NULLIFY(iterativewhileloop)
3534 NULLIFY(iterativewhileloop2)
3557 NULLIFY(iterativewhileloop)
3576 NULLIFY(iterativewhileloop2)
3598 &
" is not valid for a Navier-Stokes equation type of a fluid mechanics problem class." 3599 CALL flagerror(local_error,err,error,*999)
3603 NULLIFY(iterativewhileloop)
3610 NULLIFY(iterativewhileloop2)
3616 NULLIFY(iterativewhileloop)
3623 NULLIFY(iterativewhileloop2)
3629 NULLIFY(iterativewhileloop)
3635 NULLIFY(iterativewhileloop)
3646 NULLIFY(iterativewhileloop)
3653 NULLIFY(iterativewhileloop2)
3664 NULLIFY(iterativewhileloop)
3671 NULLIFY(iterativewhileloop2)
3683 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
3685 &
" is invalid for a 1d transient Navier-Stokes fluid." 3686 CALL flagerror(local_error,err,error,*999)
3690 SELECT CASE(problem_setup%ACTION_TYPE)
3693 control_loop_root=>problem%CONTROL_LOOP
3694 NULLIFY(control_loop)
3697 NULLIFY(solver_equations)
3698 SELECT CASE(problem%specification(3))
3700 NULLIFY(iterativewhileloop)
3712 NULLIFY(solver_equations)
3720 NULLIFY(iterativewhileloop)
3733 NULLIFY(solver_equations)
3742 NULLIFY(solver_equations)
3755 NULLIFY(iterativewhileloop)
3759 NULLIFY(iterativewhileloop2)
3771 NULLIFY(solver_equations)
3780 NULLIFY(solver_equations)
3793 NULLIFY(iterativewhileloop)
3797 NULLIFY(iterativewhileloop2)
3809 NULLIFY(solver_equations)
3817 NULLIFY(iterativewhileloop)
3825 NULLIFY(solver_equations)
3833 NULLIFY(solver_equations)
3834 NULLIFY(iterativewhileloop2)
3846 NULLIFY(solver_equations)
3855 NULLIFY(solver_equations)
3868 NULLIFY(iterativewhileloop)
3876 NULLIFY(solver_equations)
3885 NULLIFY(solver_equations)
3886 NULLIFY(iterativewhileloop2)
3898 NULLIFY(solver_equations)
3907 &
" is not valid for a Navier-Stokes equation type of a fluid mechanics problem class." 3908 CALL flagerror(local_error,err,error,*999)
3912 control_loop_root=>problem%CONTROL_LOOP
3913 NULLIFY(control_loop)
3916 NULLIFY(solver_equations)
3917 SELECT CASE(problem%specification(3))
3919 NULLIFY(iterativewhileloop)
3929 NULLIFY(solver_equations)
3935 NULLIFY(iterativewhileloop)
3945 NULLIFY(solver_equations)
3952 NULLIFY(solver_equations)
3963 NULLIFY(iterativewhileloop)
3967 NULLIFY(iterativewhileloop2)
3977 NULLIFY(solver_equations)
3984 NULLIFY(solver_equations)
3995 NULLIFY(iterativewhileloop)
3999 NULLIFY(iterativewhileloop2)
4009 NULLIFY(solver_equations)
4015 NULLIFY(iterativewhileloop)
4023 NULLIFY(solver_equations)
4029 NULLIFY(solver_equations)
4030 NULLIFY(iterativewhileloop2)
4040 NULLIFY(solver_equations)
4047 NULLIFY(solver_equations)
4058 NULLIFY(iterativewhileloop)
4066 NULLIFY(solver_equations)
4073 NULLIFY(solver_equations)
4074 NULLIFY(iterativewhileloop2)
4084 NULLIFY(solver_equations)
4091 &
" is not valid for a Navier-Stokes equation type of a fluid mechanics problem class." 4092 CALL flagerror(local_error,err,error,*999)
4095 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4097 &
" is invalid for a Navier-Stokes fluid." 4098 CALL flagerror(local_error,err,error,*999)
4102 SELECT CASE(problem_setup%ACTION_TYPE)
4105 control_loop_root=>problem%CONTROL_LOOP
4109 NULLIFY(iterativewhileloop)
4118 NULLIFY(cellmlsolver)
4119 NULLIFY(cellml_equations)
4120 SELECT CASE(problem%specification(3))
4127 &
" is not valid for cellML equations setup Navier-Stokes equation type of a fluid mechanics problem class." 4128 CALL flagerror(local_error,err,error,*999)
4132 control_loop_root=>problem%CONTROL_LOOP
4136 NULLIFY(iterativewhileloop)
4145 SELECT CASE(problem%specification(3))
4152 local_error=
"The third problem specification of "// &
4154 &
" is not valid for cellML equations setup Navier-Stokes fluid mechanics problem." 4155 CALL flagerror(local_error,err,error,*999)
4158 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4160 &
" is invalid for a CellML setup for a 1D Navier-Stokes equation." 4161 CALL flagerror(local_error,err,error,*999)
4164 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
4165 &
" is invalid for a 1d transient Navier-Stokes fluid." 4166 CALL flagerror(local_error,err,error,*999)
4170 SELECT CASE(problem_setup%SETUP_TYPE)
4172 SELECT CASE(problem_setup%ACTION_TYPE)
4178 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4180 &
" is invalid for a quasistatic Navier-Stokes fluid." 4181 CALL flagerror(local_error,err,error,*999)
4184 SELECT CASE(problem_setup%ACTION_TYPE)
4191 control_loop_root=>problem%CONTROL_LOOP
4195 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4197 &
" is invalid for a quasistatic Navier-Stokes fluid." 4198 CALL flagerror(local_error,err,error,*999)
4202 control_loop_root=>problem%CONTROL_LOOP
4204 SELECT CASE(problem_setup%ACTION_TYPE)
4220 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4222 &
" is invalid for a quasistatic Navier-Stokes equation." 4223 CALL flagerror(local_error,err,error,*999)
4226 SELECT CASE(problem_setup%ACTION_TYPE)
4229 control_loop_root=>problem%CONTROL_LOOP
4241 control_loop_root=>problem%CONTROL_LOOP
4250 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4252 &
" is invalid for a quasistatic Navier-Stokes equation." 4253 CALL flagerror(local_error,err,error,*999)
4256 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
4257 &
" is invalid for a quasistatic Navier-Stokes fluid." 4258 CALL flagerror(local_error,err,error,*999)
4262 SELECT CASE(problem_setup%SETUP_TYPE)
4264 SELECT CASE(problem_setup%ACTION_TYPE)
4270 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4272 &
" is invalid for a ALE Navier-Stokes fluid." 4273 CALL flagerror(local_error,err,error,*999)
4276 SELECT CASE(problem_setup%ACTION_TYPE)
4283 control_loop_root=>problem%CONTROL_LOOP
4287 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4289 &
" is invalid for a ALE Navier-Stokes fluid." 4290 CALL flagerror(local_error,err,error,*999)
4294 control_loop_root=>problem%CONTROL_LOOP
4296 SELECT CASE(problem_setup%ACTION_TYPE)
4321 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4323 &
" is invalid for a ALE Navier-Stokes fluid." 4324 CALL flagerror(local_error,err,error,*999)
4327 SELECT CASE(problem_setup%ACTION_TYPE)
4330 control_loop_root=>problem%CONTROL_LOOP
4349 control_loop_root=>problem%CONTROL_LOOP
4363 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4365 &
" is invalid for a Navier-Stokes fluid." 4366 CALL flagerror(local_error,err,error,*999)
4369 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
4370 &
" is invalid for a ALE Navier-Stokes fluid." 4371 CALL flagerror(local_error,err,error,*999)
4374 local_error=
"The third problem specification of "//
trim(
number_to_vstring(problem%specification(3),
"*",err,error))// &
4375 &
" is not valid for a Navier-Stokes fluid mechanics problem." 4376 CALL flagerror(local_error,err,error,*999)
4379 CALL flagerror(
"Problem is not associated.",err,error,*999)
4382 exits(
"NAVIER_STOKES_PROBLEM_SETUP")
4384 999 errorsexits(
"NAVIER_STOKES_PROBLEM_SETUP",err,error)
4387 END SUBROUTINE navier_stokes_problem_setup
4394 SUBROUTINE navierstokes_finiteelementresidualevaluate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
4398 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
4399 INTEGER(INTG),
INTENT(OUT) :: ERR
4402 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,DEPENDENT_BASIS1,DEPENDENT_BASIS2,GEOMETRIC_BASIS,INDEPENDENT_BASIS
4416 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD,INDEPENDENT_FIELD
4419 INTEGER(INTG) :: ng,mh,mhs,mi,ms,nh,nhs,ni,ns,nhs_max,mhs_max,nhs_min,mhs_min,xv,out
4420 INTEGER(INTG) :: FIELD_VAR_TYPE,MESH_COMPONENT1,MESH_COMPONENT2,MESH_COMPONENT_NUMBER
4421 INTEGER(INTG) :: nodeIdx,xiIdx,coordIdx,derivativeIdx,versionIdx,elementVersionNumber,componentIdx
4422 INTEGER(INTG) :: numberOfVersions,nodeNumber,numberOfElementNodes,numberOfParameters,firstNode,lastNode
4423 REAL(DP) :: JGW,SUM,X(3),DXI_DX(3,3),DPHIMS_DXI(3),DPHINS_DXI(3),PHIMS,PHINS,momentum,mass,QUpwind,AUpwind,pExternal
4424 REAL(DP) :: U_VALUE(3),W_VALUE(3),U_DERIV(3,3),Q_VALUE,A_VALUE,Q_DERIV,A_DERIV,area,pressure,normalWave,normal,Lref,Tref,Mref
4425 REAL(DP) :: MU_PARAM,RHO_PARAM,A0_PARAM,E_PARAM,H_PARAM,A0_DERIV,E_DERIV,H_DERIV,alpha,beta,G0_PARAM,muScale
4426 REAL(DP),
POINTER :: dependentParameters(:),materialsParameters(:),materialsParameters1(:)
4427 LOGICAL :: UPDATE_STIFFNESS_MATRIX,UPDATE_DAMPING_MATRIX,UPDATE_RHS_VECTOR,UPDATE_NONLINEAR_RESIDUAL
4430 enters(
"NavierStokes_FiniteElementResidualEvaluate",err,error,*999)
4432 update_stiffness_matrix=.false.
4433 update_damping_matrix=.false.
4434 update_rhs_vector=.false.
4435 update_nonlinear_residual=.false.
4439 NULLIFY(dependent_basis,geometric_basis)
4441 NULLIFY(equations_mapping)
4442 NULLIFY(linear_mapping)
4443 NULLIFY(nonlinear_mapping)
4444 NULLIFY(dynamic_mapping)
4445 NULLIFY(equations_matrices)
4446 NULLIFY(linear_matrices)
4447 NULLIFY(nonlinear_matrices)
4448 NULLIFY(dynamic_matrices)
4450 NULLIFY(stiffness_matrix, damping_matrix)
4451 NULLIFY(dependent_field,independent_field,geometric_field,materials_field)
4452 NULLIFY(dependentparameters,materialsparameters,materialsparameters1)
4453 NULLIFY(field_variable)
4454 NULLIFY(quadrature_scheme)
4455 NULLIFY(quadrature_scheme1, quadrature_scheme2)
4456 NULLIFY(decomposition)
4458 IF(
ASSOCIATED(equations_set))
THEN 4459 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 4460 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
4461 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 4462 CALL flagerror(
"Equations set specification must have three entries for a Navier-Stokes type equations set.", &
4465 equations=>equations_set%EQUATIONS
4466 IF(
ASSOCIATED(equations))
THEN 4467 SELECT CASE(equations_set%SPECIFICATION(3))
4477 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
4478 independent_field=>equations%INTERPOLATION%INDEPENDENT_FIELD
4479 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
4480 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
4481 equations_matrices=>equations%EQUATIONS_MATRICES
4482 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4483 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4484 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4485 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4487 rhs_vector=>equations_matrices%RHS_VECTOR
4488 equations_mapping=>equations%EQUATIONS_MAPPING
4489 SELECT CASE(equations_set%SPECIFICATION(3))
4492 linear_matrices=>equations_matrices%LINEAR_MATRICES
4493 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4494 stiffness_matrix=>linear_matrices%MATRICES(1)%PTR
4495 linear_mapping=>equations_mapping%LINEAR_MAPPING
4496 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4497 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4498 field_var_type=field_variable%VARIABLE_TYPE
4499 stiffness_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4500 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR=0.0_dp
4501 IF(
ASSOCIATED(stiffness_matrix)) update_stiffness_matrix=stiffness_matrix%UPDATE_MATRIX
4502 IF(
ASSOCIATED(rhs_vector)) update_rhs_vector=rhs_vector%UPDATE_VECTOR
4503 IF(
ASSOCIATED(nonlinear_matrices)) update_nonlinear_residual=nonlinear_matrices%UPDATE_RESIDUAL
4505 linear_matrices=>equations_matrices%LINEAR_MATRICES
4506 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4507 stiffness_matrix=>linear_matrices%MATRICES(1)%PTR
4508 linear_mapping=>equations_mapping%LINEAR_MAPPING
4509 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4510 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4511 field_var_type=field_variable%VARIABLE_TYPE
4512 stiffness_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4513 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR=0.0_dp
4514 IF(
ASSOCIATED(stiffness_matrix)) update_stiffness_matrix=stiffness_matrix%UPDATE_MATRIX
4515 IF(
ASSOCIATED(rhs_vector)) update_rhs_vector=rhs_vector%UPDATE_VECTOR
4516 IF(
ASSOCIATED(nonlinear_matrices)) update_nonlinear_residual=nonlinear_matrices%UPDATE_RESIDUAL
4518 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
4519 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
4520 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
4521 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4522 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
4523 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4524 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4525 field_var_type=field_variable%VARIABLE_TYPE
4526 stiffness_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4527 damping_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4528 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR=0.0_dp
4529 IF(
ASSOCIATED(stiffness_matrix)) update_stiffness_matrix=stiffness_matrix%UPDATE_MATRIX
4530 IF(
ASSOCIATED(damping_matrix)) update_damping_matrix=damping_matrix%UPDATE_MATRIX
4531 IF(
ASSOCIATED(rhs_vector)) update_rhs_vector=rhs_vector%UPDATE_VECTOR
4532 IF(
ASSOCIATED(nonlinear_matrices)) update_nonlinear_residual=nonlinear_matrices%UPDATE_RESIDUAL
4535 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
4536 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
4537 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
4538 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4539 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
4540 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4541 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4542 field_var_type=field_variable%VARIABLE_TYPE
4543 stiffness_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4544 damping_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4545 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR=0.0_dp
4546 IF(
ASSOCIATED(stiffness_matrix)) update_stiffness_matrix=stiffness_matrix%UPDATE_MATRIX
4547 IF(
ASSOCIATED(damping_matrix)) update_damping_matrix=damping_matrix%UPDATE_MATRIX
4548 IF(
ASSOCIATED(rhs_vector)) update_rhs_vector=rhs_vector%UPDATE_VECTOR
4549 IF(
ASSOCIATED(nonlinear_matrices)) update_nonlinear_residual=nonlinear_matrices%UPDATE_RESIDUAL
4550 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4551 & materials_interp_parameters(field_v_variable_type)%PTR,err,error,*999)
4553 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
4554 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
4555 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
4556 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4557 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
4558 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4559 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4560 field_var_type=field_variable%VARIABLE_TYPE
4561 stiffness_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4562 damping_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4563 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR=0.0_dp
4564 IF(
ASSOCIATED(stiffness_matrix)) update_stiffness_matrix=stiffness_matrix%UPDATE_MATRIX
4565 IF(
ASSOCIATED(damping_matrix)) update_damping_matrix=damping_matrix%UPDATE_MATRIX
4566 IF(
ASSOCIATED(rhs_vector)) update_rhs_vector=rhs_vector%UPDATE_VECTOR
4567 IF(
ASSOCIATED(nonlinear_matrices)) update_nonlinear_residual=nonlinear_matrices%UPDATE_RESIDUAL
4570 decomposition => dependent_field%DECOMPOSITION
4571 mesh_component_number = decomposition%MESH_COMPONENT_NUMBER
4572 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
4573 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
4574 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
4575 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4576 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
4577 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4578 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4579 field_var_type=field_variable%VARIABLE_TYPE
4580 stiffness_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4581 damping_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4582 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR=0.0_dp
4583 IF(
ASSOCIATED(stiffness_matrix)) update_stiffness_matrix=stiffness_matrix%UPDATE_MATRIX
4584 IF(
ASSOCIATED(damping_matrix)) update_damping_matrix=damping_matrix%UPDATE_MATRIX
4585 IF(
ASSOCIATED(rhs_vector)) update_rhs_vector=rhs_vector%UPDATE_VECTOR
4586 IF(
ASSOCIATED(nonlinear_matrices)) update_nonlinear_residual=nonlinear_matrices%UPDATE_RESIDUAL
4588 independent_field=>equations%INTERPOLATION%INDEPENDENT_FIELD
4589 independent_basis=>independent_field%DECOMPOSITION%DOMAIN(independent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)% &
4590 &
ptr%TOPOLOGY%ELEMENTS%ELEMENTS(element_number)%BASIS
4591 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
4592 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
4593 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
4594 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4595 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
4596 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4597 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4598 field_var_type=field_variable%VARIABLE_TYPE
4599 stiffness_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4600 damping_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4601 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR=0.0_dp
4602 IF(
ASSOCIATED(stiffness_matrix)) update_stiffness_matrix=stiffness_matrix%UPDATE_MATRIX
4603 IF(
ASSOCIATED(damping_matrix)) update_damping_matrix=damping_matrix%UPDATE_MATRIX
4604 IF(
ASSOCIATED(rhs_vector)) update_rhs_vector=rhs_vector%UPDATE_VECTOR
4605 IF(
ASSOCIATED(nonlinear_matrices)) update_nonlinear_residual=nonlinear_matrices%UPDATE_RESIDUAL
4606 CALL field_interpolation_parameters_element_get(field_mesh_velocity_set_type,element_number,equations%INTERPOLATION% &
4607 & independent_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4609 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
4610 &
" is not valid for a Navier-Stokes fluid type of a fluid mechanics equations set class." 4611 CALL flagerror(local_error,err,error,*999)
4613 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4614 & dependent_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4615 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4616 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4617 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,1, &
4618 & mu_param,err,error,*999)
4619 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,2, &
4620 & rho_param,err,error,*999)
4622 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
4624 & dependent_interp_point(field_u_variable_type)%PTR,err,error,*999)
4626 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
4627 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
4628 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
4632 & independent_interp_point(field_u_variable_type)%PTR,err,error,*999)
4633 w_value(1)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
4634 w_value(2)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
no_part_deriv)
4635 IF(field_variable%NUMBER_OF_COMPONENTS==4)
THEN 4636 w_value(3)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
no_part_deriv)
4647 CALL field_parametersetgetlocalgausspoint(materials_field,field_v_variable_type,field_values_set_type, &
4648 & ng,element_number,1,mu_param,err,error,*999)
4649 mu_param=mu_param*muscale
4665 DO mh=1,field_variable%NUMBER_OF_COMPONENTS-1
4666 mesh_component1=field_variable%COMPONENTS(mh)%MESH_COMPONENT_NUMBER
4667 dependent_basis1=>dependent_field%DECOMPOSITION%DOMAIN(mesh_component1)%PTR% &
4668 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4670 jgw=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
4671 & quadrature_scheme1%GAUSS_WEIGHTS(ng)
4673 DO ms=1,dependent_basis1%NUMBER_OF_ELEMENT_PARAMETERS
4676 IF(update_stiffness_matrix.OR.update_damping_matrix)
THEN 4678 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
4679 mesh_component2=field_variable%COMPONENTS(nh)%MESH_COMPONENT_NUMBER
4680 dependent_basis2=>dependent_field%DECOMPOSITION%DOMAIN(mesh_component2)%PTR% &
4681 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4682 quadrature_scheme2=>dependent_basis2%QUADRATURE%QUADRATURE_SCHEME_MAP&
4686 DO ns=1,dependent_basis2%NUMBER_OF_ELEMENT_PARAMETERS
4689 DO ni=1,dependent_basis2%NUMBER_OF_XI
4690 DO mi=1,dependent_basis1%NUMBER_OF_XI
4691 dxi_dx(mi,ni)=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR% &
4697 phims=quadrature_scheme1%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)
4698 phins=quadrature_scheme2%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)
4700 IF(update_stiffness_matrix)
THEN 4705 DO xv=1,dependent_basis1%NUMBER_OF_XI
4706 DO mi=1,dependent_basis1%NUMBER_OF_XI
4707 DO ni=1,dependent_basis2%NUMBER_OF_XI
4708 sum=sum+mu_param*dphins_dxi(ni)*dxi_dx(ni,xv)*dphims_dxi(mi)*dxi_dx(mi,xv)
4713 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*jgw
4717 IF(update_stiffness_matrix)
THEN 4720 IF(nh<field_variable%NUMBER_OF_COMPONENTS)
THEN 4723 DO mi=1,dependent_basis1%NUMBER_OF_XI
4724 DO ni=1,dependent_basis2%NUMBER_OF_XI
4726 sum=sum+mu_param*dphins_dxi(mi)*dxi_dx(mi,mh)*dphims_dxi(ni)*dxi_dx(ni,nh)
4730 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs) &
4736 IF(update_stiffness_matrix)
THEN 4743 DO mi=1,dependent_basis1%NUMBER_OF_XI
4744 DO ni=1,dependent_basis1%NUMBER_OF_XI
4745 sum=sum-rho_param*w_value(mi)*dphins_dxi(ni)*dxi_dx(ni,mi)*phims
4749 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+ &
4755 IF(update_stiffness_matrix)
THEN 4757 IF(nh==field_variable%NUMBER_OF_COMPONENTS)
THEN 4760 DO ni=1,dependent_basis1%NUMBER_OF_XI
4761 sum=sum-phins*dphims_dxi(ni)*dxi_dx(ni,mh)
4764 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*jgw
4774 IF(update_damping_matrix)
THEN 4778 sum=phims*phins*rho_param
4780 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*jgw
4790 IF(rhs_vector%FIRST_ASSEMBLY)
THEN 4791 IF(update_rhs_vector)
THEN 4792 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 4805 DO mh=1,field_variable%NUMBER_OF_COMPONENTS-1
4806 mesh_component1=field_variable%COMPONENTS(mh)%MESH_COMPONENT_NUMBER
4807 dependent_basis1=>dependent_field%DECOMPOSITION%DOMAIN(mesh_component1)%PTR% &
4808 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4810 jgw=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
4811 & quadrature_scheme1%GAUSS_WEIGHTS(ng)
4813 DO ms=1,dependent_basis1%NUMBER_OF_ELEMENT_PARAMETERS
4815 phims=quadrature_scheme1%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)
4818 x(1) = equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,1)
4819 x(2) = equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,1)
4820 IF(dependent_basis1%NUMBER_OF_XI==3)
THEN 4821 x(3) = equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,1)
4829 sum=phims*(-2.0_dp/3.0_dp*(x(1)**3*rho_param+3.0_dp*mu_param*10.0_dp**2- &
4830 & 3.0_dp*rho_param*x(2)**2*x(1))/(10.0_dp**4))
4839 sum=phims*(-4.0_dp*mu_param/10.0_dp/10.0_dp*exp((x(1)-x(2))/10.0_dp))
4848 sum=phims*(16.0_dp*mu_param*
pi**2/10.0_dp**2*cos(2.0_dp*
pi*x(2)/10.0_dp)* &
4849 & cos(2.0_dp*
pi*x(1)/10.0_dp)- &
4850 & 2.0_dp*cos(2.0_dp*
pi*x(2)/10.0_dp)*sin(2.0_dp*
pi*x(2)/10.0_dp)*rho_param*
pi/10.0_dp)
4856 sum=phims*(2.0_dp*sin(x(1))*cos(x(2)))*mu_param
4859 sum=phims*(-2.0_dp*cos(x(1))*sin(x(2)))*mu_param
4864 ELSE IF(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE== &
4871 sum=phims*(-2.0_dp/3.0_dp*(rho_param*x(1)**3+6.0_dp*rho_param*x(1)*x(3)*x(2)+ &
4872 & 6.0_dp*mu_param*10.0_dp**2- &
4873 & 3.0_dp*rho_param*x(2)**2*x(1)-3.0_dp*rho_param*x(3)*x(1)**2-3.0_dp*rho_param*x(3)*x(2)**2)/ &
4877 sum=phims*(-2.0_dp/3.0_dp*(6.0_dp*rho_param*x(1)*x(3)*x(2)+rho_param*x(1)**3+ &
4878 & 6.0_dp*mu_param*10.0_dp**2- &
4879 & 3.0_dp*rho_param*x(1)*x(3)**2-3.0_dp*rho_param*x(2)*x(1)**2-3.0_dp*rho_param*x(2)*x(3)**2)/ &
4882 ELSE IF(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE== &
4889 sum=phims*((-4.0_dp*mu_param*exp((x(1)-x(2))/10.0_dp)-2.0_dp*mu_param*exp((x(2)-x(3))/10.0_dp)+ &
4890 & rho_param*exp((x(3)-x(2))/10.0_dp)*10.0_dp)/10.0_dp**2)
4893 sum=phims*(-(4.0_dp*mu_param*exp((x(3)-x(1))/10.0_dp)+2.0_dp*mu_param*exp((x(2)-x(3))/10.0_dp)+ &
4894 & rho_param*exp((x(3)-x(2))/10.0_dp)*10.0_dp)/10.0_dp** 2)
4896 ELSE IF(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE== &
4903 sum=phims*(2.0_dp*cos(2.0_dp*
pi*x(2)/10.0_dp)*(18.0_dp*cos(2.0_dp*
pi*x(1)/10.0_dp)* &
4904 & mu_param*
pi*sin(2.0_dp*
pi*x(3)/10.0_dp)-3.0_dp*rho_param*cos(2.0_dp*
pi*x(1)/10.0_dp)**2* &
4905 & sin(2.0_dp*
pi*x(2)/10.0_dp)*10.0_dp-2.0_dp*rho_param*sin(2.0_dp*
pi*x(2)/10.0_dp)*10.0_dp+ &
4906 & 2.0_dp*rho_param*sin(2.0_dp*
pi*x(2)/10.0_dp)*10.0_dp*cos(2.0_dp*
pi*x(3)/10.0_dp)**2)*
pi/ &
4910 sum=phims*(-2.0_dp*
pi*cos(2.0_dp*
pi*x(3)/10.0_dp)*rho_param*sin(2.0_dp*
pi*x(3)/10.0_dp)* &
4911 & (-1.0_dp+cos(2.0_dp*
pi*x(2)/10.0_dp)**2)/10.0_dp)
4913 ELSE IF(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE== &
4922 ELSE IF(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE== &
4927 rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)+sum*jgw
4931 rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
4938 IF(update_nonlinear_residual)
THEN 4940 u_value(1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
no_part_deriv)
4941 u_value(2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(2,
no_part_deriv)
4942 u_deriv(1,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
part_deriv_s1)
4943 u_deriv(1,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
part_deriv_s2)
4944 u_deriv(2,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(2,
part_deriv_s1)
4945 u_deriv(2,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(2,
part_deriv_s2)
4946 IF(field_variable%NUMBER_OF_COMPONENTS==4)
THEN 4947 u_value(3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(3,
no_part_deriv)
4948 u_deriv(3,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(3,
part_deriv_s1)
4949 u_deriv(3,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(3,
part_deriv_s2)
4950 u_deriv(3,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(3,
part_deriv_s3)
4951 u_deriv(1,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
part_deriv_s3)
4952 u_deriv(2,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(2,
part_deriv_s3)
4964 DO mh=1,(field_variable%NUMBER_OF_COMPONENTS-1)
4965 mesh_component1=field_variable%COMPONENTS(mh)%MESH_COMPONENT_NUMBER
4966 dependent_basis1=>dependent_field%DECOMPOSITION%DOMAIN(mesh_component1)%PTR% &
4967 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4969 jgw=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
4970 & quadrature_scheme1%GAUSS_WEIGHTS(ng)
4973 DO ni=1,dependent_basis1%NUMBER_OF_XI
4974 DO mi=1,dependent_basis1%NUMBER_OF_XI
4975 dxi_dx(mi,ni)=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(mi,ni)
4979 DO ms=1,dependent_basis1%NUMBER_OF_ELEMENT_PARAMETERS
4981 phims=quadrature_scheme1%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)
4985 DO ni=1,dependent_basis1%NUMBER_OF_XI
4986 sum=sum+rho_param*(phims)*( &
4987 & (u_value(1))*(u_deriv(mh,ni)*dxi_dx(ni,1))+ &
4988 & (u_value(2))*(u_deriv(mh,ni)*dxi_dx(ni,2))+ &
4989 & (u_value(3))*(u_deriv(mh,ni)*dxi_dx(ni,3)))
4992 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)=nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)+sum*jgw
5005 CALL navierstokes_residualbasedstabilisation(equations_set,element_number,ng, &
5006 & mu_param,rho_param,.false.,err,error,*999)
5020 q_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
5021 q_deriv=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
first_part_deriv)
5022 a_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
no_part_deriv)
5023 a_deriv=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
first_part_deriv)
5024 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,3, &
5025 & alpha,err,error,*999)
5026 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,8, &
5027 & g0_param,err,error,*999)
5029 & materials_interp_point(field_v_variable_type)%PTR,err,error,*999)
5030 a0_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(1,
no_part_deriv)
5031 a0_deriv=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(1,
first_part_deriv)
5032 e_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(2,
no_part_deriv)
5033 e_deriv=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(2,
first_part_deriv)
5034 h_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(3,
no_part_deriv)
5035 h_deriv=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(3,
first_part_deriv)
5036 beta = (4.0_dp*(sqrt(
pi))*e_param*h_param)/(3.0_dp*a0_param)
5039 IF(a_value < a0_param*0.001_dp)
THEN 5040 a_value = a0_param*0.001_dp
5045 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
5046 mesh_component1=field_variable%COMPONENTS(mh)%MESH_COMPONENT_NUMBER
5047 dependent_basis1=>dependent_field%DECOMPOSITION%DOMAIN(mesh_component1)%PTR% &
5048 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5050 jgw=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
5051 & quadrature_scheme1%GAUSS_WEIGHTS(ng)
5052 elements_topology=>field_variable%COMPONENTS(mh)%DOMAIN%TOPOLOGY%ELEMENTS
5055 DO xiidx=1,dependent_basis1%NUMBER_OF_XI
5056 DO coordidx=1,equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type) &
5057 & %PTR%NUMBER_OF_X_DIMENSIONS
5058 dxi_dx(1,1)=dxi_dx(1,1)+(equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)% &
5059 &
ptr%DXI_DX(xiidx,coordidx))**2.0_dp
5062 dxi_dx(1,1)=sqrt(dxi_dx(1,1))
5064 DO ms=1,dependent_basis1%NUMBER_OF_ELEMENT_PARAMETERS
5065 phims=quadrature_scheme1%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)
5069 IF(update_stiffness_matrix .OR. update_damping_matrix)
THEN 5071 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
5072 mesh_component2=field_variable%COMPONENTS(nh)%MESH_COMPONENT_NUMBER
5073 dependent_basis2=>dependent_field%DECOMPOSITION%DOMAIN(mesh_component2)%PTR% &
5074 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5076 DO ns=1,dependent_basis2%NUMBER_OF_ELEMENT_PARAMETERS
5077 phins=quadrature_scheme2%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)
5082 IF(update_damping_matrix)
THEN 5084 IF(mh==1 .AND. nh==1)
THEN 5086 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)= &
5087 & damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*jgw
5090 IF(mh==2 .AND. nh==2)
THEN 5092 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)= &
5093 & damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*jgw
5098 IF(update_stiffness_matrix)
THEN 5099 IF(mh==1 .AND. nh==2)
THEN 5101 sum=-phins*phims*(beta*sqrt(a0_param)/rho_param)*(h_deriv/h_param + e_deriv/e_param)*dxi_dx(1,1)
5102 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)= &
5103 & stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*jgw
5105 sum=phins*phims*g0_param
5106 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)= &
5107 & stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*jgw
5110 IF(mh==2 .AND. nh==1)
THEN 5111 sum=dphins_dxi(1)*dxi_dx(1,1)*phims
5112 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)= &
5113 & stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*jgw
5122 IF(update_nonlinear_residual)
THEN 5125 sum=((2.0_dp*alpha*(q_value/a_value)*q_deriv - &
5126 & (alpha*((q_value/a_value)**2.0_dp)*a_deriv)+(beta/rho_param)* &
5127 & ((sqrt(a_value)/2.0_dp)*a_deriv+ &
5128 & (a_value/(2.0_dp*sqrt(a0_param))-(a_value**1.5_dp)/a0_param)*a0_deriv+ &
5129 & (a_value*(sqrt(a_value)))*(h_deriv/h_param) + &
5130 & (a_value*(sqrt(a_value)))*(e_deriv/e_param)))* &
5131 & dxi_dx(1,1)+(q_value/a_value))*phims
5132 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)= &
5133 & nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)+sum*jgw
5146 IF(update_nonlinear_residual)
THEN 5147 elements_topology=>dependent_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR%components(1)%domain%topology%elements
5148 numberofelementnodes=elements_topology%ELEMENTS(element_number)%BASIS%NUMBER_OF_NODES
5149 numberofparameters=elements_topology%MAXIMUM_NUMBER_OF_ELEMENT_PARAMETERS
5150 firstnode=elements_topology%ELEMENTS(element_number)%ELEMENT_NODES(1)
5151 lastnode=elements_topology%ELEMENTS(element_number)%ELEMENT_NODES(numberofelementnodes)
5153 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,2, &
5154 & rho_param,err,error,*999)
5155 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,4, &
5156 & pexternal,err,error,*999)
5157 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,5, &
5158 & lref,err,error,*999)
5159 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,6, &
5160 & tref,err,error,*999)
5161 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,7, &
5162 & mref,err,error,*999)
5166 DO nodeidx=1,numberofelementnodes
5167 nodenumber=elements_topology%ELEMENTS(element_number)%ELEMENT_NODES(nodeidx)
5169 versionidx=elements_topology%DOMAIN%TOPOLOGY%ELEMENTS%ELEMENTS(element_number)% &
5170 & elementversions(derivativeidx,nodeidx)
5172 CALL field_parametersetgetlocalnode(dependent_field,field_u_variable_type,field_values_set_type,versionidx, &
5173 & derivativeidx,nodenumber,2,area,err,error,*999)
5174 IF(area < a0_param*0.001_dp) area = a0_param*0.001_dp
5176 CALL field_parametersetgetlocalnode(materials_field,field_v_variable_type,field_values_set_type,versionidx, &
5177 & derivativeidx,nodenumber,1,a0_param,err,error,*999)
5178 CALL field_parametersetgetlocalnode(materials_field,field_v_variable_type,field_values_set_type,versionidx, &
5179 & derivativeidx,nodenumber,2,e_param,err,error,*999)
5180 CALL field_parametersetgetlocalnode(materials_field,field_v_variable_type,field_values_set_type,versionidx, &
5181 & derivativeidx,nodenumber,3,h_param,err,error,*999)
5182 beta = (4.0_dp*(sqrt(
pi))*e_param*h_param)/(3.0_dp*a0_param)
5184 pressure=(pexternal+beta*(sqrt(area)-sqrt(a0_param)))/(mref/(lref*tref**2.0))*0.0075_dp
5186 IF(element_number<=dependent_field%DECOMPOSITION%TOPOLOGY%ELEMENTS%NUMBER_OF_ELEMENTS)
THEN 5187 CALL field_parameter_set_update_local_node(dependent_field,field_u2_variable_type,field_values_set_type, &
5188 & versionidx,1,nodenumber,1,pressure,err,error,*999)
5197 DO nodeidx=1,numberofelementnodes
5198 nodenumber=elements_topology%ELEMENTS(element_number)%ELEMENT_NODES(nodeidx)
5199 numberofversions=elements_topology%DOMAIN%TOPOLOGY%NODES%NODES(nodenumber)%DERIVATIVES(1)%numberOfVersions
5202 IF(numberofversions>1)
THEN 5204 elementversionnumber=elements_topology%DOMAIN%TOPOLOGY%ELEMENTS%ELEMENTS(element_number)% &
5205 & elementversions(derivativeidx,nodeidx)
5208 DO componentidx = 1,2
5209 CALL field_parametersetgetlocalnode(independent_field,field_u_variable_type,field_values_set_type, &
5210 & elementversionnumber,derivativeidx,nodenumber,componentidx,normalwave,err,error,*999)
5217 CALL field_parametersetgetlocalnode(materials_field,field_v_variable_type,field_values_set_type, &
5218 & elementversionnumber,derivativeidx,nodenumber,1,a0_param,err,error,*999)
5219 CALL field_parametersetgetlocalnode(materials_field,field_v_variable_type,field_values_set_type, &
5220 & elementversionnumber,derivativeidx,nodenumber,2,e_param,err,error,*999)
5221 CALL field_parametersetgetlocalnode(materials_field,field_v_variable_type,field_values_set_type, &
5222 & elementversionnumber,derivativeidx,nodenumber,3,h_param,err,error,*999)
5223 beta = (4.0_dp*(sqrt(
pi))*e_param*h_param)/(3.0_dp*a0_param)
5226 CALL field_parametersetgetlocalnode(dependent_field,field_u_variable_type,field_values_set_type, &
5227 & elementversionnumber,derivativeidx,nodenumber,1,q_value,err,error,*999)
5228 CALL field_parametersetgetlocalnode(dependent_field,field_u_variable_type,field_values_set_type, &
5229 & elementversionnumber,derivativeidx,nodenumber,2,a_value,err,error,*999)
5232 CALL field_parametersetgetlocalnode(dependent_field,field_u_variable_type,field_upwind_values_set_type, &
5233 & elementversionnumber,derivativeidx,nodenumber,1,qupwind,err,error,*999)
5234 CALL field_parametersetgetlocalnode(dependent_field,field_u_variable_type,field_upwind_values_set_type, &
5235 & elementversionnumber,derivativeidx,nodenumber,2,aupwind,err,error,*999)
5238 IF(a_value < a0_param*0.001_dp)
THEN 5239 a_value = a0_param*0.001_dp
5243 momentum = ((alpha*(qupwind**2.0_dp)/aupwind+(aupwind**1.5_dp-a0_param**1.5_dp)*(beta/(3.0_dp*rho_param))) &
5244 & - (alpha*(q_value**2.0_dp)/a_value+(a_value**1.5_dp-a0_param**1.5_dp)*(beta/(3.0_dp*rho_param))))*normal
5247 mass = (qupwind-q_value)*normal
5250 IF(nodenumber==firstnode)
THEN 5251 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(1)= &
5252 & nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(1)+momentum
5253 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(numberofparameters+1)= &
5254 & nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(numberofparameters+1)+mass
5255 ELSE IF(nodenumber==lastnode)
THEN 5256 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(numberofparameters)= &
5257 & nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(numberofparameters)+momentum
5258 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(numberofparameters*2)= &
5259 & nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(numberofparameters*2)+mass
5267 IF(rhs_vector%UPDATE_VECTOR)
THEN 5269 IF(dependent_field%DECOMPOSITION%CALCULATE_FACES)
THEN 5270 CALL navierstokes_finiteelementfaceintegrate(equations_set,element_number,field_variable,err,error,*999)
5289 IF(stiffness_matrix%FIRST_ASSEMBLY)
THEN 5290 IF(update_stiffness_matrix)
THEN 5291 DO mhs=mhs_min+1,mhs_max
5294 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=-stiffness_matrix%ELEMENT_MATRIX%MATRIX(nhs,mhs)
5302 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
5303 &
" is not valid for a Navier-Stokes equation type of a classical field equations set class." 5304 CALL flagerror(local_error,err,error,*999)
5307 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
5310 CALL flagerror(
"Equations set is not associated.",err,error,*999)
5313 exits(
"NavierStokes_FiniteElementResidualEvaluate")
5315 999 errorsexits(
"NavierStokes_FiniteElementResidualEvaluate",err,error)
5318 END SUBROUTINE navierstokes_finiteelementresidualevaluate
5325 SUBROUTINE navierstokes_finiteelementjacobianevaluate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
5329 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
5330 INTEGER(INTG),
INTENT(OUT) :: ERR
5333 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,DEPENDENT_BASIS1,DEPENDENT_BASIS2,GEOMETRIC_BASIS,INDEPENDENT_BASIS
5347 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD,INDEPENDENT_FIELD
5351 INTEGER(INTG) :: ng,mh,mhs,mi,ms,nh,nhs,ni,ns,x,xiIdx,coordIdx
5352 INTEGER(INTG) :: derivativeIdx,elementVersionNumber,firstNode,lastNode,nodeIdx,nodeNumber
5353 INTEGER(INTG) :: numberOfElementNodes,numberOfParameters,numberOfVersions,componentIdx
5354 INTEGER(INTG) :: FIELD_VAR_TYPE,MESH_COMPONENT_NUMBER,MESH_COMPONENT1,MESH_COMPONENT2
5355 REAL(DP) :: JGW,SUM,DXI_DX(3,3),DPHIMS_DXI(3),DPHINS_DXI(3),PHIMS,PHINS
5356 REAL(DP) :: U_VALUE(3),W_VALUE(3),U_DERIV(3,3),Q_VALUE,Q_DERIV,A_VALUE,A_DERIV,alpha,beta,normal,normalWave
5357 REAL(DP) :: MU_PARAM,RHO_PARAM,A0_PARAM,A0_DERIV,E_PARAM,E_DERIV,H_PARAM,H_DERIV,mass,momentum1,momentum2,muScale
5358 LOGICAL :: UPDATE_JACOBIAN_MATRIX
5360 enters(
"NavierStokes_FiniteElementJacobianEvaluate",err,error,*999)
5363 update_jacobian_matrix=.false.
5365 IF(
ASSOCIATED(equations_set))
THEN 5366 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 5367 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
5368 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 5369 CALL flagerror(
"Equations set specification must have three entries for a Navier-Stokes type equations set.", &
5373 equations=>equations_set%EQUATIONS
5374 IF(
ASSOCIATED(equations))
THEN 5375 SELECT CASE(equations_set%specification(3))
5391 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
5392 independent_field=>equations%INTERPOLATION%INDEPENDENT_FIELD
5393 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
5394 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
5395 equations_matrices=>equations%EQUATIONS_MATRICES
5396 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
5397 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5398 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
5399 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5401 equations_mapping=>equations%EQUATIONS_MAPPING
5402 SELECT CASE(equations_set%specification(3))
5405 linear_matrices=>equations_matrices%LINEAR_MATRICES
5406 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5407 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
5408 stiffness_matrix=>linear_matrices%MATRICES(1)%PTR
5409 linear_mapping=>equations_mapping%LINEAR_MAPPING
5410 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5411 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5412 field_var_type=field_variable%VARIABLE_TYPE
5413 stiffness_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
5414 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR=0.0_dp
5415 IF(
ASSOCIATED(jacobian_matrix)) update_jacobian_matrix=jacobian_matrix%UPDATE_JACOBIAN
5417 linear_matrices=>equations_matrices%LINEAR_MATRICES
5418 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5419 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
5420 stiffness_matrix=>linear_matrices%MATRICES(1)%PTR
5421 linear_mapping=>equations_mapping%LINEAR_MAPPING
5422 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5423 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5424 field_var_type=field_variable%VARIABLE_TYPE
5426 stiffness_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
5427 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR=0.0_dp
5428 IF(
ASSOCIATED(jacobian_matrix)) update_jacobian_matrix=jacobian_matrix%UPDATE_JACOBIAN
5430 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5431 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5432 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
5433 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX=0.0_dp
5434 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
5435 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
5436 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5437 field_var_type=field_variable%VARIABLE_TYPE
5438 linear_mapping=>equations_mapping%LINEAR_MAPPING
5439 IF(
ASSOCIATED(jacobian_matrix)) update_jacobian_matrix=jacobian_matrix%UPDATE_JACOBIAN
5442 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5443 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5444 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
5445 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX=0.0_dp
5446 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
5447 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
5448 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5449 field_var_type=field_variable%VARIABLE_TYPE
5450 linear_mapping=>equations_mapping%LINEAR_MAPPING
5451 IF(
ASSOCIATED(jacobian_matrix)) update_jacobian_matrix=jacobian_matrix%UPDATE_JACOBIAN
5452 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5453 & materials_interp_parameters(field_v_variable_type)%PTR,err,error,*999)
5455 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5456 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5457 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
5458 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX=0.0_dp
5459 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
5460 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
5461 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5462 field_var_type=field_variable%VARIABLE_TYPE
5463 linear_mapping=>equations_mapping%LINEAR_MAPPING
5464 IF(
ASSOCIATED(jacobian_matrix)) update_jacobian_matrix=jacobian_matrix%UPDATE_JACOBIAN
5467 decomposition => dependent_field%DECOMPOSITION
5468 mesh_component_number = decomposition%MESH_COMPONENT_NUMBER
5469 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5470 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5471 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
5472 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX=0.0_dp
5473 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
5474 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
5475 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5476 field_var_type=field_variable%VARIABLE_TYPE
5477 linear_mapping=>equations_mapping%LINEAR_MAPPING
5478 IF(
ASSOCIATED(jacobian_matrix)) update_jacobian_matrix=jacobian_matrix%UPDATE_JACOBIAN
5480 independent_field=>equations%INTERPOLATION%INDEPENDENT_FIELD
5481 independent_basis=>independent_field%DECOMPOSITION%DOMAIN(independent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)% &
5482 &
ptr%TOPOLOGY%ELEMENTS%ELEMENTS(element_number)%BASIS
5483 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5484 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5485 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
5486 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX=0.0_dp
5487 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
5488 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
5489 field_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5490 field_var_type=field_variable%VARIABLE_TYPE
5491 linear_mapping=>equations_mapping%LINEAR_MAPPING
5492 IF(
ASSOCIATED(jacobian_matrix)) update_jacobian_matrix=jacobian_matrix%UPDATE_JACOBIAN
5493 CALL field_interpolation_parameters_element_get(field_mesh_velocity_set_type,element_number,equations% &
5494 & interpolation%INDEPENDENT_INTERP_PARAMETERS(field_u_variable_type)%PTR,err,error,*999)
5496 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%specification(3),
"*",err,error))// &
5497 &
" is not valid for a Navier-Stokes fluid type of a fluid mechanics equations set class." 5498 CALL flagerror(local_error,err,error,*999)
5500 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5501 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
5502 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5503 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
5504 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,1, &
5505 & mu_param,err,error,*999)
5506 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,2, &
5507 & rho_param,err,error,*999)
5509 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
5511 & dependent_interp_point(field_var_type)%PTR,err,error,*999)
5513 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
5514 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
5515 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
5519 & independent_interp_point(field_u_variable_type)%PTR,err,error,*999)
5520 w_value(1)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
5521 w_value(2)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
no_part_deriv)
5522 IF(field_variable%NUMBER_OF_COMPONENTS==4)
THEN 5523 w_value(3)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
no_part_deriv)
5534 CALL field_parametersetgetlocalgausspoint(materials_field,field_v_variable_type,field_values_set_type, &
5535 & ng,element_number,1,mu_param,err,error,*999)
5536 mu_param=mu_param*muscale
5550 u_value(1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
no_part_deriv)
5551 u_value(2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(2,
no_part_deriv)
5552 u_deriv(1,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
part_deriv_s1)
5553 u_deriv(1,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
part_deriv_s2)
5554 u_deriv(2,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(2,
part_deriv_s1)
5555 u_deriv(2,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(2,
part_deriv_s2)
5556 IF(field_variable%NUMBER_OF_COMPONENTS==4)
THEN 5557 u_value(3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(3,
no_part_deriv)
5558 u_deriv(3,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(3,
part_deriv_s1)
5559 u_deriv(3,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(3,
part_deriv_s2)
5560 u_deriv(3,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(3,
part_deriv_s3)
5561 u_deriv(1,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
part_deriv_s3)
5562 u_deriv(2,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(2,
part_deriv_s3)
5589 DO mh=1,field_variable%NUMBER_OF_COMPONENTS-1
5590 mesh_component1=field_variable%COMPONENTS(mh)%MESH_COMPONENT_NUMBER
5591 dependent_basis1=>dependent_field%DECOMPOSITION%DOMAIN(mesh_component1)%PTR% &
5592 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5594 jgw=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
5595 & quadrature_scheme1%GAUSS_WEIGHTS(ng)
5597 DO ms=1,dependent_basis1%NUMBER_OF_ELEMENT_PARAMETERS
5600 IF(update_jacobian_matrix)
THEN 5602 DO nh=1,field_variable%NUMBER_OF_COMPONENTS-1
5603 mesh_component2=field_variable%COMPONENTS(nh)%MESH_COMPONENT_NUMBER
5604 dependent_basis2=>dependent_field%DECOMPOSITION%DOMAIN(mesh_component2)%PTR% &
5605 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5606 quadrature_scheme2=>dependent_basis2%QUADRATURE%QUADRATURE_SCHEME_MAP&
5608 DO ns=1,dependent_basis2%NUMBER_OF_ELEMENT_PARAMETERS
5611 DO ni=1,dependent_basis2%NUMBER_OF_XI
5612 DO mi=1,dependent_basis1%NUMBER_OF_XI
5613 dxi_dx(mi,ni)=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR% &
5619 phims=quadrature_scheme1%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)
5620 phins=quadrature_scheme2%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)
5622 IF(update_jacobian_matrix)
THEN 5624 DO ni=1,dependent_basis1%NUMBER_OF_XI
5625 sum=sum+(phins*u_deriv(mh,ni)*dxi_dx(ni,nh)*phims*rho_param)
5628 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)=jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs) &
5634 DO x=1,dependent_basis1%NUMBER_OF_XI
5635 DO mi=1,dependent_basis2%NUMBER_OF_XI
5636 sum=sum+rho_param*(u_value(x)-w_value(x))*dphins_dxi(mi)*dxi_dx(mi,x)*phims
5640 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)=jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs) &
5653 CALL navierstokes_residualbasedstabilisation(equations_set,element_number,ng,mu_param,rho_param,.true., &
5669 q_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
no_part_deriv)
5670 q_deriv=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
first_part_deriv)
5671 a_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(2,
no_part_deriv)
5672 a_deriv=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(2,
first_part_deriv)
5673 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,3, &
5674 & alpha,err,error,*999)
5676 & materials_interp_point(field_v_variable_type)%PTR,err,error,*999)
5677 a0_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(1,
no_part_deriv)
5678 a0_deriv=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(1,
first_part_deriv)
5679 e_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(2,
no_part_deriv)
5680 e_deriv=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(2,
first_part_deriv)
5681 h_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(3,
no_part_deriv)
5682 h_deriv=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR%VALUES(3,
first_part_deriv)
5683 beta = (4.0_dp*sqrt(
pi)*e_param*h_param)/(3.0_dp*a0_param)
5686 IF(a_value < a0_param*0.001_dp)
THEN 5687 a_value = a0_param*0.001_dp
5692 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
5693 mesh_component1=field_variable%COMPONENTS(mh)%MESH_COMPONENT_NUMBER
5694 dependent_basis1=>dependent_field%DECOMPOSITION%DOMAIN(mesh_component1)%PTR% &
5695 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5697 jgw=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
5698 & quadrature_scheme1%GAUSS_WEIGHTS(ng)
5699 elements_topology=>field_variable%COMPONENTS(mh)%DOMAIN%TOPOLOGY%ELEMENTS
5702 DO xiidx=1,dependent_basis1%NUMBER_OF_XI
5703 DO coordidx=1,equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type) &
5704 & %PTR%NUMBER_OF_X_DIMENSIONS
5705 dxi_dx(1,1)=dxi_dx(1,1)+(equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)% &
5706 &
ptr%DXI_DX(xiidx,coordidx))**2.0_dp
5709 dxi_dx(1,1)=sqrt(dxi_dx(1,1))
5711 DO ms=1,dependent_basis1%NUMBER_OF_ELEMENT_PARAMETERS
5712 phims=quadrature_scheme1%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)
5717 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
5718 mesh_component2=field_variable%COMPONENTS(nh)%MESH_COMPONENT_NUMBER
5719 dependent_basis2=>dependent_field%DECOMPOSITION%DOMAIN(mesh_component2)%PTR% &
5720 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5721 quadrature_scheme2=>dependent_basis2%QUADRATURE%QUADRATURE_SCHEME_MAP&
5723 DO ns=1,dependent_basis2%NUMBER_OF_ELEMENT_PARAMETERS
5724 phins=quadrature_scheme2%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)
5727 IF(update_jacobian_matrix)
THEN 5730 IF(mh==1 .AND. nh==1)
THEN 5731 sum=((alpha*2.0_dp*phins*q_deriv/a_value + &
5732 & alpha*2.0_dp*q_value*dphins_dxi(1)/a_value+ &
5733 & (-2.0_dp)*alpha*q_value*phins*a_deriv/(a_value**2.0_dp))*dxi_dx(1,1)+ &
5734 & ((phins/a_value)))*phims
5735 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)= &
5736 & jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)+sum*jgw
5740 IF(mh==1 .AND. nh==2)
THEN 5741 sum=((((-2.0_dp*alpha*q_value*phins*q_deriv)/(a_value**2.0_dp))+ &
5742 & ((2.0_dp*alpha*phins*(q_value**2.0_dp)*a_deriv)/(a_value**3.0_dp))+ &
5743 & (-alpha*((q_value/a_value)**2.0_dp)*dphins_dxi(1))+ &
5744 & ((0.5_dp*phins*(1.0_dp/sqrt(a_value))*a_deriv+sqrt(a_value)*dphins_dxi(1))+ &
5745 & ((1.0_dp/sqrt(a0_param))-((3.0_dp/(a0_param))*sqrt(a_value)))*(a0_deriv) + &
5746 & (2.0_dp*phins*1.5_dp*sqrt(a_value))*h_deriv/h_param+ &
5747 & (2.0_dp*phins*1.5_dp*sqrt(a_value))*e_deriv/e_param) &
5748 & *beta/(2.0_dp*rho_param))*dxi_dx(1,1)+(-phins*q_value/a_value**2.0_dp))*phims
5749 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)= &
5750 & jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)+sum*jgw
5765 elements_topology=>dependent_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR%components(1)%domain%topology%elements
5766 numberofelementnodes=elements_topology%ELEMENTS(element_number)%BASIS%NUMBER_OF_NODES
5767 numberofparameters=elements_topology%MAXIMUM_NUMBER_OF_ELEMENT_PARAMETERS
5768 firstnode=elements_topology%ELEMENTS(element_number)%ELEMENT_NODES(1)
5769 lastnode=elements_topology%ELEMENTS(element_number)%ELEMENT_NODES(numberofelementnodes)
5771 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,2, &
5772 & rho_param,err,error,*999)
5779 DO nodeidx=1,numberofelementnodes
5780 nodenumber=elements_topology%ELEMENTS(element_number)%ELEMENT_NODES(nodeidx)
5781 numberofversions=elements_topology%DOMAIN%TOPOLOGY%NODES%NODES(nodenumber)%DERIVATIVES(1)%numberOfVersions
5784 IF(numberofversions>1)
THEN 5786 elementversionnumber=elements_topology%DOMAIN%TOPOLOGY%ELEMENTS%ELEMENTS(element_number)% &
5787 & elementversions(derivativeidx,nodeidx)
5790 DO componentidx = 1,2
5791 CALL field_parametersetgetlocalnode(independent_field,field_u_variable_type,field_values_set_type, &
5792 & elementversionnumber,derivativeidx,nodenumber,componentidx,normalwave,err,error,*999)
5799 CALL field_parametersetgetlocalnode(materials_field,field_v_variable_type,field_values_set_type, &
5800 & elementversionnumber,derivativeidx,nodenumber,1,a0_param,err,error,*999)
5801 CALL field_parametersetgetlocalnode(materials_field,field_v_variable_type,field_values_set_type, &
5802 & elementversionnumber,derivativeidx,nodenumber,2,e_param,err,error,*999)
5803 CALL field_parametersetgetlocalnode(materials_field,field_v_variable_type,field_values_set_type, &
5804 & elementversionnumber,derivativeidx,nodenumber,3,h_param,err,error,*999)
5805 beta = (4.0_dp*(sqrt(
pi))*e_param*h_param)/(3.0_dp*a0_param)
5808 CALL field_parametersetgetlocalnode(dependent_field,field_u_variable_type,field_values_set_type, &
5809 & elementversionnumber,derivativeidx,nodenumber,1,q_value,err,error,*999)
5810 CALL field_parametersetgetlocalnode(dependent_field,field_u_variable_type,field_values_set_type, &
5811 & elementversionnumber,derivativeidx,nodenumber,2,a_value,err,error,*999)
5814 momentum1 = (-alpha*2.0_dp*q_value/a_value)*normal
5817 momentum2 = (alpha*(q_value/a_value)**2.0_dp-1.5_dp*(a_value**0.5_dp)*(beta/(3.0_dp*rho_param)))*normal
5820 mass = -1.0_dp*normal
5823 IF(nodenumber==firstnode)
THEN 5824 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(1,1)= &
5825 & jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(1,1)+momentum1
5826 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(1,numberofparameters+1)= &
5827 & jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(1,numberofparameters+1)+momentum2
5828 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(numberofparameters+1,1)= &
5829 & jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(numberofparameters+1,1)+mass
5830 ELSE IF(nodenumber==lastnode)
THEN 5831 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(numberofparameters,numberofparameters)= &
5832 & jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(numberofparameters,numberofparameters)+momentum1
5833 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(numberofparameters,2*numberofparameters)= &
5834 & jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(numberofparameters,2*numberofparameters)+momentum2
5835 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(2*numberofparameters,numberofparameters)= &
5836 & jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(2*numberofparameters,numberofparameters)+mass
5844 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
5845 &
" is not valid for a Navier-Stokes equation type of a fluid mechanics equations set class." 5846 CALL flagerror(local_error,err,error,*999)
5849 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
5852 CALL flagerror(
"Equations set is not associated.",err,error,*999)
5855 exits(
"NavierStokes_FiniteElementJacobianEvaluate")
5857 999 errorsexits(
"NavierStokes_FiniteElementJacobianEvaluate",err,error)
5860 END SUBROUTINE navierstokes_finiteelementjacobianevaluate
5867 SUBROUTINE navier_stokes_post_solve(SOLVER,ERR,ERROR,*)
5871 INTEGER(INTG),
INTENT(OUT) :: ERR
5880 INTEGER(INTG) :: iteration,timestep,outputIteration,equationsSetNumber
5881 REAL(DP) :: startTime,stopTime,currentTime,timeIncrement
5883 enters(
"NAVIER_STOKES_POST_SOLVE",err,error,*999)
5886 NULLIFY(dependentfield)
5887 NULLIFY(fieldvariable)
5889 IF(
ASSOCIATED(solver))
THEN 5890 solvers=>solver%SOLVERS
5891 IF(
ASSOCIATED(solvers))
THEN 5892 control_loop=>solvers%CONTROL_LOOP
5893 IF(
ASSOCIATED(control_loop))
THEN 5894 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 5895 IF(.NOT.
ALLOCATED(control_loop%problem%specification))
THEN 5896 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
5897 ELSE IF(
SIZE(control_loop%problem%specification,1)<3)
THEN 5898 CALL flagerror(
"Problem specification must have three entries for a Navier-Stokes problem.",err,error,*999)
5900 SELECT CASE(control_loop%PROBLEM%specification(3))
5902 CALL navier_stokes_post_solve_output_data(solver,err,error,*999)
5904 CALL navier_stokes_post_solve_output_data(solver,err,error,*999)
5906 CALL navier_stokes_post_solve_output_data(solver,err,error,*999)
5908 CALL navier_stokes_post_solve_output_data(solver,err,error,*999)
5910 SELECT CASE(solver%SOLVE_TYPE)
5913 dependentfield=>solver%SOLVER_EQUATIONS%SOLVER_MAPPING%EQUATIONS_SETS(1)%PTR%DEPENDENT%DEPENDENT_FIELD
5914 CALL field_variable_get(dependentfield,field_u_variable_type,fieldvariable,err,error,*999)
5915 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_upwind_values_set_type)%PTR))
THEN 5916 CALL field_parameter_set_create(dependentfield,field_u_variable_type, &
5917 & field_upwind_values_set_type,err,error,*999)
5919 iteration = control_loop%WHILE_LOOP%ITERATION_NUMBER
5920 IF(iteration == 1)
THEN 5921 CALL field_parameter_sets_copy(dependentfield,field_u_variable_type,field_values_set_type, &
5922 & field_upwind_values_set_type,1.0_dp,err,error,*999)
5928 &
" is invalid for a 1D Navier-Stokes problem." 5929 CALL flagerror(local_error,err,error,*999)
5932 IF(
ASSOCIATED(solver%SOLVERS%CONTROL_LOOP%WHILE_LOOP))
THEN 5933 SELECT CASE(solver%GLOBAL_NUMBER)
5936 dependentfield=>solver%SOLVER_EQUATIONS%SOLVER_MAPPING%EQUATIONS_SETS(1)%PTR%DEPENDENT%DEPENDENT_FIELD
5937 CALL field_variable_get(dependentfield,field_u_variable_type,fieldvariable,err,error,*999)
5938 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_upwind_values_set_type)%PTR))
THEN 5939 CALL field_parameter_set_create(dependentfield,field_u_variable_type, &
5940 & field_upwind_values_set_type,err,error,*999)
5942 CALL field_parameter_sets_copy(dependentfield,field_u_variable_type,field_values_set_type, &
5943 & field_upwind_values_set_type,1.0_dp,err,error,*999)
5947 IF(control_loop%CONTROL_LOOP_LEVEL==3)
THEN 5952 local_error=
"The solver global number of "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
5953 &
" is invalid for the iterative 1D-0D coupled Navier-Stokes problem." 5954 CALL flagerror(local_error,err,error,*999)
5956 ELSE IF(
ASSOCIATED(solver%SOLVERS%CONTROL_LOOP%SIMPLE_LOOP))
THEN 5957 IF(solver%GLOBAL_NUMBER == 1)
THEN 5960 local_error=
"The solver global number of "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
5961 &
" is invalid for the CellML DAE simple loop of a 1D0D coupled Navier-Stokes problem." 5962 CALL flagerror(local_error,err,error,*999)
5965 local_error=
"The control loop type for solver "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
5966 &
" is invalid for the a 1D0D coupled Navier-Stokes problem." 5967 CALL flagerror(local_error,err,error,*999)
5970 IF(
ASSOCIATED(solver%SOLVERS%CONTROL_LOOP%WHILE_LOOP))
THEN 5971 SELECT CASE(solver%GLOBAL_NUMBER)
5974 dependentfield=>solver%SOLVER_EQUATIONS%SOLVER_MAPPING%EQUATIONS_SETS(1)%PTR%DEPENDENT%DEPENDENT_FIELD
5975 CALL field_variable_get(dependentfield,field_u_variable_type,fieldvariable,err,error,*999)
5976 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_upwind_values_set_type)%PTR))
THEN 5977 CALL field_parameter_set_create(dependentfield,field_u_variable_type, &
5978 & field_upwind_values_set_type,err,error,*999)
5980 CALL field_parameter_sets_copy(dependentfield,field_u_variable_type,field_values_set_type, &
5981 & field_upwind_values_set_type,1.0_dp,err,error,*999)
5985 IF(control_loop%CONTROL_LOOP_LEVEL==3)
THEN 5990 local_error=
"The solver global number of "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
5991 &
" is invalid for the iterative 1D-0D coupled Navier-Stokes problem." 5992 CALL flagerror(local_error,err,error,*999)
5994 ELSE IF(
ASSOCIATED(solver%SOLVERS%CONTROL_LOOP%SIMPLE_LOOP))
THEN 5995 IF(solver%GLOBAL_NUMBER == 1)
THEN 5998 local_error=
"The solver global number of "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
5999 &
" is invalid for the CellML DAE simple loop of a 1D0D coupled Navier-Stokes problem." 6000 CALL flagerror(local_error,err,error,*999)
6003 local_error=
"The control loop type for solver "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
6004 &
" is invalid for the a 1D0D coupled Navier-Stokes problem." 6005 CALL flagerror(local_error,err,error,*999)
6008 SELECT CASE(solver%GLOBAL_NUMBER)
6011 dependentfield=>solver%SOLVER_EQUATIONS%SOLVER_MAPPING%EQUATIONS_SETS(1)%PTR%DEPENDENT%DEPENDENT_FIELD
6012 CALL field_variable_get(dependentfield,field_u_variable_type,fieldvariable,err,error,*999)
6013 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_upwind_values_set_type)%PTR))
THEN 6014 CALL field_parameter_set_create(dependentfield,field_u_variable_type, &
6015 & field_upwind_values_set_type,err,error,*999)
6017 CALL field_parameter_sets_copy(dependentfield,field_u_variable_type,field_values_set_type, &
6018 & field_upwind_values_set_type,1.0_dp,err,error,*999)
6024 IF(control_loop%WHILE_LOOP%CONTINUE_LOOP .EQV. .false.)
THEN 6026 CALL navier_stokes_post_solve_output_data(solver,err,error,*999)
6029 local_error=
"The solver global number of "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
6030 &
" is invalid for a 1D Navier-Stokes and Advection problem." 6031 CALL flagerror(local_error,err,error,*999)
6034 IF(
ASSOCIATED(solver%SOLVERS%CONTROL_LOOP%WHILE_LOOP))
THEN 6035 SELECT CASE(solver%GLOBAL_NUMBER)
6038 dependentfield=>solver%SOLVER_EQUATIONS%SOLVER_MAPPING%EQUATIONS_SETS(1)%PTR%DEPENDENT%DEPENDENT_FIELD
6039 CALL field_variable_get(dependentfield,field_u_variable_type,fieldvariable,err,error,*999)
6040 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_upwind_values_set_type)%PTR))
THEN 6041 CALL field_parameter_set_create(dependentfield,field_u_variable_type, &
6042 & field_upwind_values_set_type,err,error,*999)
6044 CALL field_parameter_sets_copy(dependentfield,field_u_variable_type,field_values_set_type, &
6045 & field_upwind_values_set_type,1.0_dp,err,error,*999)
6048 IF(control_loop%CONTROL_LOOP_LEVEL==3)
THEN 6053 local_error=
"The solver global number of "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
6054 &
" is invalid for the iterative 1D-0D coupled Navier-Stokes problem." 6055 CALL flagerror(local_error,err,error,*999)
6057 ELSE IF(
ASSOCIATED(solver%SOLVERS%CONTROL_LOOP%SIMPLE_LOOP))
THEN 6059 IF(solver%SOLVERS%CONTROL_LOOP%SUB_LOOP_INDEX == 3)
THEN 6060 CALL navier_stokes_post_solve_output_data(solver,err,error,*999)
6063 local_error=
"The control loop type for solver "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
6064 &
" is invalid for the a 1D0D coupled Navier-Stokes problem." 6065 CALL flagerror(local_error,err,error,*999)
6068 IF(
ASSOCIATED(solver%SOLVERS%CONTROL_LOOP%WHILE_LOOP))
THEN 6069 SELECT CASE(solver%GLOBAL_NUMBER)
6072 dependentfield=>solver%SOLVER_EQUATIONS%SOLVER_MAPPING%EQUATIONS_SETS(1)%PTR%DEPENDENT%DEPENDENT_FIELD
6073 CALL field_variable_get(dependentfield,field_u_variable_type,fieldvariable,err,error,*999)
6074 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_upwind_values_set_type)%PTR))
THEN 6075 CALL field_parameter_set_create(dependentfield,field_u_variable_type, &
6076 & field_upwind_values_set_type,err,error,*999)
6078 CALL field_parameter_sets_copy(dependentfield,field_u_variable_type,field_values_set_type, &
6079 & field_upwind_values_set_type,1.0_dp,err,error,*999)
6082 IF(control_loop%CONTROL_LOOP_LEVEL==3)
THEN 6087 local_error=
"The solver global number of "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
6088 &
" is invalid for the iterative 1D-0D coupled Navier-Stokes problem." 6089 CALL flagerror(local_error,err,error,*999)
6091 ELSE IF(
ASSOCIATED(solver%SOLVERS%CONTROL_LOOP%SIMPLE_LOOP))
THEN 6093 IF(solver%SOLVERS%CONTROL_LOOP%SUB_LOOP_INDEX == 3)
THEN 6094 CALL navier_stokes_post_solve_output_data(solver,err,error,*999)
6097 local_error=
"The control loop type for solver "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
6098 &
" is invalid for the a 1D0D coupled Navier-Stokes problem." 6099 CALL flagerror(local_error,err,error,*999)
6103 & timestep,outputiteration,err,error,*999)
6104 CALL navierstokes_calculateboundaryflux(solver,err,error,*999)
6105 CALL navier_stokes_post_solve_output_data(solver,err,error,*999)
6107 CALL navierstokes_calculateboundaryflux(solver,err,error,*999)
6108 CALL navier_stokes_post_solve_output_data(solver,err,error,*999)
6109 DO equationssetnumber=1,solver%SOLVER_EQUATIONS%SOLVER_MAPPING%NUMBER_OF_EQUATIONS_SETS
6112 IF(solver%SOLVER_EQUATIONS%SOLVER_MAPPING%EQUATIONS_SETS(equationssetnumber)%PTR% &
6114 CALL navierstokes_shearratecalculate(solver%SOLVER_EQUATIONS%SOLVER_MAPPING% &
6115 & equations_sets(equationssetnumber)%PTR%EQUATIONS%EQUATIONS_SET,err,error,*999)
6123 IF(
ASSOCIATED(solver2%DYNAMIC_SOLVER))
THEN 6124 solver2%DYNAMIC_SOLVER%ALE=.true.
6126 CALL flagerror(
"Dynamic solver is not associated for ALE problem.",err,error,*999)
6131 CALL navier_stokes_post_solve_output_data(solver,err,error,*999)
6134 local_error=
"The third problem specification of "// &
6136 &
" is not valid for a Navier-Stokes fluid mechanics problem." 6137 CALL flagerror(local_error,err,error,*999)
6140 CALL flagerror(
"Problem is not associated.",err,error,*999)
6143 CALL flagerror(
"Control loop is not associated.",err,error,*999)
6146 CALL flagerror(
"Solvers is not associated.",err,error,*999)
6149 CALL flagerror(
"Solver is not associated.",err,error,*999)
6152 exits(
"NAVIER_STOKES_POST_SOLVE")
6154 999 errorsexits(
"NAVIER_STOKES_POST_SOLVE",err,error)
6156 END SUBROUTINE navier_stokes_post_solve
6163 SUBROUTINE navierstokes_presolveupdateboundaryconditions(SOLVER,ERR,ERROR,*)
6167 INTEGER(INTG),
INTENT(OUT) :: ERR
6175 TYPE(
equations_set_type),
POINTER :: EQUATIONS_SET,SOLID_EQUATIONS_SET,FLUID_EQUATIONS_SET
6178 TYPE(
equations_type),
POINTER :: EQUATIONS,SOLID_EQUATIONS,FLUID_EQUATIONS
6181 TYPE(
field_type),
POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD
6182 TYPE(
field_type),
POINTER :: INDEPENDENT_FIELD,SOLID_DEPENDENT_FIELD,FLUID_GEOMETRIC_FIELD
6183 TYPE(
field_variable_type),
POINTER :: ANALYTIC_VARIABLE,FIELD_VARIABLE,GEOMETRIC_VARIABLE,MATERIALS_VARIABLE
6185 TYPE(
solver_equations_type),
POINTER :: SOLVER_EQUATIONS,SOLID_SOLVER_EQUATIONS,FLUID_SOLVER_EQUATIONS
6186 TYPE(
solver_mapping_type),
POINTER :: SOLVER_MAPPING,SOLID_SOLVER_MAPPING,FLUID_SOLVER_MAPPING
6190 INTEGER(INTG) :: nodeIdx,derivativeIdx,versionIdx,variableIdx,numberOfSourceTimesteps,timeIdx,componentIdx
6191 INTEGER(INTG) :: NUMBER_OF_DIMENSIONS,BOUNDARY_CONDITION_CHECK_VARIABLE,GLOBAL_DERIV_INDEX,node_idx,variable_type
6192 INTEGER(INTG) :: variable_idx,local_ny,ANALYTIC_FUNCTION_TYPE,component_idx,deriv_idx,dim_idx,version_idx
6193 INTEGER(INTG) :: element_idx,en_idx,I,J,K,number_of_nodes_xic(3),search_idx,localDof,globalDof,componentBC,previousNodeNumber
6194 INTEGER(INTG) :: componentNumberVelocity,numberOfDimensions,numberOfNodes,numberOfGlobalNodes,currentLoopIteration
6195 INTEGER(INTG) :: dependentVariableType,independentVariableType,dependentDof,independentDof,userNodeNumber,localNodeNumber
6196 INTEGER(INTG) :: EquationsSetIndex,SolidNodeNumber,FluidNodeNumber
6197 INTEGER(INTG),
ALLOCATABLE :: InletNodes(:)
6198 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT,DISPLACEMENT_VALUE,
VALUE,XI_COORDINATES(3),timeData,QP,QPP,componentValues(3)
6199 REAL(DP) :: T_COORDINATES(20,3),MU_PARAM,RHO_PARAM,X(3),FluidGFValue,SolidDFValue,NewLaplaceBoundaryValue,Lref,Tref,Mref
6200 REAL(DP),
POINTER :: MESH_VELOCITY_VALUES(:), GEOMETRIC_PARAMETERS(:), BOUNDARY_VALUES(:)
6201 REAL(DP),
POINTER :: TANGENTS(:,:),NORMAL(:),TIME,ANALYTIC_PARAMETERS(:),MATERIALS_PARAMETERS(:)
6202 REAL(DP),
POINTER :: independentParameters(:),dependentParameters(:)
6203 REAL(DP),
ALLOCATABLE :: nodeData(:,:),qSpline(:),qValues(:),tValues(:),BoundaryValues(:)
6204 LOGICAL :: ghostNode,nodeExists,importDataFromFile,ALENavierStokesEquationsSetFound=.false.
6205 LOGICAL :: SolidEquationsSetFound=.false.,solidnodefound=.false.,fluidequationssetfound=.false.
6206 CHARACTER(70) :: inputFile,tempString
6208 NULLIFY(solver_equations)
6209 NULLIFY(solver_mapping)
6210 NULLIFY(equations_set)
6212 NULLIFY(boundary_conditions_variable)
6213 NULLIFY(boundary_conditions)
6214 NULLIFY(analytic_field)
6215 NULLIFY(dependent_field)
6216 NULLIFY(geometric_field)
6217 NULLIFY(materials_field)
6218 NULLIFY(independent_field)
6219 NULLIFY(analytic_variable)
6220 NULLIFY(field_variable)
6221 NULLIFY(geometric_variable)
6222 NULLIFY(materials_variable)
6224 NULLIFY(domain_nodes)
6225 NULLIFY(interpolated_point)
6226 NULLIFY(interpolation_parameters)
6227 NULLIFY(mesh_velocity_values)
6228 NULLIFY(geometric_parameters)
6229 NULLIFY(boundary_values)
6233 NULLIFY(analytic_parameters)
6234 NULLIFY(materials_parameters)
6235 NULLIFY(independentparameters)
6236 NULLIFY(dependentparameters)
6238 enters(
"NavierStokes_PreSolveUpdateBoundaryConditions",err,error,*999)
6240 IF(
ASSOCIATED(solver))
THEN 6241 solvers=>solver%SOLVERS
6242 IF(
ASSOCIATED(solvers))
THEN 6243 control_loop=>solvers%CONTROL_LOOP
6245 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 6246 IF(.NOT.
ALLOCATED(control_loop%problem%specification))
THEN 6247 CALL flagerror(
"Problem specification array is not allocated.",err,error,*999)
6248 ELSE IF(
SIZE(control_loop%problem%specification,1)<3)
THEN 6249 CALL flagerror(
"Problem specification must have three entries for a Navier-Stokes problem.",err,error,*999)
6251 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(1))
6253 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
6260 solver_equations=>solver%SOLVER_EQUATIONS
6261 IF(
ASSOCIATED(solver_equations))
THEN 6262 solver_mapping=>solver_equations%SOLVER_MAPPING
6263 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
6264 IF(
ASSOCIATED(equations))
THEN 6265 equations_set=>equations%EQUATIONS_SET
6269 IF(
ASSOCIATED(equations_set%INDEPENDENT))
THEN 6271 NULLIFY(independentfieldvariable)
6272 NULLIFY(dependentfieldvariable)
6273 independent_field=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
6274 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
6275 independentvariabletype=independent_field%VARIABLES(1)%VARIABLE_TYPE
6276 CALL field_variable_get(independent_field,field_u_variable_type,independentfieldvariable,err,error,*999)
6277 dependentvariabletype=dependent_field%VARIABLES(1)%VARIABLE_TYPE
6278 CALL field_variable_get(dependent_field,field_u_variable_type,dependentfieldvariable,err,error,*999)
6280 & dependentfieldvariable,boundary_conditions_variable,err,error,*999)
6283 IF(
ASSOCIATED(independent_field))
THEN 6284 componentnumbervelocity = 1
6285 numberofdimensions = dependentfieldvariable%NUMBER_OF_COMPONENTS - 1
6287 IF(independentfieldvariable%COMPONENTS(componentnumbervelocity)%INTERPOLATION_TYPE== &
6288 & field_node_based_interpolation)
THEN 6289 domain=>independentfieldvariable%COMPONENTS(componentnumbervelocity)%DOMAIN
6290 IF(
ASSOCIATED(domain))
THEN 6291 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 6292 domain_nodes=>domain%TOPOLOGY%NODES
6293 IF(
ASSOCIATED(domain_nodes))
THEN 6294 numberofnodes = domain_nodes%NUMBER_OF_NODES
6295 numberofglobalnodes = domain_nodes%NUMBER_OF_GLOBAL_NODES
6297 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
6300 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
6303 CALL flagerror(
"Domain is not associated.",err,error,*999)
6306 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
6310 currentloopiteration=control_loop%TIME_LOOP%ITERATION_NUMBER
6311 WRITE(tempstring,
"(I4.4)") currentloopiteration
6312 inputfile =
'./../interpolatedData/fitData' // tempstring(1:4) //
'.dat' 6314 INQUIRE(file=inputfile, exist=importdatafromfile)
6315 IF(importdatafromfile)
THEN 6319 OPEN(unit=10, file=inputfile, status=
'OLD')
6321 previousnodenumber=0
6322 DO nodeidx=1,numberofnodes
6323 usernodenumber=domain_nodes%NODES(nodeidx)%USER_NUMBER
6324 CALL domain_topology_node_check_exists(domain%Topology,usernodenumber,nodeexists,localnodenumber, &
6325 & ghostnode,err,error,*999)
6326 IF(nodeexists .AND. .NOT. ghostnode)
THEN 6329 DO search_idx=1,usernodenumber-previousnodenumber-1
6333 READ(10,*) (componentvalues(componentidx), componentidx=1,numberofdimensions)
6334 DO componentidx=1,numberofdimensions
6335 dependentdof = dependentfieldvariable%COMPONENTS(componentidx)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
6336 & nodes(nodeidx)%DERIVATIVES(1)%VERSIONS(1)
6337 independentdof = independentfieldvariable%COMPONENTS(componentidx)%PARAM_TO_DOF_MAP% &
6338 & node_param2dof_map%NODES(nodeidx)%DERIVATIVES(1)%VERSIONS(1)
6339 VALUE = componentvalues(componentidx)
6340 CALL field_parameter_set_update_local_dof(independent_field,independentvariabletype, &
6341 & field_values_set_type,independentdof,
VALUE,err,error,*999)
6342 CALL field_component_dof_get_user_node(dependent_field,dependentvariabletype,1,1,usernodenumber, &
6343 & componentidx,localdof,globaldof,err,error,*999)
6344 boundary_condition_check_variable=boundary_conditions_variable%CONDITION_TYPES(globaldof)
6346 CALL field_parameter_set_update_local_dof(dependent_field,dependentvariabletype, &
6347 & field_values_set_type,localdof,
VALUE,err,error,*999)
6350 previousnodenumber=usernodenumber
6356 CALL flagerror(
"Equations set independent field is not associated.",err,error,*999)
6361 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 6365 equations_set%ANALYTIC%ANALYTIC_TIME=current_time
6367 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
6368 IF(
ASSOCIATED(boundary_conditions))
THEN 6369 CALL navierstokes_boundaryconditionsanalyticcalculate(equations_set,boundary_conditions,err,error,*999)
6371 ELSE IF(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE== &
6374 IF(
ASSOCIATED(equations_set))
THEN 6375 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 6376 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
6377 IF(
ASSOCIATED(dependent_field))
THEN 6378 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
6379 IF(
ASSOCIATED(geometric_field))
THEN 6381 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err, &
6383 NULLIFY(geometric_variable)
6384 NULLIFY(geometric_parameters)
6385 CALL field_variable_get(geometric_field,field_u_variable_type,geometric_variable,err,error,*999)
6386 CALL field_parameter_set_data_get(geometric_field,field_u_variable_type,field_values_set_type, &
6387 & geometric_parameters,err,error,*999)
6389 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
6390 NULLIFY(analytic_variable)
6391 NULLIFY(analytic_parameters)
6392 IF(
ASSOCIATED(analytic_field))
THEN 6393 CALL field_variable_get(analytic_field,field_u_variable_type,analytic_variable,err,error,*999)
6394 CALL field_parameter_set_data_get(analytic_field,field_u_variable_type,field_values_set_type, &
6395 & analytic_parameters,err,error,*999)
6398 NULLIFY(materials_field)
6399 NULLIFY(materials_variable)
6400 NULLIFY(materials_parameters)
6401 IF(
ASSOCIATED(equations_set%MATERIALS))
THEN 6402 materials_field=>equations_set%MATERIALS%MATERIALS_FIELD
6403 CALL field_variable_get(materials_field,field_u_variable_type,materials_variable,err,error,*999)
6404 CALL field_parameter_set_data_get(materials_field,field_u_variable_type,field_values_set_type, &
6405 & materials_parameters,err,error,*999)
6407 DO variable_idx=1,dependent_field%NUMBER_OF_VARIABLES
6408 variable_type=dependent_field%VARIABLES(variable_idx)%VARIABLE_TYPE
6409 field_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
6410 IF(
ASSOCIATED(field_variable))
THEN 6411 CALL field_parametersetensurecreated(dependent_field,variable_type, &
6412 & field_analytic_values_set_type,err,error,*999)
6413 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
6414 IF(field_variable%COMPONENTS(component_idx)%INTERPOLATION_TYPE== &
6415 & field_node_based_interpolation)
THEN 6416 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
6417 IF(
ASSOCIATED(domain))
THEN 6418 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 6419 domain_nodes=>domain%TOPOLOGY%NODES
6420 IF(
ASSOCIATED(domain_nodes))
THEN 6422 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
6423 DO dim_idx=1,number_of_dimensions
6425 local_ny=geometric_variable%COMPONENTS(dim_idx)%PARAM_TO_DOF_MAP% &
6426 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(1)%VERSIONS(1)
6427 x(dim_idx)=geometric_parameters(local_ny)
6431 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
6432 analytic_function_type=equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE
6433 global_deriv_index=domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)% &
6434 & global_derivative_index
6435 CALL navier_stokes_analytic_functions_evaluate(analytic_function_type,x, &
6436 & current_time,variable_type,global_deriv_index,componentidx, &
6437 & number_of_dimensions,field_variable%NUMBER_OF_COMPONENTS,analytic_parameters, &
6438 & materials_parameters,
VALUE,err,error,*999)
6440 & domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%numberOfVersions
6441 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
6442 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)% &
6443 & versions(version_idx)
6445 CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
6446 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
6448 & dependent_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR, &
6449 & boundary_conditions_variable,err,error,*999)
6450 IF(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE== &
6453 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 6454 boundary_condition_check_variable=boundary_conditions_variable% &
6455 & condition_types(local_ny)
6457 & component_idx<field_variable%NUMBER_OF_COMPONENTS)
THEN 6458 CALL field_parameter_set_update_local_dof(dependent_field, &
6459 & variable_type,field_values_set_type,local_ny, &
6460 &
VALUE,err,error,*999)
6468 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
6471 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
6474 CALL flagerror(
"Domain is not associated.",err,error,*999)
6477 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
6480 CALL field_parameter_set_update_start(dependent_field,variable_type, &
6481 & field_analytic_values_set_type,err,error,*999)
6482 CALL field_parameter_set_update_finish(dependent_field,variable_type, &
6483 & field_analytic_values_set_type,err,error,*999)
6484 CALL field_parameter_set_update_start(dependent_field,variable_type, &
6485 & field_values_set_type,err,error,*999)
6486 CALL field_parameter_set_update_finish(dependent_field,variable_type, &
6487 & field_values_set_type,err,error,*999)
6489 CALL flagerror(
"Field variable is not associated.",err,error,*999)
6492 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,&
6493 & field_values_set_type,geometric_parameters,err,error,*999)
6495 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
6498 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
6501 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
6504 CALL flagerror(
"Equations set is not associated.",err,error,*999)
6512 IF(
ASSOCIATED(equations_set))
THEN 6513 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
6514 IF(
ASSOCIATED(dependent_field))
THEN 6515 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
6516 IF(
ASSOCIATED(geometric_field))
THEN 6518 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions, &
6520 NULLIFY(geometric_variable)
6521 CALL field_variable_get(geometric_field,field_u_variable_type,geometric_variable,err,error,*999)
6522 NULLIFY(geometric_parameters)
6523 CALL field_parameter_set_data_get(geometric_field,field_u_variable_type,field_values_set_type, &
6524 & geometric_parameters,err,error,*999)
6526 analytic_function_type=equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE
6527 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
6528 NULLIFY(analytic_variable)
6529 NULLIFY(analytic_parameters)
6530 IF(
ASSOCIATED(analytic_field))
THEN 6531 CALL field_variable_get(analytic_field,field_u_variable_type,analytic_variable,err,error,*999)
6532 CALL field_parameter_set_data_get(analytic_field,field_u_variable_type,field_values_set_type, &
6533 & analytic_parameters,err,error,*999)
6536 NULLIFY(materials_field)
6537 NULLIFY(materials_variable)
6538 NULLIFY(materials_parameters)
6539 IF(
ASSOCIATED(equations_set%MATERIALS))
THEN 6540 materials_field=>equations_set%MATERIALS%MATERIALS_FIELD
6541 CALL field_variable_get(materials_field,field_u_variable_type,materials_variable,err,error,*999)
6542 CALL field_parameter_set_data_get(materials_field,field_u_variable_type,field_values_set_type, &
6543 & materials_parameters,err,error,*999)
6545 time=equations_set%ANALYTIC%ANALYTIC_TIME
6547 NULLIFY(interpolation_parameters)
6548 CALL field_interpolation_parameters_initialise(geometric_field,interpolation_parameters,err,error,*999)
6549 NULLIFY(interpolated_point)
6550 CALL field_interpolated_points_initialise(interpolation_parameters,interpolated_point,err,error,*999)
6551 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions, &
6553 DO variable_idx=1,dependent_field%NUMBER_OF_VARIABLES
6554 variable_type=dependent_field%VARIABLES(variable_idx)%VARIABLE_TYPE
6555 field_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
6556 IF(
ASSOCIATED(field_variable))
THEN 6557 DO componentidx=1,field_variable%NUMBER_OF_COMPONENTS
6558 IF(field_variable%COMPONENTS(componentidx)%INTERPOLATION_TYPE== &
6559 & field_node_based_interpolation)
THEN 6560 domain=>field_variable%COMPONENTS(componentidx)%DOMAIN
6561 IF(
ASSOCIATED(domain))
THEN 6562 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 6563 domain_nodes=>domain%TOPOLOGY%NODES
6564 IF(
ASSOCIATED(domain_nodes))
THEN 6566 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
6567 element_idx=domain%topology%nodes%nodes(node_idx)%surrounding_elements(1)
6568 CALL field_interpolation_parameters_element_get(field_values_set_type,element_idx, &
6569 & interpolation_parameters(field_u_variable_type)%PTR,err,error,*999)
6571 xi_coordinates=0.0_dp
6572 number_of_nodes_xic(1)=domain%topology%elements%elements(element_idx)% &
6573 & basis%number_of_nodes_xic(1)
6574 number_of_nodes_xic(2)=domain%topology%elements%elements(element_idx)% &
6575 & basis%number_of_nodes_xic(2)
6576 IF(number_of_dimensions==3)
THEN 6577 number_of_nodes_xic(3)=domain%topology%elements%elements(element_idx)%basis% &
6578 & number_of_nodes_xic(3)
6580 number_of_nodes_xic(3)=1
6583 IF(domain%topology%elements%maximum_number_of_element_parameters==4 .OR. &
6584 & domain%topology%elements%maximum_number_of_element_parameters==9 .OR. &
6585 & domain%topology%elements%maximum_number_of_element_parameters==16 .OR. &
6586 & domain%topology%elements%maximum_number_of_element_parameters==8 .OR. &
6587 & domain%topology%elements%maximum_number_of_element_parameters==27 .OR. &
6588 & domain%topology%elements%maximum_number_of_element_parameters==64)
THEN 6589 DO k=1,number_of_nodes_xic(3)
6590 DO j=1,number_of_nodes_xic(2)
6591 DO i=1,number_of_nodes_xic(1)
6593 IF(domain%topology%elements%elements(element_idx)% &
6594 & element_nodes(en_idx)==node_idx)
EXIT 6595 xi_coordinates(1)=xi_coordinates(1)+(1.0_dp/(number_of_nodes_xic(1)-1))
6597 IF(domain%topology%elements%elements(element_idx)% &
6598 & element_nodes(en_idx)==node_idx)
EXIT 6599 xi_coordinates(1)=0.0_dp
6600 xi_coordinates(2)=xi_coordinates(2)+(1.0_dp/(number_of_nodes_xic(2)-1))
6602 IF(domain%topology%elements%elements(element_idx)% &
6603 & element_nodes(en_idx)==node_idx)
EXIT 6604 xi_coordinates(1)=0.0_dp
6605 xi_coordinates(2)=0.0_dp
6606 IF(number_of_nodes_xic(3)/=1)
THEN 6607 xi_coordinates(3)=xi_coordinates(3)+(1.0_dp/(number_of_nodes_xic(3)-1))
6611 & interpolated_point(field_u_variable_type)%PTR,err,error,*999)
6614 IF(domain%topology%elements%maximum_number_of_element_parameters==3)
THEN 6615 t_coordinates(1,1:2)=[0.0_dp,1.0_dp]
6616 t_coordinates(2,1:2)=[1.0_dp,0.0_dp]
6617 t_coordinates(3,1:2)=[1.0_dp,1.0_dp]
6618 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==6)
THEN 6619 t_coordinates(1,1:2)=[0.0_dp,1.0_dp]
6620 t_coordinates(2,1:2)=[1.0_dp,0.0_dp]
6621 t_coordinates(3,1:2)=[1.0_dp,1.0_dp]
6622 t_coordinates(4,1:2)=[0.5_dp,0.5_dp]
6623 t_coordinates(5,1:2)=[1.0_dp,0.5_dp]
6624 t_coordinates(6,1:2)=[0.5_dp,1.0_dp]
6625 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==10.AND. &
6626 & number_of_dimensions==2)
THEN 6627 t_coordinates(1,1:2)=[0.0_dp,1.0_dp]
6628 t_coordinates(2,1:2)=[1.0_dp,0.0_dp]
6629 t_coordinates(3,1:2)=[1.0_dp,1.0_dp]
6630 t_coordinates(4,1:2)=[1.0_dp/3.0_dp,2.0_dp/3.0_dp]
6631 t_coordinates(5,1:2)=[2.0_dp/3.0_dp,1.0_dp/3.0_dp]
6632 t_coordinates(6,1:2)=[1.0_dp,1.0_dp/3.0_dp]
6633 t_coordinates(7,1:2)=[1.0_dp,2.0_dp/3.0_dp]
6634 t_coordinates(8,1:2)=[2.0_dp/3.0_dp,1.0_dp]
6635 t_coordinates(9,1:2)=[1.0_dp/3.0_dp,1.0_dp]
6636 t_coordinates(10,1:2)=[2.0_dp/3.0_dp,2.0_dp/3.0_dp]
6637 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==4)
THEN 6638 t_coordinates(1,1:3)=[0.0_dp,1.0_dp,1.0_dp]
6639 t_coordinates(2,1:3)=[1.0_dp,0.0_dp,1.0_dp]
6640 t_coordinates(3,1:3)=[1.0_dp,1.0_dp,0.0_dp]
6641 t_coordinates(4,1:3)=[1.0_dp,1.0_dp,1.0_dp]
6642 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==10.AND. &
6643 & number_of_dimensions==3)
THEN 6644 t_coordinates(1,1:3)=[0.0_dp,1.0_dp,1.0_dp]
6645 t_coordinates(2,1:3)=[1.0_dp,0.0_dp,1.0_dp]
6646 t_coordinates(3,1:3)=[1.0_dp,1.0_dp,0.0_dp]
6647 t_coordinates(4,1:3)=[1.0_dp,1.0_dp,1.0_dp]
6648 t_coordinates(5,1:3)=[0.5_dp,0.5_dp,1.0_dp]
6649 t_coordinates(6,1:3)=[0.5_dp,1.0_dp,0.5_dp]
6650 t_coordinates(7,1:3)=[0.5_dp,1.0_dp,1.0_dp]
6651 t_coordinates(8,1:3)=[1.0_dp,0.5_dp,0.5_dp]
6652 t_coordinates(9,1:3)=[1.0_dp,1.0_dp,0.5_dp]
6653 t_coordinates(10,1:3)=[1.0_dp,0.5_dp,1.0_dp]
6654 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==20)
THEN 6655 t_coordinates(1,1:3)=[0.0_dp,1.0_dp,1.0_dp]
6656 t_coordinates(2,1:3)=[1.0_dp,0.0_dp,1.0_dp]
6657 t_coordinates(3,1:3)=[1.0_dp,1.0_dp,0.0_dp]
6658 t_coordinates(4,1:3)=[1.0_dp,1.0_dp,1.0_dp]
6659 t_coordinates(5,1:3)=[1.0_dp/3.0_dp,2.0_dp/3.0_dp,1.0_dp]
6660 t_coordinates(6,1:3)=[2.0_dp/3.0_dp,1.0_dp/3.0_dp,1.0_dp]
6661 t_coordinates(7,1:3)=[1.0_dp/3.0_dp,1.0_dp,2.0_dp/3.0_dp]
6662 t_coordinates(8,1:3)=[2.0_dp/3.0_dp,1.0_dp,1.0_dp/3.0_dp]
6663 t_coordinates(9,1:3)=[1.0_dp/3.0_dp,1.0_dp,1.0_dp]
6664 t_coordinates(10,1:3)=[2.0_dp/3.0_dp,1.0_dp,1.0_dp]
6665 t_coordinates(11,1:3)=[1.0_dp,1.0_dp/3.0_dp,2.0_dp/3.0_dp]
6666 t_coordinates(12,1:3)=[1.0_dp,2.0_dp/3.0_dp,1.0_dp/3.0_dp]
6667 t_coordinates(13,1:3)=[1.0_dp,1.0_dp,1.0_dp/3.0_dp]
6668 t_coordinates(14,1:3)=[1.0_dp,1.0_dp,2.0_dp/3.0_dp]
6669 t_coordinates(15,1:3)=[1.0_dp,1.0_dp/3.0_dp,1.0_dp]
6670 t_coordinates(16,1:3)=[1.0_dp,2.0_dp/3.0_dp,1.0_dp]
6671 t_coordinates(17,1:3)=[2.0_dp/3.0_dp,2.0_dp/3.0_dp,2.0_dp/3.0_dp]
6672 t_coordinates(18,1:3)=[2.0_dp/3.0_dp,2.0_dp/3.0_dp,1.0_dp]
6673 t_coordinates(19,1:3)=[2.0_dp/3.0_dp,1.0_dp,2.0_dp/3.0_dp]
6674 t_coordinates(20,1:3)=[1.0_dp,2.0_dp/3.0_dp,2.0_dp/3.0_dp]
6676 DO k=1,domain%topology%elements%maximum_number_of_element_parameters
6677 IF(domain%topology%elements%elements(element_idx)%element_nodes(k)==node_idx)
EXIT 6679 IF(number_of_dimensions==2)
THEN 6680 CALL field_interpolate_xi(
no_part_deriv,t_coordinates(k,1:2), &
6681 & interpolated_point(field_u_variable_type)%PTR,err,error,*999)
6682 ELSE IF(number_of_dimensions==3)
THEN 6683 CALL field_interpolate_xi(
no_part_deriv,t_coordinates(k,1:3), &
6684 & interpolated_point(field_u_variable_type)%PTR,err,error,*999)
6688 DO dim_idx=1,number_of_dimensions
6689 x(dim_idx)=interpolated_point(field_u_variable_type)%PTR%VALUES(dim_idx,1)
6692 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
6693 analytic_function_type=equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE
6694 global_deriv_index=domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)% &
6695 & global_derivative_index
6696 materials_field=>equations_set%MATERIALS%MATERIALS_FIELD
6698 mu_param=materials_field%variables(1)%parameter_sets%parameter_sets(1)%ptr% &
6699 & parameters%cmiss%data_dp(1)
6701 rho_param=materials_field%variables(1)%parameter_sets%parameter_sets(1)%ptr% &
6702 & parameters%cmiss%data_dp(2)
6703 CALL navier_stokes_analytic_functions_evaluate(analytic_function_type,x, &
6704 & current_time,variable_type,global_deriv_index,componentidx,number_of_dimensions,&
6705 & field_variable%NUMBER_OF_COMPONENTS,analytic_parameters, &
6706 & materials_parameters,
VALUE,err,error,*999)
6708 local_ny=field_variable%COMPONENTS(componentidx)%PARAM_TO_DOF_MAP% &
6709 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
6710 CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
6711 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
6713 & variable_type_map(field_u_variable_type)%PTR,boundary_conditions_variable, &
6715 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 6716 boundary_condition_check_variable=boundary_conditions_variable% &
6717 & condition_types(local_ny)
6719 CALL field_parameter_set_update_local_dof(dependent_field, &
6720 & variable_type,field_values_set_type,local_ny, &
6721 &
VALUE,err,error,*999)
6724 CALL flagerror(
"Boundary conditions U variable is not associated.", &
6730 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
6733 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
6736 CALL flagerror(
"Domain is not associated.",err,error,*999)
6739 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
6742 CALL field_parameter_set_update_start(dependent_field,variable_type, &
6743 & field_analytic_values_set_type,err,error,*999)
6744 CALL field_parameter_set_update_finish(dependent_field,variable_type, &
6745 & field_analytic_values_set_type,err,error,*999)
6746 CALL field_parameter_set_update_start(dependent_field,variable_type, &
6747 & field_values_set_type,err,error,*999)
6748 CALL field_parameter_set_update_finish(dependent_field,variable_type, &
6749 & field_values_set_type,err,error,*999)
6751 CALL flagerror(
"Field variable is not associated.",err,error,*999)
6754 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,&
6755 & field_values_set_type,geometric_parameters,err,error,*999)
6757 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
6760 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
6763 CALL flagerror(
"Equations set is not associated.",err,error,*999)
6771 CALL flagerror(
"Equations are not associated.",err,error,*999)
6774 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
6776 CALL field_parameter_set_update_start(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
6777 & field_values_set_type,err,error,*999)
6778 CALL field_parameter_set_update_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
6779 & field_values_set_type,err,error,*999)
6786 solver_equations=>solver%SOLVER_EQUATIONS
6787 IF(
ASSOCIATED(solver_equations))
THEN 6789 solver_mapping=>solver_equations%SOLVER_MAPPING
6790 IF(
ASSOCIATED(solver_mapping))
THEN 6791 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
6792 IF(
ASSOCIATED(equations))
THEN 6793 equations_set=>equations%EQUATIONS_SET
6794 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 6795 SELECT CASE(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE)
6798 equations_set%ANALYTIC%ANALYTIC_TIME=current_time
6799 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
6800 IF(
ASSOCIATED(boundary_conditions))
THEN 6802 CALL navierstokes_boundaryconditionsanalyticcalculate(equations_set,boundary_conditions,err,error,*999)
6804 CALL flagerror(
"Boundary conditions are not associated.",err,error,*999)
6808 equations_set%ANALYTIC%ANALYTIC_TIME=current_time
6809 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
6810 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
6811 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
6812 DO variableidx=1,dependent_field%NUMBER_OF_VARIABLES
6813 dependentvariabletype=dependent_field%VARIABLES(variableidx)%VARIABLE_TYPE
6814 NULLIFY(dependentfieldvariable)
6815 CALL field_variable_get(dependent_field,dependentvariabletype,dependentfieldvariable,err,error,*999)
6817 & dependentfieldvariable,boundary_conditions_variable,err,error,*999)
6818 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 6819 IF(
ASSOCIATED(dependentfieldvariable))
THEN 6820 DO componentidx=1,dependentfieldvariable%NUMBER_OF_COMPONENTS
6821 IF(dependentfieldvariable%COMPONENTS(componentidx)%INTERPOLATION_TYPE== &
6822 & field_node_based_interpolation)
THEN 6823 domain=>dependentfieldvariable%COMPONENTS(componentidx)%DOMAIN
6824 IF(
ASSOCIATED(domain))
THEN 6825 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 6826 domain_nodes=>domain%TOPOLOGY%NODES
6827 IF(
ASSOCIATED(domain_nodes))
THEN 6829 DO nodeidx=1,domain_nodes%NUMBER_OF_NODES
6830 usernodenumber=domain_nodes%NODES(nodeidx)%USER_NUMBER
6831 DO derivativeidx=1,domain_nodes%NODES(nodeidx)%NUMBER_OF_DERIVATIVES
6832 DO versionidx=1,domain_nodes%NODES(nodeidx)%DERIVATIVES(derivativeidx)%numberOfVersions
6834 inputfile =
'./input/interpolatedData/1D/' 6835 IF(dependentvariabletype == field_u_variable_type)
THEN 6836 inputfile =
trim(inputfile) //
'U/component' 6838 WRITE(tempstring,
"(I1.1)") componentidx
6839 inputfile =
trim(inputfile) // tempstring(1:1) //
'/derivative' 6840 WRITE(tempstring,
"(I1.1)") derivativeidx
6841 inputfile =
trim(inputfile) // tempstring(1:1) //
'/version' 6842 WRITE(tempstring,
"(I1.1)") versionidx
6843 inputfile =
trim(inputfile) // tempstring(1:1) //
'/' 6844 WRITE(tempstring,
"(I4.4)") usernodenumber
6845 inputfile =
trim(inputfile) // tempstring(1:4) //
'.dat' 6846 inputfile =
trim(inputfile)
6847 INQUIRE(file=inputfile, exist=importdatafromfile)
6848 IF(importdatafromfile)
THEN 6850 IF(.NOT.
ASSOCIATED(dependentfieldvariable%PARAMETER_SETS% &
6851 & set_type(field_analytic_values_set_type)%PTR)) &
6852 &
CALL field_parameter_set_create(dependent_field,dependentvariabletype, &
6853 & field_analytic_values_set_type,err,error,*999)
6855 OPEN(unit=10, file=inputfile, status=
'OLD')
6858 numberofsourcetimesteps = int(timedata)
6859 ALLOCATE(nodedata(numberofsourcetimesteps,2))
6860 ALLOCATE(qvalues(numberofsourcetimesteps))
6861 ALLOCATE(tvalues(numberofsourcetimesteps))
6862 ALLOCATE(qspline(numberofsourcetimesteps))
6865 DO timeidx=1,numberofsourcetimesteps
6866 READ(10,*) (nodedata(timeidx,component_idx), component_idx=1,2)
6869 tvalues = nodedata(:,1)
6870 qvalues = nodedata(:,2)
6871 CALL spline_cubic_set(numberofsourcetimesteps,tvalues,qvalues,2,0.0_dp,2,0.0_dp, &
6872 & qspline,err,error,*999)
6874 & current_time,
VALUE,qp,qpp,err,error,*999)
6876 DEALLOCATE(nodedata)
6881 dependentdof = dependentfieldvariable%COMPONENTS(componentidx)%PARAM_TO_DOF_MAP% &
6882 & node_param2dof_map%NODES(nodeidx)%DERIVATIVES(derivativeidx)%VERSIONS(versionidx)
6883 CALL field_parameter_set_update_local_dof(dependent_field,dependentvariabletype, &
6884 & field_analytic_values_set_type,dependentdof,
VALUE,err,error,*999)
6886 boundary_condition_check_variable=boundary_conditions_variable% &
6887 & condition_types(dependentdof)
6889 CALL field_parameter_set_update_local_dof(dependent_field,dependentvariabletype, &
6890 & field_values_set_type,dependentdof,
VALUE,err,error,*999)
6897 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
6900 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
6903 CALL flagerror(
"Domain is not associated.",err,error,*999)
6906 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
6910 CALL flagerror(
"Dependent field variable is not associated.",err,error,*999)
6916 equations_set%ANALYTIC%ANALYTIC_TIME=current_time
6917 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
6918 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
6919 materials_field=>equations_set%MATERIALS%MATERIALS_FIELD
6920 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,5, &
6921 & lref,err,error,*999)
6922 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,6, &
6923 & tref,err,error,*999)
6924 CALL field_parameter_set_get_constant(materials_field,field_u_variable_type,field_values_set_type,7, &
6925 & mref,err,error,*999)
6926 DO variableidx=1,dependent_field%NUMBER_OF_VARIABLES
6927 dependentvariabletype=dependent_field%VARIABLES(variableidx)%VARIABLE_TYPE
6928 NULLIFY(dependentfieldvariable)
6929 CALL field_variable_get(dependent_field,dependentvariabletype,dependentfieldvariable,err,error,*999)
6931 & boundary_conditions_variable,err,error,*999)
6932 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 6933 IF(
ASSOCIATED(dependentfieldvariable))
THEN 6934 DO componentidx=1,dependentfieldvariable%NUMBER_OF_COMPONENTS
6935 IF(dependentfieldvariable%COMPONENTS(componentidx)%INTERPOLATION_TYPE== &
6936 & field_node_based_interpolation)
THEN 6937 domain=>dependentfieldvariable%COMPONENTS(componentidx)%DOMAIN
6938 IF(
ASSOCIATED(domain))
THEN 6939 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 6940 domain_nodes=>domain%TOPOLOGY%NODES
6941 IF(
ASSOCIATED(domain_nodes))
THEN 6943 DO nodeidx=1,domain_nodes%NUMBER_OF_NODES
6944 usernodenumber=domain_nodes%NODES(nodeidx)%USER_NUMBER
6945 DO derivativeidx=1,domain_nodes%NODES(nodeidx)%NUMBER_OF_DERIVATIVES
6946 DO versionidx=1,domain_nodes%NODES(nodeidx)%DERIVATIVES(derivativeidx)%numberOfVersions
6947 dependentdof = dependentfieldvariable%COMPONENTS(componentidx)%PARAM_TO_DOF_MAP% &
6948 & node_param2dof_map%NODES(nodeidx)%DERIVATIVES(derivativeidx)%VERSIONS(versionidx)
6949 boundary_condition_check_variable=boundary_conditions_variable% &
6950 & condition_types(dependentdof)
6952 CALL field_parametersetgetlocalnode(dependent_field,field_u1_variable_type, &
6953 & field_values_set_type,versionidx,derivativeidx,usernodenumber,1,
VALUE, &
6956 CALL field_parameter_set_update_local_dof(dependent_field,dependentvariabletype, &
6957 & field_values_set_type,dependentdof,((lref**3.0)/tref)*
VALUE,err,error,*999)
6963 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
6966 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
6969 CALL flagerror(
"Domain is not associated.",err,error,*999)
6972 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
6976 CALL flagerror(
"Dependent field variable is not associated.",err,error,*999)
6985 CALL flagerror(
"Equations are not associated.",err,error,*999)
6988 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
6992 CALL navierstokes_updatemultiscaleboundary(solver,err,error,*999)
6995 solver_equations=>solver%SOLVER_EQUATIONS
6996 IF(
ASSOCIATED(solver_equations))
THEN 6997 solver_mapping=>solver_equations%SOLVER_MAPPING
6998 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
6999 IF(
ASSOCIATED(equations))
THEN 7000 equations_set=>equations%EQUATIONS_SET
7001 IF(
ASSOCIATED(equations_set))
THEN 7002 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
7003 IF(
ASSOCIATED(boundary_conditions))
THEN 7004 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
7005 IF(
ASSOCIATED(field_variable))
THEN 7007 & boundary_conditions_variable,err,error,*999)
7009 CALL flagerror(
"Field U variable is not associated",err,error,*999)
7011 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 7012 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
7013 & number_of_dimensions,err,error,*999)
7014 NULLIFY(boundary_values)
7015 CALL field_parameter_set_data_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7016 & field_boundary_set_type,boundary_values,err,error,*999)
7019 & control_loop%TIME_LOOP%ITERATION_NUMBER,current_time,1.0_dp)
7020 DO variable_idx=1,equations_set%DEPENDENT%DEPENDENT_FIELD%NUMBER_OF_VARIABLES
7021 variable_type=equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLES(variable_idx)%VARIABLE_TYPE
7022 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(variable_type)%PTR
7023 IF(
ASSOCIATED(field_variable))
THEN 7024 DO componentidx=1,field_variable%NUMBER_OF_COMPONENTS
7025 domain=>field_variable%COMPONENTS(componentidx)%DOMAIN
7026 IF(
ASSOCIATED(domain))
THEN 7027 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 7028 domain_nodes=>domain%TOPOLOGY%NODES
7029 IF(
ASSOCIATED(domain_nodes))
THEN 7031 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
7032 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
7034 local_ny=field_variable%COMPONENTS(componentidx)%PARAM_TO_DOF_MAP% &
7035 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
7036 boundary_condition_check_variable=boundary_conditions_variable% &
7037 & condition_types(local_ny)
7039 CALL field_parameter_set_update_local_dof(equations_set%DEPENDENT%DEPENDENT_FIELD, &
7040 & field_u_variable_type,field_values_set_type,local_ny, &
7041 & boundary_values(local_ny),err,error,*999)
7054 CALL flagerror(
"Boundary condition variable is not associated.",err,error,*999)
7057 CALL flagerror(
"Boundary conditions are not associated.",err,error,*999)
7060 CALL flagerror(
"Equations set is not associated.",err,error,*999)
7063 CALL flagerror(
"Equations are not associated.",err,error,*999)
7066 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
7068 CALL field_parameter_set_update_start(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7069 & field_values_set_type,err,error,*999)
7070 CALL field_parameter_set_update_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7071 & field_values_set_type,err,error,*999)
7076 solver_equations=>solver%SOLVER_EQUATIONS
7077 IF(
ASSOCIATED(solver_equations))
THEN 7078 solver_mapping=>solver_equations%SOLVER_MAPPING
7079 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
7080 IF(
ASSOCIATED(equations))
THEN 7081 equations_set=>equations%EQUATIONS_SET
7082 IF(
ASSOCIATED(equations_set))
THEN 7083 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
7084 IF(
ASSOCIATED(boundary_conditions))
THEN 7085 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
7086 IF(
ASSOCIATED(field_variable))
THEN 7088 & boundary_conditions_variable,err,error,*999)
7090 CALL flagerror(
"Field U variable is not associated",err,error,*999)
7092 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 7093 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
7094 & number_of_dimensions,err,error,*999)
7095 NULLIFY(mesh_velocity_values)
7096 CALL field_parameter_set_data_get(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
7097 & field_mesh_velocity_set_type,mesh_velocity_values,err,error,*999)
7098 NULLIFY(boundary_values)
7099 CALL field_parameter_set_data_get(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
7100 & field_boundary_set_type,boundary_values,err,error,*999)
7103 & control_loop%TIME_LOOP%ITERATION_NUMBER,current_time,1.0_dp)
7104 DO variable_idx=1,equations_set%DEPENDENT%DEPENDENT_FIELD%NUMBER_OF_VARIABLES
7105 variable_type=equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLES(variable_idx)%VARIABLE_TYPE
7106 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(variable_type)%PTR
7107 IF(
ASSOCIATED(field_variable))
THEN 7108 DO componentidx=1,field_variable%NUMBER_OF_COMPONENTS
7109 domain=>field_variable%COMPONENTS(componentidx)%DOMAIN
7110 IF(
ASSOCIATED(domain))
THEN 7111 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 7112 domain_nodes=>domain%TOPOLOGY%NODES
7113 IF(
ASSOCIATED(domain_nodes))
THEN 7115 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
7116 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
7118 local_ny=field_variable%COMPONENTS(componentidx)%PARAM_TO_DOF_MAP% &
7119 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
7120 displacement_value=0.0_dp
7121 boundary_condition_check_variable=boundary_conditions_variable% &
7122 & condition_types(local_ny)
7124 CALL field_parameter_set_update_local_dof(equations_set%DEPENDENT%DEPENDENT_FIELD, &
7125 & field_u_variable_type,field_values_set_type,local_ny, &
7126 & mesh_velocity_values(local_ny),err,error,*999)
7128 CALL field_parameter_set_update_local_dof(equations_set%DEPENDENT%DEPENDENT_FIELD, &
7129 & field_u_variable_type,field_values_set_type,local_ny, &
7130 & boundary_values(local_ny),err,error,*999)
7141 CALL flagerror(
"Boundary condition variable is not associated.",err,error,*999)
7144 CALL flagerror(
"Boundary conditions are not associated.",err,error,*999)
7147 CALL flagerror(
"Equations set is not associated.",err,error,*999)
7150 CALL flagerror(
"Equations are not associated.",err,error,*999)
7153 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
7155 CALL field_parameter_set_update_start(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7156 & field_values_set_type,err,error,*999)
7157 CALL field_parameter_set_update_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7158 & field_values_set_type,err,error,*999)
7164 solver_equations=>solver%SOLVER_EQUATIONS
7165 IF(
ASSOCIATED(solver_equations))
THEN 7166 solver_mapping=>solver_equations%SOLVER_MAPPING
7167 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
7168 IF(
ASSOCIATED(equations))
THEN 7169 equations_set=>equations%EQUATIONS_SET
7170 IF(
ASSOCIATED(equations_set))
THEN 7171 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
7172 IF(
ASSOCIATED(boundary_conditions))
THEN 7173 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
7174 IF(
ASSOCIATED(field_variable))
THEN 7176 & boundary_conditions_variable,err,error,*999)
7178 CALL flagerror(
"Field U variable is not associated",err,error,*999)
7180 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 7181 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
7182 & number_of_dimensions,err,error,*999)
7183 NULLIFY(boundary_values)
7184 CALL field_parameter_set_data_get(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
7185 & field_boundary_set_type,boundary_values,err,error,*999)
7188 & control_loop%TIME_LOOP%ITERATION_NUMBER,current_time,1.0_dp)
7189 DO variable_idx=1,equations_set%DEPENDENT%DEPENDENT_FIELD%NUMBER_OF_VARIABLES
7190 variable_type=equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLES(variable_idx)%VARIABLE_TYPE
7191 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(variable_type)%PTR
7192 IF(
ASSOCIATED(field_variable))
THEN 7193 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
7194 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
7195 IF(
ASSOCIATED(domain))
THEN 7196 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 7197 domain_nodes=>domain%TOPOLOGY%NODES
7198 IF(
ASSOCIATED(domain_nodes))
THEN 7200 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
7201 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
7203 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
7204 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
7205 boundary_condition_check_variable=boundary_conditions_variable% &
7206 & condition_types(local_ny)
7208 CALL field_parameter_set_update_local_dof(equations_set%DEPENDENT%DEPENDENT_FIELD, &
7209 & field_u_variable_type,field_values_set_type,local_ny, &
7210 & boundary_values(local_ny),err,error,*999)
7220 CALL field_parameter_set_data_restore(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
7221 & field_u_variable_type,field_boundary_set_type,boundary_values,err,error,*999)
7224 CALL flagerror(
"Boundary condition variable is not associated.",err,error,*999)
7227 CALL flagerror(
"Boundary conditions are not associated.",err,error,*999)
7230 CALL flagerror(
"Equations set is not associated.",err,error,*999)
7233 CALL flagerror(
"Equations are not associated.",err,error,*999)
7236 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
7238 CALL field_parameter_set_update_start(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7239 & field_values_set_type,err,error,*999)
7240 CALL field_parameter_set_update_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7241 & field_values_set_type,err,error,*999)
7245 solver_equations=>solver%SOLVER_EQUATIONS
7246 IF(
ASSOCIATED(solver_equations))
THEN 7247 solver_mapping=>solver_equations%SOLVER_MAPPING
7248 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
7249 IF(
ASSOCIATED(equations))
THEN 7250 equations_set=>equations%EQUATIONS_SET
7251 IF(
ASSOCIATED(equations_set))
THEN 7252 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
7253 IF(
ASSOCIATED(boundary_conditions))
THEN 7254 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
7255 IF(
ASSOCIATED(field_variable))
THEN 7257 & boundary_conditions_variable,err,error,*999)
7259 CALL flagerror(
"Field U variable is not associated",err,error,*999)
7261 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 7262 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
7263 & number_of_dimensions,err,error,*999)
7264 NULLIFY(mesh_velocity_values)
7265 CALL field_parameter_set_data_get(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
7266 & field_mesh_velocity_set_type,mesh_velocity_values,err,error,*999)
7267 NULLIFY(boundary_values)
7268 CALL field_parameter_set_data_get(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
7269 & field_boundary_set_type,boundary_values,err,error,*999)
7272 & control_loop%TIME_LOOP%ITERATION_NUMBER,current_time,1.0_dp)
7273 DO variable_idx=1,equations_set%DEPENDENT%DEPENDENT_FIELD%NUMBER_OF_VARIABLES
7274 variable_type=equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLES(variable_idx)%VARIABLE_TYPE
7275 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(variable_type)%PTR
7276 IF(
ASSOCIATED(field_variable))
THEN 7277 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
7278 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
7279 IF(
ASSOCIATED(domain))
THEN 7280 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 7281 domain_nodes=>domain%TOPOLOGY%NODES
7282 IF(
ASSOCIATED(domain_nodes))
THEN 7284 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
7285 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
7287 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
7288 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
7289 displacement_value=0.0_dp
7290 boundary_condition_check_variable=boundary_conditions_variable% &
7291 & condition_types(local_ny)
7293 CALL field_parameter_set_update_local_dof(equations_set%DEPENDENT%DEPENDENT_FIELD, &
7294 & field_u_variable_type,field_values_set_type,local_ny, &
7295 & mesh_velocity_values(local_ny),err,error,*999)
7297 CALL field_parameter_set_update_local_dof(equations_set%DEPENDENT%DEPENDENT_FIELD, &
7298 & field_u_variable_type,field_values_set_type,local_ny, &
7299 & boundary_values(local_ny),err,error,*999)
7309 CALL field_parameter_set_data_restore(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
7310 & field_u_variable_type,field_mesh_velocity_set_type,mesh_velocity_values,err,error,*999)
7311 CALL field_parameter_set_data_restore(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
7312 & field_u_variable_type,field_boundary_set_type,boundary_values,err,error,*999)
7314 CALL flagerror(
"Boundary condition variable is not associated.",err,error,*999)
7317 CALL flagerror(
"Boundary conditions are not associated.",err,error,*999)
7320 CALL flagerror(
"Equations set is not associated.",err,error,*999)
7323 CALL flagerror(
"Equations are not associated.",err,error,*999)
7326 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
7328 CALL field_parameter_set_update_start(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7329 & field_values_set_type,err,error,*999)
7330 CALL field_parameter_set_update_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7331 & field_values_set_type,err,error,*999)
7335 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
7336 &
" is not valid for a Navier-Stokes equation fluid type of a fluid mechanics problem class." 7337 CALL flagerror(local_error,err,error,*999)
7340 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(2))
7342 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
7348 solver_equations=>solver%SOLVER_EQUATIONS
7349 IF(
ASSOCIATED(solver_equations))
THEN 7350 solver_mapping=>solver_equations%SOLVER_MAPPING
7351 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
7352 IF(
ASSOCIATED(equations))
THEN 7353 equations_set=>equations%EQUATIONS_SET
7354 IF(
ASSOCIATED(equations_set))
THEN 7355 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
7356 IF(
ASSOCIATED(boundary_conditions))
THEN 7357 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
7358 IF(
ASSOCIATED(field_variable))
THEN 7360 & boundary_conditions_variable,err,error,*999)
7362 CALL flagerror(
"Field U variable is not associated",err,error,*999)
7364 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 7365 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
7366 & number_of_dimensions,err,error,*999)
7370 IF(.NOT.
ASSOCIATED(solver2))
CALL flagerror(
"Dynamic solver is not associated.",err,error,*999)
7372 solid_solver_equations=>solver2%SOLVER_EQUATIONS
7373 IF(
ASSOCIATED(solid_solver_equations))
THEN 7374 solid_solver_mapping=>solid_solver_equations%SOLVER_MAPPING
7375 IF(
ASSOCIATED(solid_solver_mapping))
THEN 7377 solidequationssetfound=.false.
7378 DO WHILE (.NOT.solidequationssetfound &
7379 & .AND.equationssetindex<=solid_solver_mapping%NUMBER_OF_EQUATIONS_SETS)
7380 solid_equations=>solid_solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equationssetindex)%EQUATIONS
7381 IF(
ASSOCIATED(solid_equations))
THEN 7382 solid_equations_set=>solid_equations%EQUATIONS_SET
7383 IF(
ASSOCIATED(solid_equations_set))
THEN 7387 & (solid_equations_set%SPECIFICATION(3)== &
7389 solidequationssetfound=.true.
7391 equationssetindex=equationssetindex+1
7394 CALL flagerror(
"Solid equations set is not associated.",err,error,*999)
7397 CALL flagerror(
"Solid equations not associated.",err,error,*999)
7400 IF(solidequationssetfound.EQV..false.)
THEN 7401 local_error=
"Solid equations set not found when trying to update boundary conditions." 7402 CALL flagerror(local_error,err,error,*999)
7405 CALL flagerror(
"Solid solver mapping is not associated.",err,error,*999)
7408 CALL flagerror(
"Solver equations for solid equations set not associated.",err,error,*999)
7410 solid_dependent=>solid_equations_set%DEPENDENT
7411 IF(.NOT.
ASSOCIATED(solid_dependent%DEPENDENT_FIELD))
THEN 7412 CALL flagerror(
"Solid equations set dependent field is not associated.",err,error,*999)
7414 solid_dependent_field=>solid_dependent%DEPENDENT_FIELD
7416 fluid_solver_equations=>solver2%SOLVER_EQUATIONS
7417 IF(
ASSOCIATED(fluid_solver_equations))
THEN 7418 fluid_solver_mapping=>fluid_solver_equations%SOLVER_MAPPING
7419 IF(
ASSOCIATED(fluid_solver_mapping))
THEN 7421 fluidequationssetfound=.false.
7422 DO WHILE (.NOT.fluidequationssetfound &
7423 & .AND.equationssetindex<=fluid_solver_mapping%NUMBER_OF_EQUATIONS_SETS)
7424 fluid_equations=>fluid_solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equationssetindex)%EQUATIONS
7425 IF(
ASSOCIATED(solid_equations))
THEN 7426 fluid_equations_set=>fluid_equations%EQUATIONS_SET
7427 IF(
ASSOCIATED(fluid_equations_set))
THEN 7431 fluidequationssetfound=.true.
7433 equationssetindex=equationssetindex+1
7436 CALL flagerror(
"Fluid equations set is not associated.",err,error,*999)
7439 CALL flagerror(
"Fluid equations not associated.",err,error,*999)
7442 IF(fluidequationssetfound.EQV..false.)
THEN 7443 local_error=
"Fluid equations set not found when trying to update boundary conditions." 7444 CALL flagerror(local_error,err,error,*999)
7447 CALL flagerror(
"Fluid solver mapping is not associated.",err,error,*999)
7450 CALL flagerror(
"Fluid equations for fluid equations set not associated.",err,error,*999)
7452 fluid_geometric=>fluid_equations_set%GEOMETRY
7453 IF(.NOT.
ASSOCIATED(fluid_geometric%GEOMETRIC_FIELD))
THEN 7454 CALL flagerror(
"Fluid equations set geometric field is not associated",err,error,*999)
7456 fluid_geometric_field=>fluid_geometric%GEOMETRIC_FIELD
7459 variable_type=equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLES(variable_idx)%VARIABLE_TYPE
7460 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(variable_type)%PTR
7461 IF(
ASSOCIATED(field_variable))
THEN 7462 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
7463 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
7464 IF(
ASSOCIATED(domain))
THEN 7465 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 7466 domain_nodes=>domain%TOPOLOGY%NODES
7467 IF(
ASSOCIATED(domain_nodes))
THEN 7469 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
7470 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
7472 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
7473 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
7474 boundary_condition_check_variable=boundary_conditions_variable% &
7475 & condition_types(local_ny)
7479 fluidnodenumber=node_idx
7480 DO search_idx=1,
SIZE(solver2%SOLVER_EQUATIONS%SOLVER_MAPPING% &
7481 & interface_conditions(1)%PTR%INTERFACE% &
7482 & nodes%COUPLED_NODES(2,:))
7483 IF(solver2%SOLVER_EQUATIONS%SOLVER_MAPPING% &
7484 & interface_conditions(1)%PTR%INTERFACE% &
7485 & nodes%COUPLED_NODES(2,search_idx)==node_idx)
THEN 7486 solidnodenumber=solver2%SOLVER_EQUATIONS%SOLVER_MAPPING% &
7487 & interface_conditions(1)%PTR%INTERFACE% &
7488 & nodes%COUPLED_NODES(1,search_idx)
7489 solidnodefound=.true.
7492 IF(.NOT.solidnodefound &
7493 & .OR.fluidnodenumber==0)
CALL flagerror(
"Solid interface node not found.", &
7496 IF(variable_idx==1)
THEN 7497 CALL field_parameter_set_get_node(fluid_geometric_field,variable_type, &
7498 & field_values_set_type,1,deriv_idx, &
7499 & fluidnodenumber,component_idx,fluidgfvalue,err,error,*999)
7503 CALL field_parameter_set_get_node(solid_dependent_field,variable_type, &
7504 & field_values_set_type,1,deriv_idx, &
7505 & solidnodenumber,component_idx,soliddfvalue,err,error,*999)
7506 newlaplaceboundaryvalue=soliddfvalue-fluidgfvalue
7507 CALL field_parameter_set_update_local_dof(equations_set%DEPENDENT%DEPENDENT_FIELD, &
7508 & field_u_variable_type,field_values_set_type,local_ny, &
7509 & newlaplaceboundaryvalue,err,error,*999)
7520 CALL flagerror(
"Boundary condition variable is not associated.",err,error,*999)
7523 CALL flagerror(
"Boundary conditions are not associated.",err,error,*999)
7526 CALL flagerror(
"Equations set is not associated.",err,error,*999)
7529 CALL flagerror(
"Equations are not associated.",err,error,*999)
7532 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
7534 CALL field_parameter_set_update_start(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7535 & field_values_set_type,err,error,*999)
7536 CALL field_parameter_set_update_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7537 & field_values_set_type,err,error,*999)
7541 solver_equations=>solver%SOLVER_EQUATIONS
7542 IF(
ASSOCIATED(solver_equations))
THEN 7543 solver_mapping=>solver_equations%SOLVER_MAPPING
7546 alenavierstokesequationssetfound=.false.
7547 DO WHILE (.NOT.alenavierstokesequationssetfound &
7548 & .AND.equationssetindex<=solver_mapping%NUMBER_OF_EQUATIONS_SETS)
7549 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equationssetindex)%EQUATIONS
7550 IF(
ASSOCIATED(equations))
THEN 7551 equations_set=>equations%EQUATIONS_SET
7552 IF(
ASSOCIATED(equations_set))
THEN 7556 alenavierstokesequationssetfound=.true.
7558 equationssetindex=equationssetindex+1
7561 CALL flagerror(
"ALE Navier-Stokes equations set is not associated.",err,error,*999)
7564 CALL flagerror(
"ALE equations not associated.",err,error,*999)
7567 IF(alenavierstokesequationssetfound.EQV..false.)
THEN 7568 local_error=
"ALE NavierStokes equations set not found when trying to update boundary conditions." 7569 CALL flagerror(local_error,err,error,*999)
7572 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
7573 IF(
ASSOCIATED(boundary_conditions))
THEN 7574 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
7575 IF(
ASSOCIATED(field_variable))
THEN 7577 & boundary_conditions_variable,err,error,*999)
7579 CALL flagerror(
"Field U variable is not associated",err,error,*999)
7581 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 7582 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
7583 & number_of_dimensions,err,error,*999)
7584 NULLIFY(mesh_velocity_values)
7585 CALL field_parameter_set_data_get(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
7586 & field_mesh_velocity_set_type,mesh_velocity_values,err,error,*999)
7587 NULLIFY(boundary_values)
7588 CALL field_parameter_set_data_get(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
7589 & field_boundary_set_type,boundary_values,err,error,*999)
7591 IF(control_loop%TIME_LOOP%INPUT_NUMBER==1)
THEN 7594 & solver%SOLVE_TYPE,inletnodes, &
7596 & current_time,control_loop%TIME_LOOP%STOP_TIME)
7597 DO node_idx=1,
SIZE(inletnodes)
7598 CALL field_parameter_set_update_node(equations_set%DEPENDENT%DEPENDENT_FIELD, &
7599 & field_u_variable_type,field_values_set_type,1,1,inletnodes(node_idx),componentbc, &
7600 & boundaryvalues(node_idx),err,error,*999)
7604 IF(control_loop%TIME_LOOP%INPUT_NUMBER==2)
THEN 7611 & solver%SOLVE_TYPE,inletnodes, &
7613 & current_time,control_loop%TIME_LOOP%STOP_TIME)
7614 DO node_idx=1,
SIZE(inletnodes)
7615 CALL field_parameter_set_update_node(equations_set%DEPENDENT%DEPENDENT_FIELD, &
7616 & field_u_variable_type,field_values_set_type,1,1,inletnodes(node_idx),componentbc, &
7617 & boundaryvalues(node_idx),err,error,*999)
7620 CALL field_parameter_set_data_restore(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
7621 & field_u_variable_type,field_mesh_velocity_set_type,mesh_velocity_values,err,error,*999)
7622 CALL field_parameter_set_data_restore(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
7623 & field_u_variable_type,field_boundary_set_type,boundary_values,err,error,*999)
7625 CALL flagerror(
"Boundary condition variable is not associated.",err,error,*999)
7628 CALL flagerror(
"Boundary conditions are not associated.",err,error,*999)
7631 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
7633 CALL field_parameter_set_update_start(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7634 & field_values_set_type,err,error,*999)
7635 CALL field_parameter_set_update_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
7636 & field_values_set_type,err,error,*999)
7640 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
7641 &
" is not valid for a FiniteElasticity-NavierStokes problem type of a multi physics problem class." 7642 CALL flagerror(local_error,err,error,*999)
7645 local_error=
"Problem type "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(2),
"*",err,error))// &
7646 &
" is not valid for NAVIER_STOKES_PRE_SOLVE of a multi physics problem class." 7647 CALL flagerror(local_error,err,error,*999)
7650 local_error=
"The first problem specification of "// &
7652 &
" is not valid for NavierStokes_PreSolveUpdateBoundaryConditions." 7653 CALL flagerror(local_error,err,error,*999)
7656 CALL flagerror(
"Problem is not associated.",err,error,*999)
7659 CALL flagerror(
"Solver is not associated.",err,error,*999)
7662 CALL flagerror(
"Control loop is not associated.",err,error,*999)
7665 exits(
"NavierStokes_PreSolveUpdateBoundaryConditions")
7667 999
errors(
"NavierStokes_PreSolveUpdateBoundaryConditions",err,error)
7668 exits(
"NavierStokes_PreSolveUpdateBoundaryConditions")
7671 END SUBROUTINE navierstokes_presolveupdateboundaryconditions
7678 SUBROUTINE navier_stokes_pre_solve_ale_update_mesh(SOLVER,ERR,ERROR,*)
7682 INTEGER(INTG),
INTENT(OUT) :: ERR
7689 TYPE(
equations_set_type),
POINTER :: EQUATIONS_SET_LAPLACE, EQUATIONS_SET_ALE_NAVIER_STOKES
7691 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD_LAPLACE, INDEPENDENT_FIELD_ALE_NAVIER_STOKES
7693 TYPE(
solver_equations_type),
POINTER :: SOLVER_EQUATIONS_LAPLACE, SOLVER_EQUATIONS_ALE_NAVIER_STOKES
7694 TYPE(
solver_mapping_type),
POINTER :: SOLVER_MAPPING_LAPLACE, SOLVER_MAPPING_ALE_NAVIER_STOKES
7695 TYPE(
solver_type),
POINTER :: SOLVER_ALE_NAVIER_STOKES, SOLVER_LAPLACE
7698 INTEGER(INTG) :: I,NUMBER_OF_DIMENSIONS_LAPLACE,NUMBER_OF_DIMENSIONS_ALE_NAVIER_STOKES
7699 INTEGER(INTG) :: GEOMETRIC_MESH_COMPONENT,INPUT_TYPE,INPUT_OPTION,EquationsSetIndex
7700 INTEGER(INTG) :: component_idx,deriv_idx,local_ny,node_idx,variable_idx,variable_type
7701 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT,ALPHA
7702 REAL(DP),
POINTER :: MESH_DISPLACEMENT_VALUES(:)
7703 LOGICAL :: ALENavierStokesEquationsSetFound=.false.
7705 enters(
"NAVIER_STOKES_PRE_SOLVE_ALE_UPDATE_MESH",err,error,*999)
7707 IF(
ASSOCIATED(solver))
THEN 7708 solvers=>solver%SOLVERS
7709 IF(
ASSOCIATED(solvers))
THEN 7710 control_loop=>solvers%CONTROL_LOOP
7712 NULLIFY(solver_laplace)
7713 NULLIFY(solver_ale_navier_stokes)
7714 NULLIFY(independent_field_ale_navier_stokes)
7715 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 7716 IF(.NOT.
ALLOCATED(control_loop%problem%specification))
THEN 7717 CALL flagerror(
"Problem specification array is not allocated.",err,error,*999)
7718 ELSE IF(
SIZE(control_loop%problem%specification,1)<3)
THEN 7719 CALL flagerror(
"Problem specification must have three entries for a Navier-Stokes problem.",err,error,*999)
7721 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(1))
7723 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
7738 solver_equations_ale_navier_stokes=>solver_ale_navier_stokes%SOLVER_EQUATIONS
7739 IF(
ASSOCIATED(solver_equations_ale_navier_stokes))
THEN 7740 solver_mapping_ale_navier_stokes=>solver_equations_ale_navier_stokes%SOLVER_MAPPING
7741 IF(
ASSOCIATED(solver_mapping_ale_navier_stokes))
THEN 7742 equations_set_ale_navier_stokes=>solver_mapping_ale_navier_stokes%EQUATIONS_SETS(1)%PTR
7743 IF(
ASSOCIATED(equations_set_ale_navier_stokes))
THEN 7744 independent_field_ale_navier_stokes=>equations_set_ale_navier_stokes%INDEPENDENT%INDEPENDENT_FIELD
7746 CALL flagerror(
"ALE Navier-Stokes equations set is not associated.",err,error,*999)
7749 CALL field_number_of_components_get(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
7750 & field_u_variable_type,number_of_dimensions_ale_navier_stokes,err,error,*999)
7755 NULLIFY(mesh_displacement_values)
7756 CALL field_parameter_set_data_get(equations_set_ale_navier_stokes%INDEPENDENT%INDEPENDENT_FIELD, &
7757 & field_u_variable_type,field_mesh_displacement_set_type,mesh_displacement_values,err,error,*999)
7759 & number_of_dimensions_ale_navier_stokes,input_type,input_option, &
7760 & control_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
7761 CALL field_parameter_set_update_start(equations_set_ale_navier_stokes%INDEPENDENT%INDEPENDENT_FIELD, &
7762 & field_u_variable_type,field_mesh_displacement_set_type,err,error,*999)
7763 CALL field_parameter_set_update_finish(equations_set_ale_navier_stokes%INDEPENDENT%INDEPENDENT_FIELD, &
7764 & field_u_variable_type,field_mesh_displacement_set_type,err,error,*999)
7766 CALL flagerror(
"ALE Navier-Stokes solver mapping is not associated.",err,error,*999)
7769 CALL flagerror(
"ALE Navier-Stokes solver equations are not associated.",err,error,*999)
7772 CALL field_component_mesh_component_get(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
7773 & field_u_variable_type,1,geometric_mesh_component,err,error,*999)
7776 equations=>solver_mapping_ale_navier_stokes%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
7777 IF(
ASSOCIATED(equations))
THEN 7778 equations_mapping=>equations%EQUATIONS_MAPPING
7779 IF(
ASSOCIATED(equations_mapping))
THEN 7780 DO variable_idx=1,equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD%NUMBER_OF_VARIABLES
7781 variable_type=equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD%VARIABLES(variable_idx)%VARIABLE_TYPE
7782 field_variable=>equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD%VARIABLE_TYPE_MAP(variable_type)%PTR
7783 IF(
ASSOCIATED(field_variable))
THEN 7784 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
7785 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
7786 IF(
ASSOCIATED(domain))
THEN 7787 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 7788 domain_nodes=>domain%TOPOLOGY%NODES
7789 IF(
ASSOCIATED(domain_nodes))
THEN 7791 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
7792 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
7794 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
7795 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
7796 CALL field_parameter_set_add_local_dof(equations_set_ale_navier_stokes%GEOMETRY% &
7797 & geometric_field,field_u_variable_type,field_values_set_type,local_ny, &
7798 & mesh_displacement_values(local_ny),err,error,*999)
7808 CALL flagerror(
"Equations mapping is not associated.",err,error,*999)
7811 CALL flagerror(
"Equations are not associated.",err,error,*999)
7813 CALL field_parameter_set_update_start(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
7814 & field_u_variable_type,field_values_set_type,err,error,*999)
7815 CALL field_parameter_set_update_finish(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
7816 & field_u_variable_type,field_values_set_type,err,error,*999)
7818 time_increment=control_loop%TIME_LOOP%TIME_INCREMENT
7819 alpha=1.0_dp/time_increment
7820 CALL field_parameter_sets_copy(independent_field_ale_navier_stokes,field_u_variable_type, &
7821 & field_mesh_displacement_set_type,field_mesh_velocity_set_type,alpha,err,error,*999)
7823 CALL flagerror(
"Mesh motion calculation not successful for ALE problem.",err,error,*999)
7828 IF(solver%DYNAMIC_SOLVER%ALE)
THEN 7831 solver_equations_laplace=>solver_laplace%SOLVER_EQUATIONS
7832 IF(
ASSOCIATED(solver_equations_laplace))
THEN 7833 solver_mapping_laplace=>solver_equations_laplace%SOLVER_MAPPING
7834 IF(
ASSOCIATED(solver_mapping_laplace))
THEN 7835 equations_set_laplace=>solver_mapping_laplace%EQUATIONS_SETS(1)%PTR
7836 IF(
ASSOCIATED(equations_set_laplace))
THEN 7837 dependent_field_laplace=>equations_set_laplace%DEPENDENT%DEPENDENT_FIELD
7839 CALL flagerror(
"Laplace equations set is not associated.",err,error,*999)
7841 CALL field_number_of_components_get(equations_set_laplace%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
7842 & number_of_dimensions_laplace,err,error,*999)
7844 CALL flagerror(
"Laplace solver mapping is not associated.",err,error,*999)
7847 CALL flagerror(
"Laplace solver equations are not associated.",err,error,*999)
7851 solver_equations_ale_navier_stokes=>solver_ale_navier_stokes%SOLVER_EQUATIONS
7852 IF(
ASSOCIATED(solver_equations_ale_navier_stokes))
THEN 7853 solver_mapping_ale_navier_stokes=>solver_equations_ale_navier_stokes%SOLVER_MAPPING
7854 IF(
ASSOCIATED(solver_mapping_ale_navier_stokes))
THEN 7855 equations_set_ale_navier_stokes=>solver_mapping_ale_navier_stokes%EQUATIONS_SETS(1)%PTR
7856 IF(
ASSOCIATED(equations_set_ale_navier_stokes))
THEN 7857 independent_field_ale_navier_stokes=>equations_set_ale_navier_stokes%INDEPENDENT%INDEPENDENT_FIELD
7859 CALL flagerror(
"ALE Navier-Stokes equations set is not associated.",err,error,*999)
7861 CALL field_number_of_components_get(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
7862 & field_u_variable_type,number_of_dimensions_ale_navier_stokes,err,error,*999)
7864 CALL flagerror(
"ALE Navier-Stokes solver mapping is not associated.",err,error,*999)
7867 CALL flagerror(
"ALE Navier-Stokes solver equations are not associated.",err,error,*999)
7870 IF(number_of_dimensions_ale_navier_stokes==number_of_dimensions_laplace)
THEN 7871 DO i=1,number_of_dimensions_ale_navier_stokes
7872 CALL field_parameterstofieldparameterscopy(dependent_field_laplace, &
7873 & field_u_variable_type,field_values_set_type,i,independent_field_ale_navier_stokes, &
7874 & field_u_variable_type,field_mesh_displacement_set_type,i,err,error,*999)
7877 CALL flagerror(
"Dimension of Laplace and ALE Navier-Stokes equations set is not consistent.",err,error,*999)
7880 CALL field_component_mesh_component_get(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
7881 & field_u_variable_type,1,geometric_mesh_component,err,error,*999)
7882 NULLIFY(mesh_displacement_values)
7883 CALL field_parameter_set_data_get(independent_field_ale_navier_stokes,field_u_variable_type, &
7884 & field_mesh_displacement_set_type,mesh_displacement_values,err,error,*999)
7885 equations=>solver_mapping_laplace%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
7886 IF(
ASSOCIATED(equations))
THEN 7887 equations_mapping=>equations%EQUATIONS_MAPPING
7888 IF(
ASSOCIATED(equations_mapping))
THEN 7889 DO variable_idx=1,equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD%NUMBER_OF_VARIABLES
7890 variable_type=equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD%VARIABLES(variable_idx)%VARIABLE_TYPE
7891 field_variable=>equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD% &
7892 & variable_type_map(variable_type)%PTR
7893 IF(
ASSOCIATED(field_variable))
THEN 7894 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
7895 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
7896 IF(
ASSOCIATED(domain))
THEN 7897 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 7898 domain_nodes=>domain%TOPOLOGY%NODES
7899 IF(
ASSOCIATED(domain_nodes))
THEN 7901 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
7902 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
7904 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
7905 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
7906 CALL field_parameter_set_add_local_dof(equations_set_ale_navier_stokes%GEOMETRY% &
7907 & geometric_field,field_u_variable_type,field_values_set_type,local_ny, &
7908 & mesh_displacement_values(local_ny),err,error,*999)
7918 CALL flagerror(
"Equations mapping is not associated.",err,error,*999)
7920 CALL field_parameter_set_data_restore(independent_field_ale_navier_stokes,field_u_variable_type, &
7921 & field_mesh_displacement_set_type,mesh_displacement_values,err,error,*999)
7923 CALL flagerror(
"Equations are not associated.",err,error,*999)
7925 CALL field_parameter_set_update_start(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
7926 & field_u_variable_type,field_values_set_type,err,error,*999)
7927 CALL field_parameter_set_update_finish(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
7928 & field_u_variable_type,field_values_set_type,err,error,*999)
7930 time_increment=control_loop%TIME_LOOP%TIME_INCREMENT
7931 alpha=1.0_dp/time_increment
7932 CALL field_parameter_sets_copy(independent_field_ale_navier_stokes,field_u_variable_type, &
7933 & field_mesh_displacement_set_type,field_mesh_velocity_set_type,alpha,err,error,*999)
7935 CALL flagerror(
"Mesh motion calculation not successful for ALE problem.",err,error,*999)
7938 CALL flagerror(
"Mesh update is not defined for non-dynamic problems.",err,error,*999)
7941 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
7942 &
" is not valid for a Navier-Stokes equation fluid type of a fluid mechanics problem class." 7943 CALL flagerror(local_error,err,error,*999)
7946 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(2))
7948 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
7952 IF(solver%DYNAMIC_SOLVER%ALE)
THEN 7956 solver_equations_laplace=>solver_laplace%SOLVER_EQUATIONS
7957 IF(
ASSOCIATED(solver_equations_laplace))
THEN 7958 solver_mapping_laplace=>solver_equations_laplace%SOLVER_MAPPING
7959 IF(
ASSOCIATED(solver_mapping_laplace))
THEN 7960 equations_set_laplace=>solver_mapping_laplace%EQUATIONS_SETS(1)%PTR
7961 IF(
ASSOCIATED(equations_set_laplace))
THEN 7962 dependent_field_laplace=>equations_set_laplace%DEPENDENT%DEPENDENT_FIELD
7964 CALL flagerror(
"Laplace equations set is not associated.",err,error,*999)
7966 CALL field_number_of_components_get(equations_set_laplace%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
7967 & number_of_dimensions_laplace,err,error,*999)
7969 CALL flagerror(
"Laplace solver mapping is not associated.",err,error,*999)
7972 CALL flagerror(
"Laplace solver equations are not associated.",err,error,*999)
7977 solver_equations_ale_navier_stokes=>solver_ale_navier_stokes%SOLVER_EQUATIONS
7978 IF(
ASSOCIATED(solver_equations_ale_navier_stokes))
THEN 7979 solver_mapping_ale_navier_stokes=>solver_equations_ale_navier_stokes%SOLVER_MAPPING
7980 IF(
ASSOCIATED(solver_mapping_ale_navier_stokes))
THEN 7982 alenavierstokesequationssetfound=.false.
7984 DO WHILE (.NOT.alenavierstokesequationssetfound &
7985 & .AND.equationssetindex<=solver_mapping_ale_navier_stokes%NUMBER_OF_EQUATIONS_SETS)
7986 equations_set_ale_navier_stokes=>solver_mapping_ale_navier_stokes%EQUATIONS_SETS(equationssetindex)%PTR
7987 IF(
ASSOCIATED(equations_set_ale_navier_stokes))
THEN 7991 independent_field_ale_navier_stokes=>equations_set_ale_navier_stokes%INDEPENDENT%INDEPENDENT_FIELD
7992 IF(
ASSOCIATED(independent_field_ale_navier_stokes)) alenavierstokesequationssetfound=.true.
7994 equationssetindex=equationssetindex+1
7997 CALL flagerror(
"ALE Navier-Stokes equations set is not associated.",err,error,*999)
8000 IF(alenavierstokesequationssetfound.EQV..false.)
THEN 8001 CALL flagerror(
"ALE NavierStokes equations set not found when trying to update ALE mesh.",err,error,*999)
8003 CALL field_number_of_components_get(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
8004 & field_u_variable_type,number_of_dimensions_ale_navier_stokes,err,error,*999)
8006 CALL flagerror(
"ALE Navier-Stokes solver mapping is not associated.",err,error,*999)
8009 CALL flagerror(
"ALE Navier-Stokes solver equations are not associated.",err,error,*999)
8012 IF(number_of_dimensions_ale_navier_stokes==number_of_dimensions_laplace)
THEN 8013 DO i=1,number_of_dimensions_ale_navier_stokes
8014 CALL field_parameterstofieldparameterscopy(dependent_field_laplace, &
8015 & field_u_variable_type,field_values_set_type,i,independent_field_ale_navier_stokes, &
8016 & field_u_variable_type,field_mesh_displacement_set_type,i,err,error,*999)
8019 CALL flagerror(
"Dimension of Laplace and ALE Navier-Stokes equations set is not consistent.",err,error,*999)
8022 CALL field_component_mesh_component_get(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
8023 & field_u_variable_type,1,geometric_mesh_component,err,error,*999)
8024 NULLIFY(mesh_displacement_values)
8025 CALL field_parameter_set_data_get(independent_field_ale_navier_stokes,field_u_variable_type, &
8026 & field_mesh_displacement_set_type,mesh_displacement_values,err,error,*999)
8027 equations=>solver_mapping_laplace%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
8028 IF(
ASSOCIATED(equations))
THEN 8029 equations_mapping=>equations%EQUATIONS_MAPPING
8030 IF(
ASSOCIATED(equations_mapping))
THEN 8031 DO variable_idx=1,equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD%NUMBER_OF_VARIABLES
8032 variable_type=equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD%VARIABLES(variable_idx)% &
8034 field_variable=>equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD% &
8035 & variable_type_map(variable_type)%PTR
8036 IF(
ASSOCIATED(field_variable))
THEN 8037 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
8038 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
8039 IF(
ASSOCIATED(domain))
THEN 8040 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 8041 domain_nodes=>domain%TOPOLOGY%NODES
8042 IF(
ASSOCIATED(domain_nodes))
THEN 8044 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
8045 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
8047 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
8048 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
8049 CALL field_parameter_set_add_local_dof(equations_set_ale_navier_stokes%GEOMETRY% &
8050 & geometric_field,field_u_variable_type,field_values_set_type,local_ny, &
8051 & mesh_displacement_values(local_ny),err,error,*999)
8061 CALL flagerror(
"Equations mapping is not associated.",err,error,*999)
8063 CALL field_parameter_set_data_restore(independent_field_ale_navier_stokes,field_u_variable_type, &
8064 & field_mesh_displacement_set_type,mesh_displacement_values,err,error,*999)
8066 CALL flagerror(
"Equations are not associated.",err,error,*999)
8068 CALL field_parameter_set_update_start(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
8069 & field_u_variable_type,field_values_set_type,err,error,*999)
8070 CALL field_parameter_set_update_finish(equations_set_ale_navier_stokes%GEOMETRY%GEOMETRIC_FIELD, &
8071 & field_u_variable_type,field_values_set_type,err,error,*999)
8073 time_increment=control_loop%TIME_LOOP%TIME_INCREMENT
8074 alpha=1.0_dp/time_increment
8075 CALL field_parameter_sets_copy(independent_field_ale_navier_stokes,field_u_variable_type, &
8076 & field_mesh_displacement_set_type,field_mesh_velocity_set_type,alpha,err,error,*999)
8078 CALL flagerror(
"Mesh motion calculation not successful for ALE problem.",err,error,*999)
8081 CALL flagerror(
"Mesh update is not defined for non-dynamic problems.",err,error,*999)
8084 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
8085 &
" is not valid for a FiniteElasticity-NavierStokes type of a multi physics problem class." 8088 local_error=
"Problem type "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(2),
"*",err,error))// &
8089 &
" is not valid for NAVIER_STOKES_PRE_SOLVE_ALE_UPDATE_MESH of a multi physics problem class." 8092 local_error=
"Problem class "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(1),
"*",err,error))// &
8093 &
" is not valid for NAVIER_STOKES_PRE_SOLVE_ALE_UPDATE_MESH." 8094 CALL flagerror(local_error,err,error,*999)
8097 CALL flagerror(
"Problem is not associated.",err,error,*999)
8100 CALL flagerror(
"Solver is not associated.",err,error,*999)
8103 CALL flagerror(
"Control loop is not associated.",err,error,*999)
8106 exits(
"NAVIER_STOKES_PRE_SOLVE_ALE_UPDATE_MESH")
8108 999 errorsexits(
"NAVIER_STOKES_PRE_SOLVE_ALE_UPDATE_MESH",err,error)
8111 END SUBROUTINE navier_stokes_pre_solve_ale_update_mesh
8117 SUBROUTINE navierstokes_presolvealeupdateparameters(SOLVER,ERR,ERROR,*)
8121 INTEGER(INTG),
INTENT(OUT) :: ERR
8127 TYPE(
field_type),
POINTER :: INDEPENDENT_FIELD
8135 INTEGER(INTG) :: component_idx,deriv_idx,local_ny,node_idx,variable_idx,variable_type
8136 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT
8137 REAL(DP),
POINTER :: MESH_STIFF_VALUES(:)
8139 enters(
"NavierStokes_PreSolveALEUpdateParameters",err,error,*999)
8141 IF(
ASSOCIATED(solver))
THEN 8142 solvers=>solver%SOLVERS
8143 IF(
ASSOCIATED(solvers))
THEN 8144 control_loop=>solvers%CONTROL_LOOP
8146 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 8147 IF(.NOT.
ALLOCATED(control_loop%problem%specification))
THEN 8148 CALL flagerror(
"Problem specification array is not allocated.",err,error,*999)
8149 ELSE IF(
SIZE(control_loop%problem%specification,1)<3)
THEN 8150 CALL flagerror(
"Problem specification must have three entries for a Navier-Stokes problem.",err,error,*999)
8152 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(1))
8154 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
8167 solver_equations=>solver%SOLVER_EQUATIONS
8168 IF(
ASSOCIATED(solver_equations))
THEN 8169 solver_mapping=>solver_equations%SOLVER_MAPPING
8170 IF(
ASSOCIATED(solver_mapping))
THEN 8171 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
8172 NULLIFY(mesh_stiff_values)
8173 CALL field_parameter_set_data_get(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
8174 & field_values_set_type,mesh_stiff_values,err,error,*999)
8175 IF(
ASSOCIATED(equations_set))
THEN 8176 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
8177 IF(
ASSOCIATED(equations))
THEN 8178 independent_field=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
8179 IF(
ASSOCIATED(independent_field))
THEN 8180 DO variable_idx=1,equations_set%DEPENDENT%DEPENDENT_FIELD%NUMBER_OF_VARIABLES
8181 variable_type=equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLES(variable_idx)%VARIABLE_TYPE
8182 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(variable_type)%PTR
8183 IF(
ASSOCIATED(field_variable))
THEN 8184 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
8185 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
8186 IF(
ASSOCIATED(domain))
THEN 8187 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 8188 domain_nodes=>domain%TOPOLOGY%NODES
8189 IF(
ASSOCIATED(domain_nodes))
THEN 8191 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
8192 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
8194 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
8195 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
8197 mesh_stiff_values(local_ny)=1.0_dp
8198 CALL field_parameter_set_update_local_dof(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
8199 & field_u_variable_type,field_values_set_type,local_ny, &
8200 & mesh_stiff_values(local_ny),err,error,*999)
8210 CALL flagerror(
"Independent field is not associated.",err,error,*999)
8213 CALL flagerror(
"Equations are not associated.",err,error,*999)
8216 CALL flagerror(
"Equations set is not associated.",err,error,*999)
8218 CALL field_parameter_set_data_restore(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
8219 & field_values_set_type,mesh_stiff_values,err,error,*999)
8221 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
8224 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
8227 CALL flagerror(
"Mesh motion calculation not successful for ALE problem.",err,error,*999)
8230 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
8231 &
" is not valid for a Navier-Stokes equation fluid type of a fluid mechanics problem class." 8232 CALL flagerror(local_error,err,error,*999)
8235 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(2))
8237 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
8241 solver_equations=>solver%SOLVER_EQUATIONS
8242 IF(
ASSOCIATED(solver_equations))
THEN 8243 solver_mapping=>solver_equations%SOLVER_MAPPING
8244 IF(
ASSOCIATED(solver_mapping))
THEN 8245 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
8246 NULLIFY(mesh_stiff_values)
8247 CALL field_parameter_set_data_get(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
8248 & field_values_set_type,mesh_stiff_values,err,error,*999)
8249 IF(
ASSOCIATED(equations_set))
THEN 8250 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
8251 IF(
ASSOCIATED(equations))
THEN 8252 independent_field=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
8253 IF(
ASSOCIATED(independent_field))
THEN 8254 DO variable_idx=1,equations_set%DEPENDENT%DEPENDENT_FIELD%NUMBER_OF_VARIABLES
8255 variable_type=equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLES(variable_idx)%VARIABLE_TYPE
8256 field_variable=>equations_set%DEPENDENT%DEPENDENT_FIELD%VARIABLE_TYPE_MAP(variable_type)%PTR
8257 IF(
ASSOCIATED(field_variable))
THEN 8258 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
8259 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
8260 IF(
ASSOCIATED(domain))
THEN 8261 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 8262 domain_nodes=>domain%TOPOLOGY%NODES
8263 IF(
ASSOCIATED(domain_nodes))
THEN 8265 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
8266 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
8268 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
8269 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
8271 mesh_stiff_values(local_ny)=1.0_dp
8272 CALL field_parameter_set_update_local_dof(equations_set%INDEPENDENT% &
8273 & independent_field,field_u_variable_type,field_values_set_type,local_ny, &
8274 & mesh_stiff_values(local_ny),err,error,*999)
8284 CALL flagerror(
"Independent field is not associated.",err,error,*999)
8287 CALL flagerror(
"Equations are not associated.",err,error,*999)
8290 CALL flagerror(
"Equations set is not associated.",err,error,*999)
8292 CALL field_parameter_set_data_restore(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
8293 & field_values_set_type,mesh_stiff_values,err,error,*999)
8295 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
8298 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
8301 CALL flagerror(
"Mesh motion calculation not successful for ALE problem.",err,error,*999)
8304 local_error=
"The third problem specification of "// &
8306 &
" is not valid for a FiniteElasticity-NavierStokes type of a multi physics problem." 8307 CALL flagerror(local_error,err,error,*999)
8310 local_error=
"The second problem specification of "// &
8312 &
" is not valid for NavierStokes_PreSolveALEUpdateParameters of a multi physics problem." 8313 CALL flagerror(local_error,err,error,*999)
8316 local_error=
"The first problem specification of "// &
8318 &
" is not valid for NavierStokes_PreSolveALEUpdateParameters." 8319 CALL flagerror(local_error,err,error,*999)
8322 CALL flagerror(
"Problem is not associated.",err,error,*999)
8325 CALL flagerror(
"Solver is not associated.",err,error,*999)
8328 CALL flagerror(
"Control loop is not associated.",err,error,*999)
8331 exits(
"NavierStokes_PreSolveALEUpdateParameters")
8333 999 errorsexits(
"NavierStokes_PreSolveALEUpdateParameters",err,error)
8336 END SUBROUTINE navierstokes_presolvealeupdateparameters
8343 SUBROUTINE navier_stokes_post_solve_output_data(SOLVER,ERR,ERROR,*)
8347 INTEGER(INTG),
INTENT(OUT) :: ERR
8358 INTEGER(INTG) :: EQUATIONS_SET_IDX,CURRENT_LOOP_ITERATION,OUTPUT_ITERATION_NUMBER
8359 INTEGER(INTG) :: NUMBER_OF_DIMENSIONS,FileNameLength
8360 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT,START_TIME,STOP_TIME
8361 LOGICAL :: EXPORT_FIELD
8362 CHARACTER(14) :: FILE,OUTPUT_FILE
8366 enters(
"NAVIER_STOKES_POST_SOLVE_OUTPUT_DATA",err,error,*999)
8368 IF(
ASSOCIATED(solver))
THEN 8369 solvers=>solver%SOLVERS
8370 IF(
ASSOCIATED(solvers))
THEN 8371 control_loop=>solvers%CONTROL_LOOP
8372 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 8373 IF(.NOT.
ALLOCATED(control_loop%problem%specification))
THEN 8374 CALL flagerror(
"Problem specification array is not allocated.",err,error,*999)
8375 ELSE IF(
SIZE(control_loop%problem%specification,1)<3)
THEN 8376 CALL flagerror(
"Problem specification must have three entries for a Navier-Stokes problem.",err,error,*999)
8378 SELECT CASE(control_loop%PROBLEM%specification(3))
8381 solver_equations=>solver%SOLVER_EQUATIONS
8382 IF(
ASSOCIATED(solver_equations))
THEN 8383 solver_mapping=>solver_equations%SOLVER_MAPPING
8384 IF(
ASSOCIATED(solver_mapping))
THEN 8386 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
8387 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
8390 IF(export_field)
THEN 8391 output_file =
"StaticSolution" 8392 filenamelength =
len_trim(output_file)
8393 vfilename = output_file(1:filenamelength)
8395 fields=>equations_set%REGION%FIELDS
8415 solver_equations=>solver%SOLVER_EQUATIONS
8416 IF(
ASSOCIATED(solver_equations))
THEN 8417 solver_mapping=>solver_equations%SOLVER_MAPPING
8418 IF(
ASSOCIATED(solver_mapping))
THEN 8420 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
8421 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
8422 current_loop_iteration=control_loop%TIME_LOOP%ITERATION_NUMBER
8423 output_iteration_number=control_loop%TIME_LOOP%OUTPUT_NUMBER
8424 IF(output_iteration_number/=0)
THEN 8425 IF(control_loop%TIME_LOOP%CURRENT_TIME<=control_loop%TIME_LOOP%STOP_TIME)
THEN 8426 WRITE(output_file,
'("TimeStep_",I0)') current_loop_iteration
8430 IF(mod(current_loop_iteration,output_iteration_number)==0)
THEN 8432 filenamelength =
len_trim(output_file)
8433 vfilename = output_file(1:filenamelength)
8435 fields=>equations_set%REGION%FIELDS
8439 IF(current_loop_iteration==0)
THEN 8469 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 8493 & current_loop_iteration,output_iteration_number,err,error,*999)
8494 solver_equations=>solver%SOLVER_EQUATIONS
8495 IF(
ASSOCIATED(solver_equations))
THEN 8496 solver_mapping=>solver_equations%SOLVER_MAPPING
8497 IF(
ASSOCIATED(solver_mapping))
THEN 8499 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
8500 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
8501 IF(output_iteration_number/=0)
THEN 8502 IF(current_time<=stop_time)
THEN 8503 IF(current_loop_iteration<10)
THEN 8504 WRITE(output_file,
'("TIME_STEP_000",I0)') current_loop_iteration
8505 ELSE IF(current_loop_iteration<100)
THEN 8506 WRITE(output_file,
'("TIME_STEP_00",I0)') current_loop_iteration
8507 ELSE IF(current_loop_iteration<1000)
THEN 8508 WRITE(output_file,
'("TIME_STEP_0",I0)') current_loop_iteration
8509 ELSE IF(current_loop_iteration<10000)
THEN 8510 WRITE(output_file,
'("TIME_STEP_",I0)') current_loop_iteration
8512 dependent_region=>equations_set%REGION
8517 IF(export_field)
THEN 8518 IF(mod(current_loop_iteration,output_iteration_number)==0)
THEN 8525 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
8526 & number_of_dimensions,err,error,*999)
8527 IF(number_of_dimensions==3)
THEN 8528 export_field=.false.
8529 IF(export_field)
THEN 8538 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 8554 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
8555 &
" is not valid for a Navier-Stokes equation fluid type of a fluid mechanics problem class." 8556 CALL flagerror(local_error,err,error,*999)
8559 CALL flagerror(
"Control loop is not associated.",err,error,*999)
8562 CALL flagerror(
"Solvers is not associated.",err,error,*999)
8565 CALL flagerror(
"Solver is not associated.",err,error,*999)
8568 exits(
"NAVIER_STOKES_POST_SOLVE_OUTPUT_DATA")
8570 999 errorsexits(
"NAVIER_STOKES_POST_SOLVE_OUTPUT_DATA",err,error)
8573 END SUBROUTINE navier_stokes_post_solve_output_data
8580 SUBROUTINE navierstokes_boundaryconditionsanalyticcalculate(equationsSet,boundaryConditions,err,error,*)
8585 INTEGER(INTG),
INTENT(OUT) :: err
8593 TYPE(
field_type),
POINTER :: analyticField,dependentField,geometricField,materialsField
8594 TYPE(
field_variable_type),
POINTER :: fieldVariable,geometricVariable,analyticVariable,materialsVariable
8596 INTEGER(INTG) :: componentIdx,derivativeIdx,dimensionIdx,local_ny,nodeIdx,numberOfDimensions,variableIdx,variableType,I,J,K
8597 INTEGER(INTG) :: numberOfNodesXiCoord(3),elementIdx,en_idx,boundaryCount,analyticFunctionType,globalDerivativeIndex,versionIdx
8598 INTEGER(INTG) :: boundaryConditionsCheckVariable,numberOfXi,nodeNumber,userNodeNumber,localDof,globalDof
8599 INTEGER(INTG) :: parameterIdx,numberOfParameters
8600 REAL(DP) :: TIME,
VALUE,X(3),xiCoordinates(3),initialValue,T_COORDINATES(20,3),nodeAnalyticParameters(10)
8601 REAL(DP),
POINTER :: analyticParameters(:),geometricParameters(:),materialsParameters(:)
8603 enters(
"NavierStokes_BoundaryConditionsAnalyticCalculate",err,error,*999)
8606 xicoordinates(3)=0.0_dp
8608 IF(
ASSOCIATED(equationsset))
THEN 8609 IF(
ASSOCIATED(equationsset%ANALYTIC))
THEN 8610 dependentfield=>equationsset%DEPENDENT%DEPENDENT_FIELD
8611 IF(
ASSOCIATED(dependentfield))
THEN 8612 geometricfield=>equationsset%GEOMETRY%GEOMETRIC_FIELD
8613 IF(
ASSOCIATED(geometricfield))
THEN 8615 CALL field_number_of_components_get(geometricfield,field_u_variable_type,numberofdimensions,err,error,*999)
8616 NULLIFY(geometricvariable)
8617 CALL field_variable_get(geometricfield,field_u_variable_type,geometricvariable,err,error,*999)
8618 NULLIFY(geometricparameters)
8619 CALL field_parameter_set_data_get(geometricfield,field_u_variable_type,field_values_set_type,geometricparameters, &
8622 analyticfunctiontype=equationsset%ANALYTIC%ANALYTIC_FUNCTION_TYPE
8623 analyticfield=>equationsset%ANALYTIC%ANALYTIC_FIELD
8624 NULLIFY(analyticvariable)
8625 NULLIFY(analyticparameters)
8626 IF(
ASSOCIATED(analyticfield))
THEN 8627 CALL field_variable_get(analyticfield,field_u_variable_type,analyticvariable,err,error,*999)
8628 CALL field_parameter_set_data_get(analyticfield,field_u_variable_type,field_values_set_type, &
8629 & analyticparameters,err,error,*999)
8632 NULLIFY(materialsfield)
8633 NULLIFY(materialsvariable)
8634 NULLIFY(materialsparameters)
8635 IF(
ASSOCIATED(equationsset%MATERIALS))
THEN 8636 materialsfield=>equationsset%MATERIALS%MATERIALS_FIELD
8637 CALL field_variable_get(materialsfield,field_u_variable_type,materialsvariable,err,error,*999)
8638 CALL field_parameter_set_data_get(materialsfield,field_u_variable_type,field_values_set_type, &
8639 & materialsparameters,err,error,*999)
8641 time=equationsset%ANALYTIC%ANALYTIC_TIME
8643 NULLIFY(interpolationparameters)
8644 CALL field_interpolation_parameters_initialise(geometricfield,interpolationparameters,err,error,*999)
8645 NULLIFY(interpolatedpoint)
8646 CALL field_interpolated_points_initialise(interpolationparameters,interpolatedpoint,err,error,*999)
8647 CALL field_number_of_components_get(geometricfield,field_u_variable_type,numberofdimensions,err,error,*999)
8649 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
8652 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
8655 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
8658 CALL flagerror(
"Equations set is not associated.",err,error,*999)
8661 IF(
ASSOCIATED(boundaryconditions))
THEN 8662 DO variableidx=1,dependentfield%NUMBER_OF_VARIABLES
8663 variabletype=dependentfield%VARIABLES(variableidx)%VARIABLE_TYPE
8664 fieldvariable=>dependentfield%VARIABLE_TYPE_MAP(variabletype)%PTR
8665 IF(
ASSOCIATED(fieldvariable))
THEN 8666 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_analytic_values_set_type)%PTR)) &
8667 &
CALL field_parameter_set_create(dependentfield,variabletype,field_analytic_values_set_type,err,error,*999)
8668 DO componentidx=1,fieldvariable%NUMBER_OF_COMPONENTS
8670 IF(fieldvariable%COMPONENTS(componentidx)%INTERPOLATION_TYPE==field_node_based_interpolation)
THEN 8671 domain=>fieldvariable%COMPONENTS(componentidx)%DOMAIN
8672 IF(
ASSOCIATED(domain))
THEN 8673 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 8674 domainnodes=>domain%TOPOLOGY%NODES
8675 IF(
ASSOCIATED(domainnodes))
THEN 8677 DO nodeidx=1,domainnodes%NUMBER_OF_NODES
8678 nodenumber = domainnodes%NODES(nodeidx)%local_number
8679 usernodenumber = domainnodes%NODES(nodeidx)%user_number
8680 elementidx=domain%topology%nodes%nodes(nodenumber)%surrounding_elements(1)
8681 CALL field_interpolation_parameters_element_get(field_values_set_type,elementidx, &
8682 & interpolationparameters(field_u_variable_type)%PTR,err,error,*999)
8684 xicoordinates=0.0_dp
8685 numberofxi=domain%topology%elements%elements(elementidx)%basis%number_of_xi
8686 numberofnodesxicoord(1)=domain%topology%elements%elements(elementidx)%basis%number_of_nodes_xic(1)
8687 IF(numberofxi>1)
THEN 8688 numberofnodesxicoord(2)=domain%topology%elements%elements(elementidx)%basis%number_of_nodes_xic(2)
8690 numberofnodesxicoord(2)=1
8692 IF(numberofxi>2)
THEN 8693 numberofnodesxicoord(3)=domain%topology%elements%elements(elementidx)%basis%number_of_nodes_xic(3)
8695 numberofnodesxicoord(3)=1
8698 SELECT CASE(analyticfunctiontype)
8701 IF(variableidx < 3)
THEN 8703 DO dimensionidx=1,numberofdimensions
8704 local_ny=geometricvariable%COMPONENTS(dimensionidx)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
8705 & nodes(nodeidx)%DERIVATIVES(1)%VERSIONS(1)
8706 x(dimensionidx)=geometricparameters(local_ny)
8708 DO derivativeidx=1,domainnodes%NODES(nodenumber)%NUMBER_OF_DERIVATIVES
8709 globalderivativeindex=domainnodes%NODES(nodenumber)%DERIVATIVES(derivativeidx)% &
8710 & global_derivative_index
8711 DO versionidx=1,domainnodes%NODES(nodenumber)%DERIVATIVES(derivativeidx)%numberOfVersions
8712 CALL navier_stokes_analytic_functions_evaluate(analyticfunctiontype,x,time,variabletype, &
8713 & globalderivativeindex,componentidx,numberofdimensions,fieldvariable%NUMBER_OF_COMPONENTS, &
8714 & analyticparameters,materialsparameters,
VALUE,err,error,*999)
8715 local_ny=fieldvariable%COMPONENTS(componentidx)%PARAM_TO_DOF_MAP% &
8716 & node_param2dof_map%NODES(nodeidx)%DERIVATIVES(derivativeidx)%VERSIONS(versionidx)
8717 CALL field_parameter_set_update_local_dof(dependentfield,variabletype, &
8718 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
8727 DO dimensionidx=1,numberofdimensions
8728 local_ny=geometricvariable%COMPONENTS(dimensionidx)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
8729 & nodes(nodenumber)%DERIVATIVES(1)%VERSIONS(1)
8730 x(dimensionidx)=geometricparameters(local_ny)
8733 DO derivativeidx=1,domainnodes%NODES(nodenumber)%NUMBER_OF_DERIVATIVES
8734 globalderivativeindex=domainnodes%NODES(nodenumber)%DERIVATIVES(derivativeidx)% &
8735 & global_derivative_index
8736 IF(componentidx<=numberofxi .OR. &
8738 DO versionidx=1,domainnodes%NODES(nodenumber)%DERIVATIVES(derivativeidx)%numberOfVersions
8740 CALL field_component_dof_get_user_node(dependentfield,variabletype,versionidx,derivativeidx, &
8741 & usernodenumber,componentidx,localdof,globaldof,err,error,*999)
8743 CALL field_number_of_components_get(analyticfield,field_u_variable_type, &
8744 & numberofparameters,err,error,*999)
8745 DO parameteridx=1,numberofparameters
8747 CALL field_parametersetgetlocalnode(analyticfield,field_u_variable_type,field_values_set_type, &
8748 & versionidx,derivativeidx,nodeidx,parameteridx,nodeanalyticparameters(parameteridx), &
8751 CALL navier_stokes_analytic_functions_evaluate(analyticfunctiontype,x,time,variabletype, &
8752 & globalderivativeindex,componentidx,numberofdimensions,fieldvariable%NUMBER_OF_COMPONENTS, &
8753 & nodeanalyticparameters,materialsparameters,
VALUE,err,error,*999)
8755 CALL navier_stokes_analytic_functions_evaluate(analyticfunctiontype,x,time,variabletype, &
8756 & globalderivativeindex,componentidx,numberofdimensions,fieldvariable%NUMBER_OF_COMPONENTS, &
8757 & analyticparameters,materialsparameters,
VALUE,err,error,*999)
8760 CALL field_parameter_set_update_local_dof(dependentfield,variabletype, &
8761 & field_analytic_values_set_type,localdof,
VALUE,err,error,*999)
8762 IF(variabletype==field_u_variable_type)
THEN 8763 IF(domainnodes%NODES(nodenumber)%BOUNDARY_NODE)
THEN 8765 & boundaryconditionsvariable,err,error,*999)
8766 IF(
ASSOCIATED(boundaryconditionsvariable))
THEN 8767 boundaryconditionscheckvariable=boundaryconditionsvariable% &
8768 & condition_types(globaldof)
8772 CALL field_parameter_set_update_local_dof(dependentfield,variabletype, &
8773 & field_values_set_type,localdof,
VALUE,err,error,*999)
8776 CALL field_parameter_set_update_local_node(dependentfield,field_u_variable_type, &
8777 & field_pressure_values_set_type,1,1,nodeidx,componentidx,
VALUE,err,error,*999)
8790 DO dimensionidx=1,numberofdimensions
8791 local_ny=geometricvariable%COMPONENTS(dimensionidx)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
8792 & nodes(nodeidx)%DERIVATIVES(1)%VERSIONS(1)
8793 x(dimensionidx)=geometricparameters(local_ny)
8796 DO derivativeidx=1,domainnodes%NODES(nodeidx)%NUMBER_OF_DERIVATIVES
8797 globalderivativeindex=domainnodes%NODES(nodeidx)%DERIVATIVES(derivativeidx)% &
8798 & global_derivative_index
8799 IF(componentidx==1 .AND. variabletype==field_u_variable_type)
THEN 8800 DO versionidx=1,domainnodes%NODES(nodeidx)%DERIVATIVES(derivativeidx)%numberOfVersions
8801 local_ny=fieldvariable%COMPONENTS(componentidx)%PARAM_TO_DOF_MAP% &
8802 & node_param2dof_map%NODES(nodeidx)%DERIVATIVES(derivativeidx)%VERSIONS(versionidx)
8803 IF(domainnodes%NODES(nodeidx)%BOUNDARY_NODE)
THEN 8805 & boundaryconditionsvariable,err,error,*999)
8806 IF(
ASSOCIATED(boundaryconditionsvariable))
THEN 8807 boundaryconditionscheckvariable=boundaryconditionsvariable%CONDITION_TYPES(local_ny)
8809 CALL navier_stokes_analytic_functions_evaluate(analyticfunctiontype,x,time,variabletype, &
8810 & globalderivativeindex,componentidx,numberofxi,fieldvariable%NUMBER_OF_COMPONENTS, &
8811 & analyticparameters,materialsparameters,
VALUE,err,error,*999)
8813 CALL field_parameter_set_update_local_dof(dependentfield,variabletype, &
8814 & field_values_set_type,local_ny,
VALUE,err,error,*999)
8816 CALL field_parametersetgetlocalnode(dependentfield,variabletype,field_values_set_type, &
8817 & versionidx,derivativeidx,nodeidx,componentidx,
VALUE,err,error,*999)
8818 CALL field_parameter_set_update_local_dof(dependentfield,variabletype, &
8819 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
8841 IF(domain%topology%elements%maximum_number_of_element_parameters==4.AND.numberofdimensions==2.OR. &
8842 & domain%topology%elements%maximum_number_of_element_parameters==9.OR. &
8843 & domain%topology%elements%maximum_number_of_element_parameters==16.OR. &
8844 & domain%topology%elements%maximum_number_of_element_parameters==8.OR. &
8845 & domain%topology%elements%maximum_number_of_element_parameters==27.OR. &
8846 & domain%topology%elements%maximum_number_of_element_parameters==64)
THEN 8847 DO k=1,numberofnodesxicoord(3)
8848 DO j=1,numberofnodesxicoord(2)
8849 DO i=1,numberofnodesxicoord(1)
8851 IF(domain%topology%elements%elements(elementidx)%element_nodes(en_idx)==nodeidx)
EXIT 8852 xicoordinates(1)=xicoordinates(1)+(1.0_dp/(numberofnodesxicoord(1)-1))
8854 IF(domain%topology%elements%elements(elementidx)%element_nodes(en_idx)==nodeidx)
EXIT 8855 xicoordinates(1)=0.0_dp
8856 xicoordinates(2)=xicoordinates(2)+(1.0_dp/(numberofnodesxicoord(2)-1))
8858 IF(domain%topology%elements%elements(elementidx)%element_nodes(en_idx)==nodeidx)
EXIT 8859 xicoordinates(1)=0.0_dp
8860 xicoordinates(2)=0.0_dp
8861 IF(numberofnodesxicoord(3)/=1)
THEN 8862 xicoordinates(3)=xicoordinates(3)+(1.0_dp/(numberofnodesxicoord(3)-1))
8866 & interpolatedpoint(field_u_variable_type)%PTR,err,error,*999)
8870 IF(domain%topology%elements%maximum_number_of_element_parameters==3)
THEN 8871 t_coordinates(1,1:2)=[0.0_dp,1.0_dp]
8872 t_coordinates(2,1:2)=[1.0_dp,0.0_dp]
8873 t_coordinates(3,1:2)=[1.0_dp,1.0_dp]
8874 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==6)
THEN 8875 t_coordinates(1,1:2)=[0.0_dp,1.0_dp]
8876 t_coordinates(2,1:2)=[1.0_dp,0.0_dp]
8877 t_coordinates(3,1:2)=[1.0_dp,1.0_dp]
8878 t_coordinates(4,1:2)=[0.5_dp,0.5_dp]
8879 t_coordinates(5,1:2)=[1.0_dp,0.5_dp]
8880 t_coordinates(6,1:2)=[0.5_dp,1.0_dp]
8881 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==10.AND. &
8882 & numberofdimensions==2)
THEN 8883 t_coordinates(1,1:2)=[0.0_dp,1.0_dp]
8884 t_coordinates(2,1:2)=[1.0_dp,0.0_dp]
8885 t_coordinates(3,1:2)=[1.0_dp,1.0_dp]
8886 t_coordinates(4,1:2)=[1.0_dp/3.0_dp,2.0_dp/3.0_dp]
8887 t_coordinates(5,1:2)=[2.0_dp/3.0_dp,1.0_dp/3.0_dp]
8888 t_coordinates(6,1:2)=[1.0_dp,1.0_dp/3.0_dp]
8889 t_coordinates(7,1:2)=[1.0_dp,2.0_dp/3.0_dp]
8890 t_coordinates(8,1:2)=[2.0_dp/3.0_dp,1.0_dp]
8891 t_coordinates(9,1:2)=[1.0_dp/3.0_dp,1.0_dp]
8892 t_coordinates(10,1:2)=[2.0_dp/3.0_dp,2.0_dp/3.0_dp]
8893 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==4)
THEN 8894 t_coordinates(1,1:3)=[0.0_dp,1.0_dp,1.0_dp]
8895 t_coordinates(2,1:3)=[1.0_dp,0.0_dp,1.0_dp]
8896 t_coordinates(3,1:3)=[1.0_dp,1.0_dp,0.0_dp]
8897 t_coordinates(4,1:3)=[1.0_dp,1.0_dp,1.0_dp]
8898 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==10.AND. &
8899 & numberofdimensions==3)
THEN 8900 t_coordinates(1,1:3)=[0.0_dp,1.0_dp,1.0_dp]
8901 t_coordinates(2,1:3)=[1.0_dp,0.0_dp,1.0_dp]
8902 t_coordinates(3,1:3)=[1.0_dp,1.0_dp,0.0_dp]
8903 t_coordinates(4,1:3)=[1.0_dp,1.0_dp,1.0_dp]
8904 t_coordinates(5,1:3)=[0.5_dp,0.5_dp,1.0_dp]
8905 t_coordinates(6,1:3)=[0.5_dp,1.0_dp,0.5_dp]
8906 t_coordinates(7,1:3)=[0.5_dp,1.0_dp,1.0_dp]
8907 t_coordinates(8,1:3)=[1.0_dp,0.5_dp,0.5_dp]
8908 t_coordinates(9,1:3)=[1.0_dp,1.0_dp,0.5_dp]
8909 t_coordinates(10,1:3)=[1.0_dp,0.5_dp,1.0_dp]
8910 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==20)
THEN 8911 t_coordinates(1,1:3)=[0.0_dp,1.0_dp,1.0_dp]
8912 t_coordinates(2,1:3)=[1.0_dp,0.0_dp,1.0_dp]
8913 t_coordinates(3,1:3)=[1.0_dp,1.0_dp,0.0_dp]
8914 t_coordinates(4,1:3)=[1.0_dp,1.0_dp,1.0_dp]
8915 t_coordinates(5,1:3)=[1.0_dp/3.0_dp,2.0_dp/3.0_dp,1.0_dp]
8916 t_coordinates(6,1:3)=[2.0_dp/3.0_dp,1.0_dp/3.0_dp,1.0_dp]
8917 t_coordinates(7,1:3)=[1.0_dp/3.0_dp,1.0_dp,2.0_dp/3.0_dp]
8918 t_coordinates(8,1:3)=[2.0_dp/3.0_dp,1.0_dp,1.0_dp/3.0_dp]
8919 t_coordinates(9,1:3)=[1.0_dp/3.0_dp,1.0_dp,1.0_dp]
8920 t_coordinates(10,1:3)=[2.0_dp/3.0_dp,1.0_dp,1.0_dp]
8921 t_coordinates(11,1:3)=[1.0_dp,1.0_dp/3.0_dp,2.0_dp/3.0_dp]
8922 t_coordinates(12,1:3)=[1.0_dp,2.0_dp/3.0_dp,1.0_dp/3.0_dp]
8923 t_coordinates(13,1:3)=[1.0_dp,1.0_dp,1.0_dp/3.0_dp]
8924 t_coordinates(14,1:3)=[1.0_dp,1.0_dp,2.0_dp/3.0_dp]
8925 t_coordinates(15,1:3)=[1.0_dp,1.0_dp/3.0_dp,1.0_dp]
8926 t_coordinates(16,1:3)=[1.0_dp,2.0_dp/3.0_dp,1.0_dp]
8927 t_coordinates(17,1:3)=[2.0_dp/3.0_dp,2.0_dp/3.0_dp,2.0_dp/3.0_dp]
8928 t_coordinates(18,1:3)=[2.0_dp/3.0_dp,2.0_dp/3.0_dp,1.0_dp]
8929 t_coordinates(19,1:3)=[2.0_dp/3.0_dp,1.0_dp,2.0_dp/3.0_dp]
8930 t_coordinates(20,1:3)=[1.0_dp,2.0_dp/3.0_dp,2.0_dp/3.0_dp]
8932 DO k=1,domain%topology%elements%maximum_number_of_element_parameters
8933 IF(domain%topology%elements%elements(elementidx)%element_nodes(k)==nodeidx)
EXIT 8935 IF(numberofdimensions==2)
THEN 8936 CALL field_interpolate_xi(
no_part_deriv,t_coordinates(k,1:2), &
8937 & interpolatedpoint(field_u_variable_type)%PTR,err,error,*999)
8938 ELSE IF(numberofdimensions==3)
THEN 8939 CALL field_interpolate_xi(
no_part_deriv,t_coordinates(k,1:3), &
8940 & interpolatedpoint(field_u_variable_type)%PTR,err,error,*999)
8944 DO dimensionidx=1,numberofdimensions
8945 x(dimensionidx)=interpolatedpoint(field_u_variable_type)%PTR%VALUES(dimensionidx,1)
8948 DO derivativeidx=1,domainnodes%NODES(nodeidx)%NUMBER_OF_DERIVATIVES
8949 globalderivativeindex=domainnodes%NODES(nodeidx)%DERIVATIVES(derivativeidx)% &
8950 & global_derivative_index
8951 CALL navier_stokes_analytic_functions_evaluate(analyticfunctiontype,x,time,variabletype, &
8952 & globalderivativeindex,componentidx,numberofdimensions,fieldvariable%NUMBER_OF_COMPONENTS, &
8953 & analyticparameters,materialsparameters,
VALUE,err,error,*999)
8954 DO versionidx=1,domainnodes%NODES(nodeidx)%DERIVATIVES(derivativeidx)%numberOfVersions
8955 local_ny=fieldvariable%COMPONENTS(componentidx)%PARAM_TO_DOF_MAP% &
8956 & node_param2dof_map%NODES(nodeidx)%DERIVATIVES(derivativeidx)%VERSIONS(versionidx)
8957 CALL field_parameter_set_update_local_dof(dependentfield,variabletype, &
8958 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
8959 IF(variabletype==field_u_variable_type)
THEN 8960 IF(domainnodes%NODES(nodeidx)%BOUNDARY_NODE)
THEN 8965 IF(componentidx>numberofdimensions)
THEN 8966 IF(domain%topology%elements%maximum_number_of_element_parameters==3)
THEN 8972 IF(-0.001_dp<x(1).AND.x(1)<0.001_dp.AND.-0.001_dp<x(2).AND.x(2)<0.001_dp.OR. &
8973 & 10.0_dp-0.001_dp<x(1).AND.x(1)<10.0_dp+0.001_dp.AND.-0.001_dp<x(2).AND. &
8974 & x(2)<0.001_dp.OR. &
8975 & 10.0_dp-0.001_dp<x(1).AND.x(1)<10.0_dp+0.001_dp.AND.10.0_dp-0.001_dp<x(2).AND. &
8976 & x(2)<10.0_dp+0.001_dp.OR. &
8977 & -0.001_dp<x(1).AND.x(1)<0.001_dp.AND.10.0_dp-0.001_dp<x(2).AND. &
8978 & x(2)<10.0_dp+0.001_dp)
THEN 8981 boundarycount=boundarycount+1
8984 ELSE IF(domain%topology%elements%maximum_number_of_element_parameters==4.AND. &
8985 & numberofdimensions==3)
THEN 8991 IF(-5.0_dp-0.001_dp<x(1).AND.x(1)<-5.0_dp+0.001_dp.AND.-5.0_dp-0.001_dp<x(2).AND. &
8992 & x(2)<-5.0_dp+0.001_dp.AND.-5.0_dp-0.001_dp<x(3).AND.x(3)<-5.0_dp+0.001_dp.OR. &
8993 & -5.0_dp-0.001_dp<x(1).AND.x(1)<-5.0_dp+0.001_dp.AND.5.0_dp-0.001_dp<x(2).AND. &
8994 & x(2)<5.0_dp+0.001_dp.AND.-5.0_dp-0.001_dp<x(3).AND.x(3)<-5.0_dp+0.001_dp.OR. &
8995 & 5.0_dp-0.001_dp<x(1).AND.x(1)<5.0_dp+0.001_dp.AND.5.0_dp-0.001_dp<x(2).AND. &
8996 & x(2)<5.0_dp+0.001_dp.AND.-5.0_dp-0.001_dp<x(3).AND.x(3)<-5.0_dp+0.001_dp.OR. &
8997 & 5.0_dp-0.001_dp<x(1).AND.x(1)<5.0_dp+0.001_dp.AND.-5.0_dp-0.001_dp<x(2).AND. &
8998 & x(2)<-5.0_dp+0.001_dp.AND.-5.0_dp-0.001_dp<x(3).AND.x(3)<-5.0_dp+0.001_dp.OR. &
8999 & -5.0_dp-0.001_dp<x(1).AND.x(1)<-5.0_dp+0.001_dp.AND.-5.0_dp-0.001_dp<x(2).AND. &
9000 & x(2)<-5.0_dp+0.001_dp.AND.5.0_dp-0.001_dp<x(3).AND.x(3)<5.0_dp+0.001_dp.OR. &
9001 & -5.0_dp-0.001_dp<x(1).AND.x(1)<-5.0_dp+0.001_dp.AND.5.0_dp-0.001_dp<x(2).AND. &
9002 & x(2)<5.0_dp+0.001_dp.AND.5.0_dp-0.001_dp<x(3).AND.x(3)<5.0_dp+0.001_dp.OR. &
9003 & 5.0_dp-0.001_dp<x(1).AND.x(1)<5.0_dp+0.001_dp.AND.5.0_dp-0.001_dp<x(2).AND. &
9004 & x(2)<5.0_dp+0.001_dp.AND.5.0_dp-0.001_dp<x(3).AND.x(3)<5.0_dp+0.001_dp.OR. &
9005 & 5.0_dp-0.001_dp<x(1).AND.x(1)<5.0_dp+0.001_dp.AND.-5.0_dp-0.001_dp<x(2).AND. &
9006 & x(2)<-5.0_dp+ 0.001_dp.AND.5.0_dp-0.001_dp<x(3).AND.x(3)<5.0_dp+0.001_dp)
THEN 9009 boundarycount=boundarycount+1
9013 ELSE IF(boundarycount==0)
THEN 9016 boundarycount=boundarycount+1
9021 CALL field_parameter_set_update_local_dof(dependentfield,variabletype, &
9022 & field_values_set_type,local_ny,initialvalue,err,error,*999)
9029 localerror=
"Analytic Function Type "//
trim(
number_to_vstring(analyticfunctiontype,
"*",err,error))// &
9030 &
" is not yet implemented for a Navier-Stokes problem." 9031 CALL flagerror(localerror,err,error,*999)
9036 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
9039 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
9042 CALL flagerror(
"Domain is not associated.",err,error,*999)
9045 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
9048 CALL field_parameter_set_update_start(dependentfield,variabletype,field_analytic_values_set_type, &
9050 CALL field_parameter_set_update_finish(dependentfield,variabletype,field_analytic_values_set_type, &
9052 CALL field_parameter_set_update_start(dependentfield,variabletype,field_values_set_type, &
9054 CALL field_parameter_set_update_finish(dependentfield,variabletype,field_values_set_type, &
9057 CALL flagerror(
"Field variable is not associated.",err,error,*999)
9060 CALL field_parameter_set_data_restore(geometricfield,field_u_variable_type,field_values_set_type, &
9061 & geometricparameters,err,error,*999)
9062 CALL field_interpolated_points_finalise(interpolatedpoint,err,error,*999)
9063 CALL field_interpolation_parameters_finalise(interpolationparameters,err,error,*999)
9065 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
9068 exits(
"NavierStokes_BoundaryConditionsAnalyticCalculate")
9070 999
errors(
"NavierStokes_BoundaryConditionsAnalyticCalculate",err,error)
9071 exits(
"NavierStokes_BoundaryConditionsAnalyticCalculate")
9074 END SUBROUTINE navierstokes_boundaryconditionsanalyticcalculate
9080 SUBROUTINE navier_stokes_analytic_functions_evaluate(ANALYTIC_FUNCTION_TYPE,X,TIME,VARIABLE_TYPE,GLOBAL_DERIV_INDEX, &
9081 & componentnumber,number_of_dimensions,number_of_components,analytic_parameters,materials_parameters,
VALUE,err,error,*)
9084 INTEGER(INTG),
INTENT(IN) :: ANALYTIC_FUNCTION_TYPE
9085 REAL(DP),
INTENT(IN) :: X(:)
9086 REAL(DP),
INTENT(IN) :: TIME
9087 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
9088 INTEGER(INTG),
INTENT(IN) :: GLOBAL_DERIV_INDEX
9089 INTEGER(INTG),
INTENT(IN) :: componentNumber
9090 INTEGER(INTG),
INTENT(IN) :: NUMBER_OF_DIMENSIONS
9091 INTEGER(INTG),
INTENT(IN) :: NUMBER_OF_COMPONENTS
9092 REAL(DP),
INTENT(IN) :: ANALYTIC_PARAMETERS(:)
9093 REAL(DP),
INTENT(IN) :: MATERIALS_PARAMETERS(:)
9094 REAL(DP),
INTENT(OUT) ::
VALUE 9095 INTEGER(INTG),
INTENT(OUT) :: ERR
9098 INTEGER(INTG) :: i,j,n,m
9099 REAL(DP) :: L_PARAM,H_PARAM,U_PARAM,P_PARAM,MU_PARAM,NU_PARAM,RHO_PARAM,INTERNAL_TIME,CURRENT_TIME,K_PARAM
9100 REAL(DP) :: amplitude,yOffset,period,phaseShift,frequency,s,startTime,stopTime,tt,tmax,Qo
9101 REAL(DP) :: componentCoeff(4),delta(300),t(300),q(300)
9104 enters(
"NAVIER_STOKES_ANALYTIC_FUNCTIONS_EVALUATE",err,error,*999)
9110 SELECT CASE(analytic_function_type)
9117 IF(number_of_dimensions==2.AND.number_of_components==3)
THEN 9118 mu_param = materials_parameters(1)
9119 rho_param = materials_parameters(2)
9120 SELECT CASE(variable_type)
9121 CASE(field_u_variable_type)
9122 l_param = analytic_parameters(1)
9123 h_param = analytic_parameters(2)
9124 u_param = analytic_parameters(3)
9125 p_param = analytic_parameters(4)
9126 SELECT CASE(global_deriv_index)
9128 IF(componentnumber==1)
THEN 9130 VALUE=(3.0_dp/2.0_dp)*u_param*(1.0_dp-((x(2)-h_param)**2)/(h_param**2))
9131 ELSE IF(componentnumber==2)
THEN 9134 ELSE IF(componentnumber==3)
THEN 9136 VALUE = (3.0_dp*mu_param*u_param*(x(1)-l_param))/(h_param**2)+p_param
9138 CALL flagerror(
"Not implemented.",err,error,*999)
9141 CALL flagerror(
"Not implemented.",err,error,*999)
9143 CALL flagerror(
"Not implemented.",err,error,*999)
9145 CALL flagerror(
"Not implemented.",err,error,*999)
9148 & global_deriv_index,
"*",err,error))// &
9150 CALL flagerror(local_error,err,error,*999)
9152 CASE(field_deludeln_variable_type)
9153 SELECT CASE(global_deriv_index)
9157 CALL flagerror(
"Not implemented.",err,error,*999)
9159 CALL flagerror(
"Not implemented.",err,error,*999)
9161 CALL flagerror(
"Not implemented.",err,error,*999)
9164 & global_deriv_index,
"*",err,error))// &
9166 CALL flagerror(local_error,err,error,*999)
9171 CALL flagerror(local_error,err,error,*999)
9174 local_error=
"The number of components does not correspond to the number of dimensions." 9175 CALL flagerror(local_error,err,error,*999)
9180 IF(number_of_dimensions==2.AND.number_of_components==3)
THEN 9181 mu_param = materials_parameters(1)
9182 rho_param = materials_parameters(2)
9183 nu_param = mu_param/rho_param
9184 SELECT CASE(variable_type)
9185 CASE(field_u_variable_type)
9186 u_param = analytic_parameters(1)
9187 l_param = analytic_parameters(2)
9188 k_param = 2.0_dp*
pi/l_param
9189 SELECT CASE(global_deriv_index)
9191 IF(componentnumber==1)
THEN 9193 VALUE=-1.0_dp*u_param*cos(k_param*x(1))*sin(k_param*x(2))*exp(-2.0_dp*(k_param**2)*nu_param*current_time)
9194 ELSE IF(componentnumber==2)
THEN 9196 VALUE=u_param*sin(k_param*x(1))*cos(k_param*x(2))*exp(-2.0_dp*(k_param**2)*nu_param*current_time)
9197 ELSE IF(componentnumber==3)
THEN 9199 VALUE =-1.0_dp*(u_param**2)*(rho_param/4.0_dp)*(cos(2.0_dp*k_param*x(1))+ &
9200 & cos(2.0_dp*k_param*x(2)))*(exp(-4.0_dp*(k_param**2)*nu_param*current_time))
9202 CALL flagerror(
"Not implemented.",err,error,*999)
9205 CALL flagerror(
"Not implemented.",err,error,*999)
9207 CALL flagerror(
"Not implemented.",err,error,*999)
9209 CALL flagerror(
"Not implemented.",err,error,*999)
9212 & global_deriv_index,
"*",err,error))// &
9214 CALL flagerror(local_error,err,error,*999)
9216 CASE(field_deludeln_variable_type)
9217 SELECT CASE(global_deriv_index)
9221 CALL flagerror(
"Not implemented.",err,error,*999)
9223 CALL flagerror(
"Not implemented.",err,error,*999)
9225 CALL flagerror(
"Not implemented.",err,error,*999)
9228 & global_deriv_index,
"*",err,error))// &
9230 CALL flagerror(local_error,err,error,*999)
9235 CALL flagerror(local_error,err,error,*999)
9238 local_error=
"The number of components does not correspond to the number of dimensions." 9239 CALL flagerror(local_error,err,error,*999)
9243 SELECT CASE(number_of_dimensions)
9245 SELECT CASE(variable_type)
9246 CASE(field_u_variable_type)
9247 SELECT CASE(global_deriv_index)
9249 IF(componentnumber==1)
THEN 9255 VALUE=(qo*tt/(tmax**2.0_dp))*exp(-(tt**2.0_dp)/(2.0_dp*(tmax**2.0_dp)))
9257 CALL flagerror(
"Incorrect component specification for Aorta flow rate waveform ",err,error,*999)
9261 & global_deriv_index,
"*",err,error))//
" is invalid." 9262 CALL flagerror(local_error,err,error,*999)
9264 CASE(field_deludeln_variable_type)
9265 SELECT CASE(global_deriv_index)
9270 & global_deriv_index,
"*",err,error))//
" is invalid." 9271 CALL flagerror(local_error,err,error,*999)
9273 CASE(field_v_variable_type,field_u1_variable_type,field_u2_variable_type)
9278 CALL flagerror(local_error,err,error,*999)
9281 local_error=
"Aorta flowrate waveform for "//
trim(
number_to_vstring(number_of_dimensions,
"*",err,error))// &
9282 &
" dimension problem has not yet been implemented." 9283 CALL flagerror(local_error,err,error,*999)
9287 SELECT CASE(number_of_dimensions)
9289 SELECT CASE(variable_type)
9290 CASE(field_u_variable_type)
9291 SELECT CASE(global_deriv_index)
9293 IF(componentnumber==1)
THEN 9295 t(1)= 0.0011660 ; q(1)= 17.39051
9296 t(2)= 0.0215840 ; q(2)= 10.41978
9297 t(3)= 0.0340860 ; q(3)= 18.75892
9298 t(4)= 0.0731370 ; q(4)= 266.3842
9299 t(5)= 0.0857710 ; q(5)= 346.3755
9300 t(6)= 0.1029220 ; q(6)= 413.8419
9301 t(7)= 0.1154270 ; q(7)= 424.2680
9302 t(8)= 0.1483530 ; q(8)= 429.1147
9303 t(9)= 0.1698860 ; q(9)= 411.0127
9304 t(10)= 0.220794 ; q(10)= 319.151
9305 t(11)= 0.264856 ; q(11)= 207.816
9306 t(12)= 0.295415 ; q(12)= 160.490
9307 t(13)= 0.325895 ; q(13)= 70.0342
9308 t(14)= 0.346215 ; q(14)= 10.1939
9309 t(15)= 0.363213 ; q(15)= -5.1222
9310 t(16)= 0.383666 ; q(16)= 6.68963
9311 t(17)= 0.405265 ; q(17)= 24.0659
9312 t(18)= 0.427988 ; q(18)= 35.8762
9313 t(19)= 0.455272 ; q(19)= 58.8137
9314 t(20)= 0.477990 ; q(20)= 67.8414
9315 t(21)= 0.502943 ; q(21)= 57.3893
9316 t(22)= 0.535816 ; q(22)= 33.7142
9317 t(23)= 0.577789 ; q(23)= 20.4676
9318 t(24)= 0.602753 ; q(24)= 16.2763
9319 t(25)= 0.639087 ; q(25)= 22.5119
9320 t(26)= 0.727616 ; q(26)= 18.9721
9321 t(27)= 0.783235 ; q(27)= 18.9334
9322 t(28)= 0.800000 ; q(28)= 16.1121
9330 delta(i)=(q(i+1)-q(i))/(t(i+1)-t(i))
9332 delta(n)=delta(n-1)+(delta(n-1)-delta(n-2))/(t(n-1)-t(n-2))*(t(n)-t(n-1))
9335 IF(t(j) <= (time/period))
THEN 9340 s=(time/period)-t(m)
9341 VALUE=(q(m)+s*delta(m))
9343 CALL flagerror(
"Incorrect component specification for Olufsen flow rate waveform ",err,error,*999)
9347 & global_deriv_index,
"*",err,error))//
" is invalid." 9348 CALL flagerror(local_error,err,error,*999)
9350 CASE(field_deludeln_variable_type)
9351 SELECT CASE(global_deriv_index)
9356 & global_deriv_index,
"*",err,error))//
" is invalid." 9357 CALL flagerror(local_error,err,error,*999)
9359 CASE(field_v_variable_type,field_u1_variable_type,field_u2_variable_type)
9364 CALL flagerror(local_error,err,error,*999)
9367 local_error=
"Olufsen flowrate waveform for "//
trim(
number_to_vstring(number_of_dimensions,
"*",err,error))// &
9368 &
" dimension problem has not yet been implemented." 9369 CALL flagerror(local_error,err,error,*999)
9374 SELECT CASE(number_of_dimensions)
9376 componentcoeff(1) = analytic_parameters(1)
9377 componentcoeff(2) = analytic_parameters(2)
9378 componentcoeff(3) = analytic_parameters(3)
9379 componentcoeff(4) = analytic_parameters(4)
9380 amplitude = analytic_parameters(5)
9381 yoffset = analytic_parameters(6)
9382 frequency = analytic_parameters(7)
9383 phaseshift = analytic_parameters(8)
9384 starttime = analytic_parameters(9)
9385 stoptime = analytic_parameters(10)
9386 SELECT CASE(variable_type)
9387 CASE(field_u_variable_type)
9388 SELECT CASE(global_deriv_index)
9392 VALUE= componentcoeff(componentnumber)*(yoffset + amplitude*sin(frequency*current_time+phaseshift))
9394 VALUE= componentcoeff(componentnumber)*(yoffset + amplitude*sin(frequency*stoptime+phaseshift))
9398 & global_deriv_index,
"*",err,error))//
" is invalid." 9399 CALL flagerror(local_error,err,error,*999)
9401 CASE(field_deludeln_variable_type)
9402 SELECT CASE(global_deriv_index)
9407 & global_deriv_index,
"*",err,error))//
" is invalid." 9408 CALL flagerror(local_error,err,error,*999)
9413 CALL flagerror(local_error,err,error,*999)
9416 local_error=
"Sinusoidal analytic types for "//
trim(
number_to_vstring(number_of_dimensions,
"*",err,error))// &
9417 &
" dimensional problems have not yet been implemented." 9418 CALL flagerror(local_error,err,error,*999)
9422 IF(number_of_dimensions==1.AND.number_of_components==3)
THEN 9424 SELECT CASE(variable_type)
9425 CASE(field_u_variable_type)
9426 SELECT CASE(global_deriv_index)
9428 IF(componentnumber==1)
THEN 9430 VALUE=x(1)**2/10.0_dp**2
9431 ELSE IF(componentnumber==2)
THEN 9433 VALUE=x(1)**2/10.0_dp**2
9434 ELSE IF(componentnumber==3)
THEN 9436 VALUE=x(1)**2/10.0_dp**2
9438 CALL flagerror(
"Not implemented.",err,error,*999)
9441 CALL flagerror(
"Not implemented.",err,error,*999)
9443 CALL flagerror(
"Not implemented.",err,error,*999)
9445 CALL flagerror(
"Not implemented.",err,error,*999)
9448 & global_deriv_index,
"*",err,error))//
" is invalid." 9449 CALL flagerror(local_error,err,error,*999)
9451 CASE(field_deludeln_variable_type)
9452 SELECT CASE(global_deriv_index)
9456 CALL flagerror(
"Not implemented.",err,error,*999)
9458 CALL flagerror(
"Not implemented.",err,error,*999)
9460 CALL flagerror(
"Not implemented.",err,error,*999)
9463 & global_deriv_index,
"*",err,error))// &
9465 CALL flagerror(local_error,err,error,*999)
9470 CALL flagerror(local_error,err,error,*999)
9473 local_error=
"The number of components does not correspond to the number of dimensions." 9474 CALL flagerror(local_error,err,error,*999)
9478 IF(number_of_dimensions==2.AND.number_of_components==3)
THEN 9480 mu_param = materials_parameters(1)
9481 rho_param = materials_parameters(2)
9482 SELECT CASE(variable_type)
9483 CASE(field_u_variable_type)
9484 SELECT CASE(global_deriv_index)
9486 IF(componentnumber==1)
THEN 9488 VALUE=x(2)**2/10.0_dp**2
9489 ELSE IF(componentnumber==2)
THEN 9491 VALUE=x(1)**2/10.0_dp**2
9492 ELSE IF(componentnumber==3)
THEN 9494 VALUE=2.0_dp/3.0_dp*x(1)*(3.0_dp*mu_param*10.0_dp**2-rho_param*x(1)**2*x(2))/(10.0_dp ** 4)
9496 CALL flagerror(
"Not implemented.",err,error,*999)
9499 CALL flagerror(
"Not implemented.",err,error,*999)
9501 CALL flagerror(
"Not implemented.",err,error,*999)
9503 CALL flagerror(
"Not implemented.",err,error,*999)
9506 & global_deriv_index,
"*",err,error))// &
9508 CALL flagerror(local_error,err,error,*999)
9510 CASE(field_deludeln_variable_type)
9511 SELECT CASE(global_deriv_index)
9515 CALL flagerror(
"Not implemented.",err,error,*999)
9517 CALL flagerror(
"Not implemented.",err,error,*999)
9519 CALL flagerror(
"Not implemented.",err,error,*999)
9522 & global_deriv_index,
"*",err,error))// &
9524 CALL flagerror(local_error,err,error,*999)
9529 CALL flagerror(local_error,err,error,*999)
9532 local_error=
"The number of components does not correspond to the number of dimensions." 9533 CALL flagerror(local_error,err,error,*999)
9537 IF(number_of_dimensions==2.AND.number_of_components==3)
THEN 9539 mu_param = materials_parameters(1)
9540 rho_param = materials_parameters(2)
9541 SELECT CASE(variable_type)
9542 CASE(field_u_variable_type)
9543 SELECT CASE(global_deriv_index)
9545 IF(componentnumber==1)
THEN 9547 VALUE= exp((x(1)-x(2))/10.0_dp)
9548 ELSE IF(componentnumber==2)
THEN 9550 VALUE= exp((x(1)-x(2))/10.0_dp)
9551 ELSE IF(componentnumber==3)
THEN 9553 VALUE= 2.0_dp*mu_param/10.0_dp*exp((x(1)-x(2))/10.0_dp)
9555 CALL flagerror(
"Not implemented.",err,error,*999)
9558 CALL flagerror(
"Not implemented.",err,error,*999)
9560 CALL flagerror(
"Not implemented.",err,error,*999)
9562 CALL flagerror(
"Not implemented.",err,error,*999)
9565 & global_deriv_index,
"*",err,error))// &
9567 CALL flagerror(local_error,err,error,*999)
9569 CASE(field_deludeln_variable_type)
9570 SELECT CASE(global_deriv_index)
9572 IF(componentnumber==1)
THEN 9575 ELSE IF(componentnumber==2)
THEN 9578 ELSE IF(componentnumber==3)
THEN 9582 CALL flagerror(
"Not implemented.",err,error,*999)
9585 CALL flagerror(
"Not implemented.",err,error,*999)
9587 CALL flagerror(
"Not implemented.",err,error,*999)
9589 CALL flagerror(
"Not implemented.",err,error,*999)
9592 & global_deriv_index,
"*",err,error))// &
9594 CALL flagerror(local_error,err,error,*999)
9599 CALL flagerror(local_error,err,error,*999)
9602 local_error=
"The number of components does not correspond to the number of dimensions." 9603 CALL flagerror(local_error,err,error,*999)
9607 IF(number_of_dimensions==2.AND.number_of_components==3)
THEN 9609 mu_param = materials_parameters(1)
9610 rho_param = materials_parameters(2)
9611 SELECT CASE(variable_type)
9612 CASE(field_u_variable_type)
9613 SELECT CASE(global_deriv_index)
9615 IF(componentnumber==1)
THEN 9617 VALUE=sin(2.0_dp*
pi*x(1)/10.0_dp)*sin(2.0_dp*
pi*x(2)/10.0_dp)
9618 ELSE IF(componentnumber==2)
THEN 9620 VALUE=cos(2.0_dp*
pi*x(1)/10.0_dp)*cos(2.0_dp*
pi*x(2)/10.0_dp)
9621 ELSE IF(componentnumber==3)
THEN 9623 VALUE=4.0_dp*mu_param*
pi/10.0_dp*sin(2.0_dp*
pi*x(2)/10.0_dp)*cos(2.0_dp*
pi*x(1)/10.0_dp)+ &
9624 & 0.5_dp*rho_param*cos(2.0_dp*
pi*x(1)/10.0_dp)*cos(2.0_dp*
pi*x(1)/10.0_dp)
9626 CALL flagerror(
"Not implemented.",err,error,*999)
9629 CALL flagerror(
"Not implemented.",err,error,*999)
9631 CALL flagerror(
"Not implemented.",err,error,*999)
9633 CALL flagerror(
"Not implemented.",err,error,*999)
9636 & global_deriv_index,
"*",err,error))// &
9638 CALL flagerror(local_error,err,error,*999)
9640 CASE(field_deludeln_variable_type)
9641 SELECT CASE(global_deriv_index)
9643 IF(componentnumber==1)
THEN 9646 ELSE IF(componentnumber==2)
THEN 9648 VALUE=16.0_dp*mu_param*
pi**2/10.0_dp**2*cos(2.0_dp*
pi*x(2)/ 10.0_dp)*cos(2.0_dp*
pi*x(1)/10.0_dp)
9649 ELSE IF(componentnumber==3)
THEN 9653 CALL flagerror(
"Not implemented.",err,error,*999)
9656 CALL flagerror(
"Not implemented.",err,error,*999)
9658 CALL flagerror(
"Not implemented.",err,error,*999)
9660 CALL flagerror(
"Not implemented.",err,error,*999)
9663 & global_deriv_index,
"*",err,error))// &
9665 CALL flagerror(local_error,err,error,*999)
9670 CALL flagerror(local_error,err,error,*999)
9673 local_error=
"The number of components does not correspond to the number of dimensions." 9674 CALL flagerror(local_error,err,error,*999)
9678 IF(number_of_dimensions==2.AND.number_of_components==3)
THEN 9680 mu_param = materials_parameters(1)
9681 rho_param = materials_parameters(2)
9682 SELECT CASE(variable_type)
9683 CASE(field_u_variable_type)
9684 SELECT CASE(global_deriv_index)
9686 IF(componentnumber==1)
THEN 9688 VALUE=sin(x(1)/10.0_dp*2.0_dp*
pi)*cos(x(2)/10.0_dp*2.0_dp*
pi)*exp(-2.0_dp*mu_param/rho_param*current_time)
9689 VALUE=sin(x(1)/10.0_dp*
pi)*cos(x(2)/10.0_dp*
pi)*exp(-2.0_dp*mu_param/rho_param*current_time)
9691 ELSE IF(componentnumber==2)
THEN 9693 VALUE=-cos(x(1)/10.0_dp*2.0_dp*
pi)*sin(x(2)/10.0_dp*2.0_dp*
pi)*exp(-2.0_dp*mu_param/rho_param*current_time)
9694 VALUE=-cos(x(1)/10.0_dp*
pi)*sin(x(2)/10.0_dp*
pi)*exp(-2.0_dp*mu_param/rho_param*current_time)
9696 ELSE IF(componentnumber==3)
THEN 9698 VALUE=rho_param/4.0_dp*(cos(2.0_dp*x(1)/10.0_dp*2.0_dp*
pi)+cos(2.0_dp*x(2)/10.0_dp*2.0_dp*
pi))* &
9699 & exp(-4.0_dp*mu_param/rho_param*current_time)
9700 VALUE=rho_param/4.0_dp*(cos(2.0_dp*x(1)/10.0_dp*
pi)+cos(2.0_dp*x(2)/10.0_dp*
pi))* &
9701 & exp(-4.0_dp*mu_param/rho_param*current_time)
9704 CALL flagerror(
"Not implemented.",err,error,*999)
9707 CALL flagerror(
"Not implemented.",err,error,*999)
9709 CALL flagerror(
"Not implemented.",err,error,*999)
9711 CALL flagerror(
"Not implemented.",err,error,*999)
9714 & global_deriv_index,
"*",err,error))// &
9716 CALL flagerror(local_error,err,error,*999)
9718 CASE(field_deludeln_variable_type)
9719 SELECT CASE(global_deriv_index)
9721 IF(componentnumber==1)
THEN 9724 ELSE IF(componentnumber==2)
THEN 9727 ELSE IF(componentnumber==3)
THEN 9731 CALL flagerror(
"Not implemented.",err,error,*999)
9734 CALL flagerror(
"Not implemented.",err,error,*999)
9736 CALL flagerror(
"Not implemented.",err,error,*999)
9738 CALL flagerror(
"Not implemented.",err,error,*999)
9741 & global_deriv_index,
"*",err,error))// &
9743 CALL flagerror(local_error,err,error,*999)
9748 CALL flagerror(local_error,err,error,*999)
9751 local_error=
"The number of components does not correspond to the number of dimensions." 9752 CALL flagerror(local_error,err,error,*999)
9756 IF(number_of_dimensions==3.AND.number_of_components==4)
THEN 9758 mu_param = materials_parameters(1)
9759 rho_param = materials_parameters(2)
9760 SELECT CASE(variable_type)
9761 CASE(field_u_variable_type)
9762 SELECT CASE(global_deriv_index)
9764 IF(componentnumber==1)
THEN 9766 VALUE=x(2)**2/10.0_dp**2+x(3)**2/10.0_dp**2
9767 ELSE IF(componentnumber==2)
THEN 9769 VALUE=x(1)**2/10.0_dp**2+x(3)**2/10.0_dp** 2
9770 ELSE IF(componentnumber==3)
THEN 9772 VALUE=x(1)**2/10.0_dp**2+x(2)**2/10.0_dp** 2
9773 ELSE IF(componentnumber==4)
THEN 9775 VALUE=2.0_dp/3.0_dp*x(1)*(6.0_dp*mu_param*10.0_dp**2-rho_param*x(2)*x(1)**2-3.0_dp* &
9777 & x(3)**2-rho_param*x(3)*x(1)**2-3.0_dp*rho_param*x(3)*x(2)**2)/(10.0_dp**4)
9779 CALL flagerror(
"Not implemented.",err,error,*999)
9782 CALL flagerror(
"Not implemented.",err,error,*999)
9784 CALL flagerror(
"Not implemented.",err,error,*999)
9786 CALL flagerror(
"Not implemented.",err,error,*999)
9789 & global_deriv_index,
"*",err,error))// &
9791 CALL flagerror(local_error,err,error,*999)
9793 CASE(field_deludeln_variable_type)
9794 SELECT CASE(global_deriv_index)
9798 CALL flagerror(
"Not implemented.",err,error,*999)
9800 CALL flagerror(
"Not implemented.",err,error,*999)
9802 CALL flagerror(
"Not implemented.",err,error,*999)
9805 & global_deriv_index,
"*",err,error))// &
9807 CALL flagerror(local_error,err,error,*999)
9812 CALL flagerror(local_error,err,error,*999)
9815 local_error=
"The number of components does not correspond to the number of dimensions." 9816 CALL flagerror(local_error,err,error,*999)
9820 IF(number_of_dimensions==3.AND.number_of_components==4)
THEN 9822 mu_param = materials_parameters(1)
9823 rho_param = materials_parameters(2)
9824 SELECT CASE(variable_type)
9825 CASE(field_u_variable_type)
9826 SELECT CASE(global_deriv_index)
9828 IF(componentnumber==1)
THEN 9830 VALUE=exp((x(1)-x(2))/10.0_dp)+exp((x(3)-x(1))/10.0_dp)
9831 ELSE IF(componentnumber==2)
THEN 9833 VALUE=exp((x(1)-x(2))/10.0_dp)+exp((x(2)-x(3))/10.0_dp)
9834 ELSE IF(componentnumber==3)
THEN 9836 VALUE=exp((x(3)-x(1))/10.0_dp)+exp((x(2)-x(3))/10.0_dp)
9837 ELSE IF(componentnumber==4)
THEN 9839 VALUE=1.0_dp/10.0_dp*(2.0_dp*mu_param*exp((x(1)-x(2))/10.0_dp)- &
9840 & 2.0_dp*mu_param*exp((x(3)-x(1))/10.0_dp)+rho_param*10.0_dp*exp((x(1)-x(3))/10.0_dp)+ &
9841 & rho_param*10.0_dp*exp((x(2)-x(1))/10.0_dp))
9843 CALL flagerror(
"Not implemented.",err,error,*999)
9846 CALL flagerror(
"Not implemented.",err,error,*999)
9848 CALL flagerror(
"Not implemented.",err,error,*999)
9850 CALL flagerror(
"Not implemented.",err,error,*999)
9853 & global_deriv_index,
"*",err,error))// &
9855 CALL flagerror(local_error,err,error,*999)
9857 CASE(field_deludeln_variable_type)
9858 SELECT CASE(global_deriv_index)
9860 IF(componentnumber==1)
THEN 9863 ELSE IF(componentnumber==2)
THEN 9865 VALUE=-2.0_dp*mu_param*(2.0_dp*exp(x(1)-x(2))+exp(x(2)-x(3)))
9866 ELSE IF(componentnumber==3)
THEN 9868 VALUE=-2.0_dp*mu_param*(2.0_dp*exp(x(3)-x(1))+exp(x(2)-x(3)))
9869 ELSE IF(componentnumber==4)
THEN 9873 CALL flagerror(
"Not implemented.",err,error,*999)
9876 CALL flagerror(
"Not implemented.",err,error,*999)
9878 CALL flagerror(
"Not implemented.",err,error,*999)
9880 CALL flagerror(
"Not implemented.",err,error,*999)
9883 & global_deriv_index,
"*",err,error))// &
9885 CALL flagerror(local_error,err,error,*999)
9890 CALL flagerror(local_error,err,error,*999)
9893 local_error=
"The number of components does not correspond to the number of dimensions." 9894 CALL flagerror(local_error,err,error,*999)
9898 IF(number_of_dimensions==3.AND.number_of_components==4)
THEN 9900 mu_param = materials_parameters(1)
9901 rho_param = materials_parameters(2)
9902 SELECT CASE(variable_type)
9903 CASE(field_u_variable_type)
9904 SELECT CASE(global_deriv_index)
9906 IF(componentnumber==1)
THEN 9908 VALUE=sin(2.0_dp*
pi*x(1)/10.0_dp)*sin(2.0_dp*
pi*x(2)/10.0_dp)*sin(2.0_dp*
pi*x(3)/10.0_dp)
9909 ELSE IF(componentnumber==2)
THEN 9911 VALUE=2.0_dp*cos(2.0_dp*
pi*x(1)/10.0_dp)*sin(2.0_dp*
pi*x(3)/10.0_dp)*cos(2.0_dp*
pi*x(2)/10.0_dp)
9912 ELSE IF(componentnumber==3)
THEN 9914 VALUE=-cos(2.0_dp*
pi*x(1)/10.0_dp)*sin(2.0_dp*
pi*x(2)/10.0_dp)*cos(2.0_dp*
pi*x(3)/10.0_dp)
9915 ELSE IF(componentnumber==4)
THEN 9917 VALUE=-cos(2.0_dp*
pi*x(1)/10.0_dp)*(-12.0_dp*mu_param*
pi*sin(2.0_dp*
pi*x(2)/10.0_dp)* &
9918 & sin(2.0_dp*
pi*x(3)/10.0_dp)-rho_param*cos(2.0_dp*
pi*x(1)/10.0_dp)*10.0_dp+ &
9919 & 2.0_dp*rho_param*cos(2.0_dp*
pi*x(1)/10.0_dp)*10.0_dp*cos(2.0_dp*
pi*x(3)/10.0_dp)**2- &
9920 & rho_param*cos(2.0_dp*
pi*x(1)/10.0_dp)*10.0_dp*cos(2.0_dp*
pi*x(2)/10.0_dp)**2)/10.0_dp/2.0_dp
9922 CALL flagerror(
"Not implemented.",err,error,*999)
9925 CALL flagerror(
"Not implemented.",err,error,*999)
9927 CALL flagerror(
"Not implemented.",err,error,*999)
9929 CALL flagerror(
"Not implemented.",err,error,*999)
9932 & global_deriv_index,
"*",err,error))// &
9934 CALL flagerror(local_error,err,error,*999)
9936 CASE(field_deludeln_variable_type)
9937 SELECT CASE(global_deriv_index)
9939 IF(componentnumber==1)
THEN 9942 ELSE IF(componentnumber==2)
THEN 9944 VALUE=36*mu_param*
pi**2/10.0_dp**2*cos(2.0_dp*
pi*x(2)/10.0_dp)*sin(2.0_dp*
pi*x(3)/10.0_dp)* &
9945 & cos(2.0_dp*
pi*x(1)/10.0_dp)
9946 ELSE IF(componentnumber==3)
THEN 9949 ELSE IF(componentnumber==4)
THEN 9953 CALL flagerror(
"Not implemented.",err,error,*999)
9956 CALL flagerror(
"Not implemented.",err,error,*999)
9958 CALL flagerror(
"Not implemented.",err,error,*999)
9960 CALL flagerror(
"Not implemented.",err,error,*999)
9963 & global_deriv_index,
"*",err,error))// &
9965 CALL flagerror(local_error,err,error,*999)
9970 CALL flagerror(local_error,err,error,*999)
9973 local_error=
"The number of components does not correspond to the number of dimensions." 9974 CALL flagerror(local_error,err,error,*999)
9978 IF(number_of_dimensions==3.AND.number_of_components==4)
THEN 9980 mu_param = materials_parameters(1)
9981 rho_param = materials_parameters(2)
9982 SELECT CASE(variable_type)
9983 CASE(field_u_variable_type)
9984 SELECT CASE(global_deriv_index)
9986 IF(componentnumber==1)
THEN 9988 VALUE=sin(x(1)/10.0_dp*
pi)*cos(x(2)/10.0_dp*
pi)*exp(-2.0_dp*mu_param/rho_param*current_time)
9989 ELSE IF(componentnumber==2)
THEN 9991 VALUE=-cos(x(1)/10.0_dp*
pi)*sin(x(2)/10.0_dp*
pi)*exp(-2.0_dp*mu_param/rho_param*current_time)
9992 ELSE IF(componentnumber==3)
THEN 9996 ELSE IF(componentnumber==4)
THEN 9998 VALUE=rho_param/4.0_dp*(cos(2.0_dp*x(1)/10.0_dp*
pi)+cos(2.0_dp*x(2)/10.0_dp*
pi))* &
9999 & exp(-4.0_dp*mu_param/rho_param*current_time)
10002 CALL flagerror(
"Not implemented.",err,error,*999)
10005 CALL flagerror(
"Not implemented.",err,error,*999)
10007 CALL flagerror(
"Not implemented.",err,error,*999)
10009 CALL flagerror(
"Not implemented.",err,error,*999)
10012 & global_deriv_index,
"*",err,error))// &
10014 CALL flagerror(local_error,err,error,*999)
10016 CASE(field_deludeln_variable_type)
10017 SELECT CASE(global_deriv_index)
10019 IF(componentnumber==1)
THEN 10022 ELSE IF(componentnumber==2)
THEN 10025 ELSE IF(componentnumber==3)
THEN 10028 ELSE IF(componentnumber==4)
THEN 10032 CALL flagerror(
"Not implemented.",err,error,*999)
10035 CALL flagerror(
"Not implemented.",err,error,*999)
10037 CALL flagerror(
"Not implemented.",err,error,*999)
10039 CALL flagerror(
"Not implemented.",err,error,*999)
10042 & global_deriv_index,
"*",err,error))// &
10044 CALL flagerror(local_error,err,error,*999)
10049 CALL flagerror(local_error,err,error,*999)
10052 local_error=
"The number of components does not correspond to the number of dimensions." 10053 CALL flagerror(local_error,err,error,*999)
10056 local_error=
"The analytic function type of "// &
10059 CALL flagerror(local_error,err,error,*999)
10062 exits(
"NAVIER_STOKES_ANALYTIC_FUNCTIONS_EVALUATE")
10064 999 errorsexits(
"NAVIER_STOKES_ANALYTIC_FUNCTIONS_EVALUATE",err,error)
10067 END SUBROUTINE navier_stokes_analytic_functions_evaluate
10074 SUBROUTINE navierstokes_residualbasedstabilisation(equationsSet,elementNumber,gaussNumber,mu,rho,jacobianFlag,err,error,*)
10078 INTEGER(INTG),
INTENT(IN) :: elementNumber
10079 INTEGER(INTG),
INTENT(IN) :: gaussNumber
10080 REAL(DP),
INTENT(IN) :: mu
10081 REAL(DP),
INTENT(IN) :: rho
10082 LOGICAL,
INTENT(IN) :: jacobianFlag
10083 INTEGER(INTG),
INTENT(OUT) :: err
10087 TYPE(
basis_type),
POINTER :: basisVelocity,basisPressure
10092 TYPE(
field_type),
POINTER :: equationsSetField
10094 TYPE(
field_type),
POINTER :: dependentField,geometricField
10101 INTEGER(INTG) :: fieldVariableType,meshComponent1,meshComponent2
10102 INTEGER(INTG) :: numberOfDimensions
10103 INTEGER(INTG) :: i,j,k,l,mhs,nhs,ms,ns,nh,mh,nj,ni,pressureIndex
10104 INTEGER(INTG) :: numberOfElementParameters(4),stabilisationType
10105 REAL(DP) :: PHIMS,PHINS
10106 REAL(DP) :: dPhi_dX_Velocity(27,3),dPhi_dX_Pressure(27,3),DPHINS2_DXI(3,3)
10107 REAL(DP) :: jacobianMomentum(3),jacobianContinuity
10108 REAL(DP) :: DXI_DX(3,3)
10109 REAL(DP) :: velocity(3),velocityPrevious(3),velocityDeriv(3,3),velocity2Deriv(3,3,3),pressure,pressureDeriv(3)
10110 REAL(DP) :: JGW,SUM,SUM2,SUPG,PSPG,LSIC,crossStress,reynoldsStress,momentumTerm
10111 REAL(DP) :: uDotGu,doubleDotG,tauSUPS,traceG,nuLSIC,timeIncrement,elementInverse,C1,stabilisationValueDP
10112 REAL(DP) :: tauC,tauMp,tauMu
10113 REAL(DP) :: residualMomentum(3),residualContinuity
10115 LOGICAL :: linearElement
10117 enters(
"NavierStokes_ResidualBasedStabilisation",err,error,*999)
10120 NULLIFY(basisvelocity)
10121 NULLIFY(basispressure)
10123 NULLIFY(equationsmapping)
10124 NULLIFY(nonlinearmapping)
10125 NULLIFY(equationsequationssetfield)
10126 NULLIFY(equationssetfield)
10127 NULLIFY(quadraturevelocity)
10128 NULLIFY(quadraturepressure)
10129 NULLIFY(dependentfield)
10130 NULLIFY(geometricfield)
10131 NULLIFY(fieldvariable)
10132 NULLIFY(equationsmatrices)
10133 NULLIFY(nonlinearmatrices)
10134 NULLIFY(jacobianmatrix)
10136 IF(
ASSOCIATED(equationsset))
THEN 10137 IF(.NOT.
ALLOCATED(equationsset%specification))
THEN 10138 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
10139 ELSE IF(
SIZE(equationsset%specification,1)/=3)
THEN 10140 CALL flagerror(
"Equations set specification must have three entries for a Navier-Stokes type equations set.", &
10143 SELECT CASE(equationsset%specification(3))
10148 equations=>equationsset%EQUATIONS
10149 IF(
ASSOCIATED(equations))
THEN 10151 equationsmapping=>equations%EQUATIONS_MAPPING
10152 equationsmatrices=>equations%EQUATIONS_MATRICES
10153 nonlinearmapping=>equationsmapping%NONLINEAR_MAPPING
10154 nonlinearmatrices=>equationsmatrices%NONLINEAR_MATRICES
10155 jacobianmatrix=>nonlinearmatrices%JACOBIANS(1)%PTR
10156 fieldvariable=>nonlinearmapping%RESIDUAL_VARIABLES(1)%PTR
10157 fieldvariabletype=fieldvariable%VARIABLE_TYPE
10158 geometricfield=>equations%INTERPOLATION%GEOMETRIC_FIELD
10159 numberofdimensions=fieldvariable%NUMBER_OF_COMPONENTS - 1
10160 equationsequationssetfield=>equationsset%EQUATIONS_SET_FIELD
10161 meshcomponent1=fieldvariable%COMPONENTS(1)%MESH_COMPONENT_NUMBER
10162 meshcomponent2=fieldvariable%COMPONENTS(fieldvariable%NUMBER_OF_COMPONENTS)%MESH_COMPONENT_NUMBER
10163 dependentfield=>equations%INTERPOLATION%DEPENDENT_FIELD
10164 basisvelocity=>dependentfield%DECOMPOSITION%DOMAIN(meshcomponent1)%PTR% &
10165 & topology%ELEMENTS%ELEMENTS(elementnumber)%BASIS
10166 basispressure=>dependentfield%DECOMPOSITION%DOMAIN(meshcomponent2)%PTR% &
10167 & topology%ELEMENTS%ELEMENTS(elementnumber)%BASIS
10169 IF(basisvelocity%INTERPOLATION_ORDER(1).LE.1)
THEN 10170 linearelement = .true.
10173 linearelement = .false.
10178 equationssetfield=>equationsequationssetfield%EQUATIONS_SET_FIELD_FIELD
10179 IF(
ASSOCIATED(equationssetfield))
THEN 10181 CALL field_parameter_set_get_constant(equationssetfield,field_u1_variable_type,field_values_set_type, &
10182 & 4,stabilisationvaluedp,err,error,*999)
10183 stabilisationtype=nint(stabilisationvaluedp)
10185 IF(stabilisationtype > 0)
THEN 10187 CALL field_parameter_set_get_constant(equationssetfield,field_u1_variable_type,field_values_set_type, &
10188 & 3,timeincrement,err,error,*999)
10193 CALL flagerror(
"Please set the equations set field time increment to a value > 0.",err,error,*999)
10196 CALL field_parameter_set_get_constant(equationssetfield,field_u1_variable_type,field_values_set_type, &
10197 & 4,stabilisationvaluedp,err,error,*999)
10198 stabilisationtype=nint(stabilisationvaluedp)
10200 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
10201 & elementnumber,10,elementinverse,err,error,*999)
10204 velocityprevious=0.0_dp
10206 CALL field_interpolation_parameters_element_get(field_previous_values_set_type,elementnumber,equations% &
10207 & interpolation%DEPENDENT_INTERP_PARAMETERS(field_u_variable_type)%PTR,err,error,*999)
10209 & dependent_interp_point(field_u_variable_type)%PTR,err,error,*999)
10210 velocityprevious=0.0_dp
10211 DO i=1,numberofdimensions
10212 velocityprevious(i)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR%VALUES(i,
no_part_deriv)
10217 CALL field_interpolation_parameters_element_get(field_values_set_type,elementnumber,equations%INTERPOLATION% &
10218 & dependent_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
10219 IF(linearelement)
THEN 10222 & dependent_interp_point(field_u_variable_type)%PTR,err,error,*999)
10226 & dependent_interp_point(field_u_variable_type)%PTR,err,error,*999)
10229 velocityderiv=0.0_dp
10230 velocity2deriv=0.0_dp
10232 pressurederiv=0.0_dp
10233 DO i=1,numberofdimensions
10234 velocity(i)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR%VALUES(i,
no_part_deriv)
10235 velocityderiv(i,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR%VALUES(i,
part_deriv_s1)
10236 velocityderiv(i,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR%VALUES(i,
part_deriv_s2)
10237 IF(.NOT. linearelement)
THEN 10238 velocity2deriv(i,1,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR% &
10240 velocity2deriv(i,1,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR% &
10242 velocity2deriv(i,2,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR% &
10244 velocity2deriv(i,2,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR% &
10247 IF(numberofdimensions > 2)
THEN 10248 velocityderiv(i,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR%VALUES(i,
part_deriv_s3)
10249 IF(.NOT. linearelement)
THEN 10250 velocity2deriv(i,1,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR% &
10252 velocity2deriv(i,2,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR% &
10254 velocity2deriv(i,3,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR% &
10256 velocity2deriv(i,3,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR% &
10258 velocity2deriv(i,3,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR% &
10263 pressureindex = numberofdimensions + 1
10264 pressure=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)%PTR%VALUES(pressureindex,
no_part_deriv)
10265 pressurederiv(1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)% &
10267 pressurederiv(2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)% &
10269 IF(numberofdimensions > 2)
THEN 10270 pressurederiv(3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(fieldvariabletype)% &
10274 DO i=1,numberofdimensions
10275 DO j=1,numberofdimensions
10276 dxi_dx(j,i)=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR% &
10282 numberofelementparameters=0
10283 DO i=1,numberofdimensions
10284 numberofelementparameters(i)=basisvelocity%NUMBER_OF_ELEMENT_PARAMETERS
10286 numberofelementparameters(numberofdimensions+1)=basispressure%NUMBER_OF_ELEMENT_PARAMETERS
10288 dphi_dx_velocity=0.0_dp
10289 dphi_dx_pressure=0.0_dp
10290 DO ms=1,numberofelementparameters(1)
10291 DO nj=1,numberofdimensions
10292 dphi_dx_velocity(ms,nj)=0.0_dp
10293 DO ni=1,numberofdimensions
10294 dphi_dx_velocity(ms,nj)=dphi_dx_velocity(ms,nj) + &
10300 DO ms=1,numberofelementparameters(numberofdimensions+1)
10301 DO nj=1,numberofdimensions
10302 dphi_dx_pressure(ms,nj)=0.0_dp
10303 DO ni=1,numberofdimensions
10304 dphi_dx_pressure(ms,nj)=dphi_dx_pressure(ms,nj) + &
10310 jgw=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
10311 & quadraturevelocity%GAUSS_WEIGHTS(gaussnumber)
10317 residualmomentum = 0.0_dp
10318 residualcontinuity = 0.0_dp
10320 DO i=1,numberofdimensions
10324 sum = rho*(velocity(i)-velocityprevious(i))/timeincrement
10326 DO j=1,numberofdimensions
10328 sum = sum + pressurederiv(j)*dxi_dx(j,i)
10329 DO k=1,numberofdimensions
10331 sum = sum +rho*((velocity(j))*(velocityderiv(i,k)*dxi_dx(k,j)))
10332 IF(.NOT. linearelement)
THEN 10333 DO l=1,numberofdimensions
10335 sum = sum - mu*(velocity2deriv(i,k,l)*dxi_dx(k,j)*dxi_dx(l,j))
10340 residualmomentum(i) = sum
10344 DO i=1,numberofdimensions
10345 DO j=1,numberofdimensions
10346 sum= sum + velocityderiv(i,j)*dxi_dx(j,i)
10349 residualcontinuity = sum
10354 c1 = elementinverse
10355 ELSE IF(linearelement)
THEN 10358 IF(numberofdimensions==2 .AND. basisvelocity%NUMBER_OF_ELEMENT_PARAMETERS==9 &
10359 & .AND. basisvelocity%INTERPOLATION_ORDER(1)==2)
THEN 10361 ELSE IF(numberofdimensions==3 .AND. basisvelocity%NUMBER_OF_ELEMENT_PARAMETERS==27 &
10362 & .AND. basisvelocity%INTERPOLATION_ORDER(1)==2)
THEN 10366 CALL flagerror(
"Element inverse estimate undefined on element " &
10372 CALL field_parameter_set_update_local_element(equationssetfield,field_v_variable_type,field_values_set_type, &
10373 & elementnumber,10,c1,err,error,*999)
10379 IF(stabilisationtype == 1 .OR. stabilisationtype == 2)
THEN 10381 pointmetrics=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR
10383 DO i=1,numberofdimensions
10384 DO j=1,numberofdimensions
10385 udotgu = udotgu + velocity(i)*pointmetrics%GU(i,j)*velocity(j)
10388 doubledotg = 0.0_dp
10389 DO i=1,numberofdimensions
10390 DO j=1,numberofdimensions
10391 doubledotg = doubledotg + pointmetrics%GU(i,j)*pointmetrics%GU(i,j)
10396 tausups = (udotgu + (c1*((mu/rho)**2.0_dp)*doubledotg))**(-0.5_dp)
10398 tausups = ((4.0_dp/(timeincrement**2.0_dp)) + udotgu + (c1*((mu/rho)**2.0_dp)*doubledotg))**(-0.5_dp)
10403 DO i=1,numberofdimensions
10404 traceg = traceg + pointmetrics%GU(i,i)
10406 nulsic = 1.0_dp/(tausups*traceg)
10413 CALL flagerror(
"A tau factor has not been defined for the stabilisation type of " &
10420 jacobianmomentum = 0.0_dp
10421 jacobiancontinuity = 0.0_dp
10423 DO mh=1,numberofdimensions+1
10424 DO ms=1,numberofelementparameters(mh)
10426 IF(mh <= numberofdimensions)
THEN 10427 phims=quadraturevelocity%GAUSS_BASIS_FNS(ms,
no_part_deriv,gaussnumber)
10428 jgw=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
10429 & quadraturevelocity%GAUSS_WEIGHTS(gaussnumber)
10431 phims=quadraturepressure%GAUSS_BASIS_FNS(ms,
no_part_deriv,gaussnumber)
10432 jgw=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
10433 & quadraturepressure%GAUSS_WEIGHTS(gaussnumber)
10438 IF(jacobianflag)
THEN 10440 DO nh=1,numberofdimensions+1
10441 DO ns=1,numberofelementparameters(nh)
10444 IF(nh <= numberofdimensions)
THEN 10445 phins=quadraturevelocity%GAUSS_BASIS_FNS(ns,
no_part_deriv,gaussnumber)
10447 phins=quadraturepressure%GAUSS_BASIS_FNS(ns,
no_part_deriv,gaussnumber)
10451 jacobianmomentum = 0.0_dp
10452 IF(nh == numberofdimensions+1)
THEN 10454 DO i=1,numberofdimensions
10455 jacobianmomentum(i) = dphi_dx_pressure(ns,i)
10457 jacobiancontinuity=0.0_dp
10460 IF(.NOT. linearelement)
THEN 10461 dphins2_dxi(1,1)=quadraturevelocity%GAUSS_BASIS_FNS(ns,
part_deriv_s1_s1,gaussnumber)
10462 dphins2_dxi(1,2)=quadraturevelocity%GAUSS_BASIS_FNS(ns,
part_deriv_s1_s2,gaussnumber)
10463 dphins2_dxi(2,1)=quadraturevelocity%GAUSS_BASIS_FNS(ns,
part_deriv_s1_s2,gaussnumber)
10464 dphins2_dxi(2,2)=quadraturevelocity%GAUSS_BASIS_FNS(ns,
part_deriv_s2_s2,gaussnumber)
10465 IF(numberofdimensions > 2)
THEN 10466 dphins2_dxi(1,3)=quadraturevelocity%GAUSS_BASIS_FNS(ns,
part_deriv_s1_s3,gaussnumber)
10467 dphins2_dxi(2,3)=quadraturevelocity%GAUSS_BASIS_FNS(ns,
part_deriv_s2_s3,gaussnumber)
10468 dphins2_dxi(3,1)=quadraturevelocity%GAUSS_BASIS_FNS(ns,
part_deriv_s1_s3,gaussnumber)
10469 dphins2_dxi(3,2)=quadraturevelocity%GAUSS_BASIS_FNS(ns,
part_deriv_s2_s3,gaussnumber)
10470 dphins2_dxi(3,3)=quadraturevelocity%GAUSS_BASIS_FNS(ns,
part_deriv_s3_s3,gaussnumber)
10474 jacobianmomentum = 0.0_dp
10475 DO i=1,numberofdimensions
10479 DO j=1,numberofdimensions
10480 sum = sum + rho*phins*velocityderiv(i,j)*dxi_dx(j,nh)
10486 sum = sum + rho*phins/timeincrement
10489 DO j=1,numberofdimensions
10490 sum = sum + rho*velocity(j)*dphi_dx_velocity(ns,j)
10492 IF(.NOT. linearelement)
THEN 10494 DO j=1,numberofdimensions
10495 DO k=1,numberofdimensions
10496 DO l=1,numberofdimensions
10497 sum=sum-mu*dphins2_dxi(k,l)*dxi_dx(k,j)*dxi_dx(l,j)
10503 jacobianmomentum(i)=sum
10506 jacobiancontinuity = dphi_dx_velocity(ns,nh)
10511 IF(mh == numberofdimensions+1)
THEN 10514 DO i=1,numberofdimensions
10515 sum = sum + dphi_dx_pressure(ms,i)*jacobianmomentum(i)
10517 pspg = taump*sum/rho*jgw
10519 jacobianmatrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)=jacobianmatrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)+pspg
10528 IF(nh <= numberofdimensions)
THEN 10529 supg= supg + phins*dphi_dx_velocity(ms,nh)*residualmomentum(mh)
10531 DO i=1,numberofdimensions
10532 sum = sum + velocity(i)*dphi_dx_velocity(ms,i)
10534 supg = taumu*(supg + sum*jacobianmomentum(mh))
10537 DO i=1,numberofdimensions
10538 sum = sum + dphi_dx_velocity(ms,i)
10540 lsic = tauc*rho*dphi_dx_velocity(ms,mh)*jacobiancontinuity
10542 momentumterm = (supg + lsic)*jgw
10544 IF(stabilisationtype == 2)
THEN 10547 reynoldsstress=0.0_dp
10548 crossstress = 0.0_dp
10549 IF(nh <= numberofdimensions)
THEN 10551 DO i=1,numberofdimensions
10552 crossstress= crossstress + dphi_dx_velocity(ns,i)*residualmomentum(i)
10557 DO i=1,numberofdimensions
10560 DO j=1,numberofdimensions
10561 sum= sum + velocityderiv(mh,j)*dxi_dx(j,i)
10564 sum2 = sum2 + jacobianmomentum(i)*sum
10566 crossstress = -taumu*(crossstress + sum2)
10568 reynoldsstress = 0.0_dp
10571 DO i=1,numberofdimensions
10572 sum = sum + jacobianmomentum(mh)*residualmomentum(i)*dphi_dx_velocity(ms,i)
10573 sum = sum + jacobianmomentum(i)*residualmomentum(mh)*dphi_dx_velocity(ms,i)
10575 reynoldsstress = -taumu*taumu*sum
10577 momentumterm = momentumterm + (crossstress + reynoldsstress)*jgw
10581 jacobianmatrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)= &
10582 & jacobianmatrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)+momentumterm
10593 IF(mh == numberofdimensions+1)
THEN 10595 DO i=1,numberofdimensions
10596 sum = sum + dphi_dx_pressure(ms,i)*residualmomentum(i)
10598 pspg = sum*(taump/rho)*jgw
10599 nonlinearmatrices%ELEMENT_RESIDUAL%VECTOR(mhs)= &
10600 & nonlinearmatrices%ELEMENT_RESIDUAL%VECTOR(mhs) + pspg
10610 DO i=1,numberofdimensions
10611 sum = sum + velocity(i)*dphi_dx_velocity(ms,i)
10613 supg = taumu*sum*residualmomentum(mh)
10615 lsic = tauc*rho*dphi_dx_velocity(ms,mh)*residualcontinuity
10616 momentumterm = (supg + lsic)*jgw
10618 IF(stabilisationtype ==2)
THEN 10621 reynoldsstress=0.0_dp
10623 DO i=1,numberofdimensions
10626 DO j=1,numberofdimensions
10627 sum= sum + velocityderiv(mh,j)*dxi_dx(j,i)
10630 sum2= sum2 + residualmomentum(i)*sum
10632 crossstress= -taumu*phims*sum2
10634 reynoldsstress = 0.0_dp
10637 DO i=1,numberofdimensions
10638 sum = sum + dphi_dx_velocity(ms,i)*residualmomentum(i)*residualmomentum(mh)
10640 reynoldsstress = -sum*(taumu*taumu)/rho
10641 momentumterm = momentumterm + (crossstress + reynoldsstress)*jgw
10645 nonlinearmatrices%ELEMENT_RESIDUAL%VECTOR(mhs)= &
10646 & nonlinearmatrices%ELEMENT_RESIDUAL%VECTOR(mhs) + momentumterm
10654 CALL flagerror(
"Equations equations set field is not associated.",err,error,*999)
10657 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
10660 localerror=
"Equations set subtype "//
trim(
number_to_vstring(equationsset%specification(3),
"*",err,error))// &
10661 &
" is not a valid subtype to use SUPG weighting functions." 10662 CALL flagerror(localerror,err,error,*999)
10665 CALL flagerror(
"Equations set is not associated.",err,error,*999)
10668 exits(
"NavierStokes_ResidualBasedStabilisation")
10670 999 errorsexits(
"NavierStokes_ResidualBasedStabilisation",err,error)
10673 END SUBROUTINE navierstokes_residualbasedstabilisation
10680 SUBROUTINE navierstokes_calculateelementmetrics(equationsSet,elementNumber,err,error,*)
10684 INTEGER(INTG),
INTENT(IN) :: elementNumber
10685 INTEGER(INTG),
INTENT(OUT) :: err
10694 TYPE(
field_type),
POINTER :: equationsSetField
10696 TYPE(
field_type),
POINTER :: dependentField,geometricField
10699 INTEGER(INTG) :: fieldVariableType,meshComponent1
10700 INTEGER(INTG) :: numberOfDimensions,mh
10701 INTEGER(INTG) :: gaussNumber
10702 INTEGER(INTG) :: i,j,ms
10703 INTEGER(INTG) :: numberOfElementParameters
10704 INTEGER(INTG) :: LWORK,INFO
10705 REAL(DP) :: cellReynoldsNumber,cellCourantNumber,timeIncrement
10706 REAL(DP) :: dPhi_dX_Velocity(27,3)
10707 REAL(DP) :: DXI_DX(3,3)
10708 REAL(DP) :: velocity(3),avgVelocity(3),velocityNorm,velocityPrevious(3),velocityDeriv(3,3)
10709 REAL(DP) :: PHIMS,JGW,SUM,SUM2,mu,rho,normCMatrix,normKMatrix,normMMatrix,muScale
10710 REAL(DP) :: CMatrix(27,3),KMatrix(27,3),MMatrix(27,3)
10711 REAL(DP) :: svd(3),U(27,27),VT(3,3)
10712 REAL(DP),
ALLOCATABLE :: WORK(:)
10715 enters(
"NavierStokes_CalculateElementMetrics",err,error,*999)
10718 NULLIFY(basisvelocity)
10720 NULLIFY(equationsmapping)
10721 NULLIFY(nonlinearmapping)
10722 NULLIFY(equationsequationssetfield)
10723 NULLIFY(equationssetfield)
10724 NULLIFY(quadraturevelocity)
10725 NULLIFY(dependentfield)
10726 NULLIFY(geometricfield)
10727 NULLIFY(fieldvariable)
10729 IF(
ASSOCIATED(equationsset))
THEN 10730 SELECT CASE(equationsset%specification(3))
10734 equations=>equationsset%EQUATIONS
10735 IF(
ASSOCIATED(equations))
THEN 10737 equationsmapping=>equations%EQUATIONS_MAPPING
10738 nonlinearmapping=>equationsmapping%NONLINEAR_MAPPING
10739 fieldvariable=>nonlinearmapping%RESIDUAL_VARIABLES(1)%PTR
10740 fieldvariabletype=fieldvariable%VARIABLE_TYPE
10741 geometricfield=>equations%INTERPOLATION%GEOMETRIC_FIELD
10742 numberofdimensions=fieldvariable%NUMBER_OF_COMPONENTS - 1
10743 equationsequationssetfield=>equationsset%EQUATIONS_SET_FIELD
10744 meshcomponent1=fieldvariable%COMPONENTS(1)%MESH_COMPONENT_NUMBER
10745 dependentfield=>equations%INTERPOLATION%DEPENDENT_FIELD
10746 basisvelocity=>dependentfield%DECOMPOSITION%DOMAIN(meshcomponent1)%PTR% &
10747 & topology%ELEMENTS%ELEMENTS(elementnumber)%BASIS
10750 IF(
ASSOCIATED(equationsequationssetfield))
THEN 10751 equationssetfield=>equationsequationssetfield%EQUATIONS_SET_FIELD_FIELD
10752 IF(
ASSOCIATED(equationssetfield))
THEN 10755 CALL field_parameter_set_get_constant(equationssetfield,field_u1_variable_type,field_values_set_type, &
10756 & 3,timeincrement,err,error,*999)
10762 CALL field_interpolation_parameters_element_get(field_values_set_type,elementnumber,equations%INTERPOLATION% &
10763 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
10764 CALL field_parameter_set_get_constant(equationsset%MATERIALS%MATERIALS_FIELD,field_u_variable_type, &
10765 & field_values_set_type,1,mu,err,error,*999)
10766 CALL field_parameter_set_get_constant(equationsset%MATERIALS%MATERIALS_FIELD,field_u_variable_type, &
10767 & field_values_set_type,2,rho,err,error,*999)
10769 avgvelocity = 0.0_dp
10770 DO gaussnumber = 1,quadraturevelocity%NUMBER_OF_GAUSS
10777 CALL field_parametersetgetlocalgausspoint(equationsset%MATERIALS%MATERIALS_FIELD,field_v_variable_type, &
10778 & field_values_set_type,gaussnumber,elementnumber,1,mu,err,error,*999)
10783 velocityprevious=0.0_dp
10784 CALL field_interpolation_parameters_element_get(field_previous_values_set_type,elementnumber,equations% &
10785 & interpolation%DEPENDENT_INTERP_PARAMETERS(field_u_variable_type)%PTR,err,error,*999)
10787 & dependent_interp_point(field_u_variable_type)%PTR,err,error,*999)
10788 velocityprevious=0.0_dp
10789 DO i=1,numberofdimensions
10790 velocityprevious(i)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR% &
10795 CALL field_interpolation_parameters_element_get(field_values_set_type,elementnumber, &
10796 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_u_variable_type)%PTR,err,error,*999)
10799 & equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR,err,error,*999)
10801 velocityderiv=0.0_dp
10802 DO i=1,numberofdimensions
10803 velocity(i)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(i,
no_part_deriv)
10804 velocityderiv(i,1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)% &
10806 velocityderiv(i,2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)% &
10808 IF(numberofdimensions > 2)
THEN 10809 velocityderiv(i,3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)% &
10816 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
10818 DO i=1,numberofdimensions
10819 DO j=1,numberofdimensions
10820 dxi_dx(j,i)=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR% &
10825 numberofelementparameters=basisvelocity%NUMBER_OF_ELEMENT_PARAMETERS
10827 dphi_dx_velocity=0.0_dp
10828 DO ms=1,numberofelementparameters
10829 DO i=1,numberofdimensions
10830 dphi_dx_velocity(ms,i)=0.0_dp
10831 DO j=1,numberofdimensions
10832 dphi_dx_velocity(ms,i)=dphi_dx_velocity(ms,i) + &
10839 jgw=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
10840 & quadraturevelocity%GAUSS_WEIGHTS(gaussnumber)
10841 DO mh=1,numberofdimensions
10842 DO ms=1,numberofelementparameters
10843 phims=quadraturevelocity%GAUSS_BASIS_FNS(ms,
no_part_deriv,gaussnumber)
10847 DO i=1,numberofdimensions
10848 DO j=1,numberofdimensions
10849 sum = sum + velocity(i)*velocityderiv(mh,j)*dxi_dx(j,i)
10852 cmatrix(ms,mh)=cmatrix(ms,mh) + rho*phims*sum*jgw
10856 DO i=1,numberofdimensions
10857 sum = sum + velocity(i)*dphi_dx_velocity(ms,i)
10860 DO i=1,numberofdimensions
10861 DO j=1,numberofdimensions
10862 sum2 = sum2 + velocity(i)*velocityderiv(mh,j)*dxi_dx(j,i)
10865 kmatrix(ms,mh)=kmatrix(ms,mh)+rho*sum*sum2*jgw
10868 mmatrix(ms,mh)=mmatrix(ms,mh)+rho*phims*(velocity(mh)-velocityprevious(mh))/timeincrement*jgw
10873 avgvelocity= avgvelocity + velocity/quadraturevelocity%NUMBER_OF_GAUSS
10876 lwork=max(1,3*min(numberofelementparameters,numberofdimensions)+ &
10877 & max(numberofelementparameters,numberofdimensions),5*min(numberofelementparameters,numberofdimensions))
10878 ALLOCATE(work(lwork))
10881 CALL dgesvd(
'A',
'A',numberofelementparameters,numberofdimensions,cmatrix,numberofelementparameters,svd, &
10882 & u,numberofelementparameters,vt,numberofdimensions,work,lwork,info)
10885 localerror=
"Error calculating SVD on element "//
trim(
number_to_vstring(elementnumber,
"*",err,error))//
"." 10886 CALL flagerror(localerror,err,error,*999)
10889 CALL dgesvd(
'A',
'A',numberofelementparameters,numberofdimensions,kmatrix,numberofelementparameters,svd, &
10890 & u,numberofelementparameters,vt,numberofdimensions,work,lwork,info)
10893 localerror=
"Error calculating SVD on element "//
trim(
number_to_vstring(elementnumber,
"*",err,error))//
"." 10894 CALL flagerror(localerror,err,error,*999)
10897 CALL dgesvd(
'A',
'A',numberofelementparameters,numberofdimensions,mmatrix,numberofelementparameters,svd, &
10898 & u,numberofelementparameters,vt,numberofdimensions,work,lwork,info)
10901 localerror=
"Error calculating SVD on element "//
trim(
number_to_vstring(elementnumber,
"*",err,error))//
"." 10902 CALL flagerror(localerror,err,error,*999)
10906 velocitynorm =
l2norm(avgvelocity)
10907 cellreynoldsnumber = 0.0_dp
10908 cellcourantnumber = 0.0_dp
10911 cellreynoldsnumber = velocitynorm**2.0_dp/(mu/rho)*normcmatrix/normkmatrix
10914 cellcourantnumber = timeincrement/2.0_dp*normcmatrix/normmmatrix
10917 CALL field_parameter_set_update_local_element(equationssetfield,field_v_variable_type,field_values_set_type, &
10918 & elementnumber,2,velocitynorm,err,error,*999)
10919 CALL field_parameter_set_update_local_element(equationssetfield,field_v_variable_type,field_values_set_type, &
10920 & elementnumber,3,cellcourantnumber,err,error,*999)
10921 CALL field_parameter_set_update_local_element(equationssetfield,field_v_variable_type,field_values_set_type, &
10922 & elementnumber,4,cellreynoldsnumber,err,error,*999)
10925 CALL flagerror(
"Equations set field field is not associated.",err,error,*999)
10928 CALL flagerror(
"Equations equations set field is not associated.",err,error,*999)
10931 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
10934 localerror=
"Equations set subtype "//
trim(
number_to_vstring(equationsset%specification(3),
"*",err,error))// &
10935 &
" is not a valid subtype to use SUPG weighting functions." 10936 CALL flagerror(localerror,err,error,*999)
10939 CALL flagerror(
"Equations set is not associated.",err,error,*999)
10942 exits(
"NavierStokes_CalculateElementMetrics")
10944 999 errorsexits(
"NavierStokes_CalculateElementMetrics",err,error)
10947 END SUBROUTINE navierstokes_calculateelementmetrics
10956 SUBROUTINE navierstokes_finiteelementfaceintegrate(equationsSet,elementNumber,dependentVariable,err,error,*)
10960 INTEGER(INTG),
INTENT(IN) :: elementNumber
10962 INTEGER(INTG),
INTENT(OUT) :: err
10967 TYPE(
field_type),
POINTER :: equationsSetField
10985 INTEGER(INTG) :: faceIdx, faceNumber
10986 INTEGER(INTG) :: componentIdx, gaussIdx
10987 INTEGER(INTG) :: elementBaseDofIdx, faceNodeIdx, elementNodeIdx
10988 INTEGER(INTG) :: faceNodeDerivativeIdx, meshComponentNumber, nodeDerivativeIdx,elementParameterIdx
10989 INTEGER(INTG) :: faceParameterIdx,elementDof,normalComponentIdx
10990 INTEGER(INTG) :: numberOfDimensions,boundaryType
10991 REAL(DP) :: pressure,density,jacobianGaussWeights,beta,normalFlow
10992 REAL(DP) :: velocity(3),normalProjection(3),unitNormal(3),stabilisationTerm(3),boundaryNormal(3)
10993 REAL(DP) :: boundaryValue,normalDifference,normalTolerance,boundaryPressure
10994 REAL(DP) :: dUDXi(3,3)
10996 LOGICAL :: integratedBoundary
10998 REAL(DP),
POINTER :: geometricParameters(:)
11000 enters(
"NavierStokes_FiniteElementFaceIntegrate",err,error,*999)
11002 NULLIFY(decomposition)
11003 NULLIFY(decompelement)
11004 NULLIFY(dependentbasis)
11005 NULLIFY(geometricvariable)
11006 NULLIFY(geometricparameters)
11008 NULLIFY(equationssetfield)
11009 NULLIFY(equationsequationssetfield)
11010 NULLIFY(equationsmatrices)
11013 NULLIFY(facequadraturescheme)
11014 NULLIFY(dependentinterpolatedpoint)
11015 NULLIFY(dependentinterpolationparameters)
11016 NULLIFY(geometricinterpolatedpoint)
11017 NULLIFY(geometricinterpolationparameters)
11019 NULLIFY(nonlinearmatrices)
11020 NULLIFY(dependentfield)
11021 NULLIFY(geometricfield)
11024 IF(
ASSOCIATED(equationsset))
THEN 11025 dependentfield=>equationsset%DEPENDENT%DEPENDENT_FIELD
11026 IF(.NOT.
ASSOCIATED(dependentfield))
THEN 11027 CALL flagerror(
"Dependent field is not associated.",err,error,*999)
11029 equations=>equationsset%EQUATIONS
11030 IF(
ASSOCIATED(equations))
THEN 11031 equationsmatrices=>equations%EQUATIONS_MATRICES
11032 IF(
ASSOCIATED(equationsmatrices))
THEN 11033 rhsvector=>equationsmatrices%RHS_VECTOR
11034 nonlinearmatrices=>equationsmatrices%NONLINEAR_MATRICES
11035 IF(.NOT.
ASSOCIATED(nonlinearmatrices))
THEN 11036 CALL flagerror(
"Nonlinear Matrices not associated.",err,error,*999)
11040 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
11043 CALL flagerror(
"Equations set is not associated.",err,error,*999)
11046 SELECT CASE(equationsset%specification(3))
11053 equationsequationssetfield=>equationsset%EQUATIONS_SET_FIELD
11054 IF(
ASSOCIATED(equationsequationssetfield))
THEN 11055 equationssetfield=>equationsequationssetfield%EQUATIONS_SET_FIELD_FIELD
11056 IF(.NOT.
ASSOCIATED(equationssetfield))
THEN 11057 CALL flagerror(
"Equations set field (EQUATIONS_SET_FIELD_FIELD) is not associated.",err,error,*999)
11060 CALL flagerror(
"Equations set field (EQUATIONS_EQUATIONS_SET_FIELD_FIELD) is not associated.",err,error,*999)
11064 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11065 & elementnumber,9,boundaryvalue,err,error,*999)
11066 boundarytype=nint(boundaryvalue)
11067 integratedboundary = .false.
11071 decomposition=>dependentvariable%FIELD%DECOMPOSITION
11073 IF(decomposition%CALCULATE_FACES .AND. integratedboundary)
THEN 11074 meshcomponentnumber=dependentvariable%COMPONENTS(1)%MESH_COMPONENT_NUMBER
11075 dependentbasis=>decomposition%DOMAIN(meshcomponentnumber)%PTR%TOPOLOGY%ELEMENTS% &
11076 & elements(elementnumber)%BASIS
11078 decompelement=>decomposition%TOPOLOGY%ELEMENTS%ELEMENTS(elementnumber)
11080 dependentinterpolationparameters=>equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS( &
11081 & dependentvariable%VARIABLE_TYPE)%PTR
11082 dependentinterpolatedpoint=>equations%INTERPOLATION%DEPENDENT_INTERP_POINT( &
11083 & dependentvariable%VARIABLE_TYPE)%PTR
11085 geometricinterpolationparameters=>equations%INTERPOLATION%GEOMETRIC_INTERP_PARAMETERS( &
11086 & field_u_variable_type)%PTR
11087 geometricinterpolatedpoint=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR
11088 geometricfield=>equationsset%GEOMETRY%GEOMETRIC_FIELD
11089 CALL field_number_of_components_get(geometricfield,field_u_variable_type,numberofdimensions,err,error,*999)
11091 CALL field_variable_get(geometricfield,field_u_variable_type,geometricvariable,err,error,*999)
11092 meshcomponentnumber=geometricvariable%COMPONENTS(1)%MESH_COMPONENT_NUMBER
11094 CALL field_parameter_set_data_get(geometricfield,field_u_variable_type,field_values_set_type, &
11095 & geometricparameters,err,error,*999)
11096 fieldvariable=>equations%EQUATIONS_MAPPING%NONLINEAR_MAPPING%RESIDUAL_VARIABLES(1)%PTR
11098 CALL field_parameter_set_get_constant(equationsset%MATERIALS%MATERIALS_FIELD,field_u_variable_type,field_values_set_type, &
11099 & 2,density,err,error,*999)
11102 CALL field_parameter_set_get_constant(equationssetfield,field_u1_variable_type,field_values_set_type, &
11103 & 1,beta,err,error,*999)
11104 boundarynormal = 0.0_dp
11105 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11106 & elementnumber,5,boundarynormal(1),err,error,*999)
11107 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11108 & elementnumber,6,boundarynormal(2),err,error,*999)
11109 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11110 & elementnumber,7,boundarynormal(3),err,error,*999)
11112 DO faceidx=1,dependentbasis%NUMBER_OF_LOCAL_FACES
11114 IF(
ALLOCATED(decompelement%ELEMENT_FACES))
THEN 11115 facenumber=decompelement%ELEMENT_FACES(faceidx)
11117 CALL flagerror(
"Decomposition element faces is not allocated.",err,error,*999)
11119 face=>decomposition%TOPOLOGY%FACES%FACES(facenumber)
11122 IF(.NOT.(face%BOUNDARY_FACE)) cycle
11124 SELECT CASE(dependentbasis%TYPE)
11126 normalcomponentidx=abs(face%XI_DIRECTION)
11128 local_error=
"Face integration for basis type "//
trim(
number_to_vstring(dependentbasis%TYPE,
"*",err,error))// &
11129 &
" is not yet implemented for Navier-Stokes." 11130 CALL flagerror(local_error,err,error,*999)
11133 facebasis=>decomposition%DOMAIN(meshcomponentnumber)%PTR%TOPOLOGY%FACES%FACES(facenumber)%BASIS
11135 DO gaussidx=1,facequadraturescheme%NUMBER_OF_GAUSS
11138 & geometricinterpolatedpoint,err,error,*999)
11140 pointmetrics=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR
11145 DO componentidx=1,dependentvariable%NUMBER_OF_COMPONENTS-1
11146 normalprojection(componentidx)=dot_product(pointmetrics%GU(normalcomponentidx,:),pointmetrics%DX_DXI(componentidx,:))
11147 IF(face%XI_DIRECTION<0)
THEN 11148 normalprojection(componentidx)=-normalprojection(componentidx)
11152 unitnormal=normalprojection/
l2norm(normalprojection)
11161 stabilisationterm = 0.0_dp
11162 normaldifference=
l2norm(boundarynormal-unitnormal)
11163 normaltolerance=0.1_dp
11164 IF(normaldifference < normaltolerance)
THEN 11165 normalflow = dot_product(velocity,normalprojection)
11168 DO componentidx=1,dependentvariable%NUMBER_OF_COMPONENTS-1
11169 stabilisationterm(componentidx) = 0.5_dp*beta*density*velocity(componentidx)*(normalflow - abs(normalflow))
11172 stabilisationterm = 0.0_dp
11180 boundarypressure=0.0_dp
11182 CALL field_interpolation_parameters_element_get(field_pressure_values_set_type,elementnumber,equations% &
11183 & interpolation%DEPENDENT_INTERP_PARAMETERS(field_u_variable_type)%PTR,err,error,*999)
11185 & dependentinterpolatedpoint,err,error,*999)
11186 boundarypressure=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(4,
no_part_deriv)
11192 CALL field_interpolation_parameters_element_get(field_values_set_type,elementnumber,equations%INTERPOLATION% &
11193 & dependent_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
11196 & dependentinterpolatedpoint,err,error,*999)
11197 velocity(1)=dependentinterpolatedpoint%values(1,
no_part_deriv)
11198 velocity(2)=dependentinterpolatedpoint%values(2,
no_part_deriv)
11199 velocity(3)=dependentinterpolatedpoint%values(3,
no_part_deriv)
11200 dudxi(1:3,1)=dependentinterpolatedpoint%VALUES(1:3,
part_deriv_s1)
11201 dudxi(1:3,2)=dependentinterpolatedpoint%VALUES(1:3,
part_deriv_s2)
11202 dudxi(1:3,3)=dependentinterpolatedpoint%VALUES(1:3,
part_deriv_s3)
11203 pressure=dependentinterpolatedpoint%values(4,
no_part_deriv)
11221 jacobiangaussweights=pointmetrics%JACOBIAN*facequadraturescheme%GAUSS_WEIGHTS(gaussidx)
11224 DO componentidx=1,dependentvariable%NUMBER_OF_COMPONENTS-1
11226 elementbasedofidx=dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS*(componentidx-1)
11227 DO facenodeidx=1,facebasis%NUMBER_OF_NODES
11228 elementnodeidx=dependentbasis%NODE_NUMBERS_IN_LOCAL_FACE(facenodeidx,faceidx)
11229 DO facenodederivativeidx=1,facebasis%NUMBER_OF_DERIVATIVES(facenodeidx)
11230 nodederivativeidx=dependentbasis%DERIVATIVE_NUMBERS_IN_LOCAL_FACE(facenodederivativeidx,facenodeidx,faceidx)
11231 elementparameteridx=dependentbasis%ELEMENT_PARAMETER_INDEX(nodederivativeidx,elementnodeidx)
11232 faceparameteridx=facebasis%ELEMENT_PARAMETER_INDEX(facenodederivativeidx,facenodeidx)
11233 elementdof=elementbasedofidx+elementparameteridx
11235 rhsvector%ELEMENT_VECTOR%VECTOR(elementdof) = rhsvector%ELEMENT_VECTOR%VECTOR(elementdof) - &
11236 & (boundarypressure*normalprojection(componentidx) - stabilisationterm(componentidx))* &
11237 & facequadraturescheme%GAUSS_BASIS_FNS(faceparameteridx,
no_part_deriv,gaussidx)* &
11238 & jacobiangaussweights
11247 CALL field_parameter_set_data_restore(geometricfield,field_u_variable_type,field_values_set_type, &
11248 & geometricparameters,err,error,*999)
11255 exits(
"NavierStokes_FiniteElementFaceIntegrate")
11257 999 errorsexits(
"NavierStokes_FiniteElementFaceIntegrate",err,error)
11266 SUBROUTINE navierstokes_calculateboundaryflux(solver,err,error,*)
11271 INTEGER(INTG),
INTENT(OUT) :: err
11289 TYPE(
basis_type),
POINTER :: dependentBasis2
11290 TYPE(
basis_type),
POINTER :: geometricFaceBasis
11301 TYPE(
field_type),
POINTER :: equationsSetField
11304 INTEGER(INTG) :: faceIdx, faceNumber,elementIdx,nodeNumber,versionNumber
11305 INTEGER(INTG) :: componentIdx,gaussIdx
11306 INTEGER(INTG) :: elementBaseDofIdx, faceNodeIdx, elementNodeIdx
11307 INTEGER(INTG) :: faceNodeDerivativeIdx, meshComponentNumber, nodeDerivativeIdx, parameterIdx
11308 INTEGER(INTG) :: faceParameterIdx, elementDofIdx,normalComponentIdx
11309 INTEGER(INTG) :: boundaryID
11310 INTEGER(INTG) :: MPI_IERROR,numberOfComputationalNodes
11311 REAL(DP) :: gaussWeight, normalProjection,elementNormal(3)
11312 REAL(DP) :: normalDifference,normalTolerance,faceFlux
11313 REAL(DP) :: courant,maxCourant,toleranceCourant
11314 REAL(DP) :: velocityGauss(3),faceNormal(3),unitNormal(3),boundaryValue,faceArea,faceVelocity
11315 REAL(DP) :: localBoundaryFlux(10),localBoundaryArea(10),globalBoundaryFlux(10),globalBoundaryArea(10)
11316 LOGICAL :: correctFace
11318 REAL(DP),
POINTER :: geometricParameters(:)
11320 enters(
"NavierStokes_CalculateBoundaryFlux",err,error,*999)
11322 NULLIFY(decomposition)
11323 NULLIFY(geometricdecomposition)
11324 NULLIFY(geometricparameters)
11325 NULLIFY(decompelement)
11326 NULLIFY(dependentbasis)
11327 NULLIFY(dependentbasis2)
11328 NULLIFY(geometricfacebasis)
11329 NULLIFY(geometricvariable)
11331 NULLIFY(equationsmatrices)
11334 NULLIFY(facequadraturescheme)
11335 NULLIFY(fieldvariable)
11336 NULLIFY(dependentinterpolatedpoint)
11337 NULLIFY(dependentinterpolationparameters)
11338 NULLIFY(geometricinterpolatedpoint)
11339 NULLIFY(geometricinterpolationparameters)
11341 NULLIFY(dependentfield)
11342 NULLIFY(geometricfield)
11343 NULLIFY(equationsequationssetfield)
11344 NULLIFY(equationssetfield)
11347 IF(
ASSOCIATED(solver))
THEN 11348 solvers=>solver%SOLVERS
11349 IF(
ASSOCIATED(solvers))
THEN 11350 controlloop=>solvers%CONTROL_LOOP
11351 IF(
ASSOCIATED(controlloop%PROBLEM))
THEN 11352 SELECT CASE(controlloop%PROBLEM%specification(3))
11355 solverequations=>solver%SOLVER_EQUATIONS
11356 IF(
ASSOCIATED(solverequations))
THEN 11357 solvermapping=>solverequations%SOLVER_MAPPING
11358 IF(
ASSOCIATED(solvermapping))
THEN 11359 equationsset=>solvermapping%EQUATIONS_SETS(1)%PTR
11360 IF(
ASSOCIATED(equationsset))
THEN 11361 equations=>equationsset%EQUATIONS
11362 IF(
ASSOCIATED(equations))
THEN 11363 dependentfield=>equationsset%DEPENDENT%DEPENDENT_FIELD
11364 IF(.NOT.
ASSOCIATED(dependentfield))
THEN 11365 CALL flagerror(
"Dependent field is not associated.",err,error,*999)
11368 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
11371 CALL flagerror(
"Equations set is not associated.",err,error,*999)
11373 equationsequationssetfield=>equationsset%EQUATIONS_SET_FIELD
11374 IF(
ASSOCIATED(equationsequationssetfield))
THEN 11375 equationssetfield=>equationsequationssetfield%EQUATIONS_SET_FIELD_FIELD
11376 IF(.NOT.
ASSOCIATED(equationssetfield))
THEN 11377 CALL flagerror(
"Equations set field (EQUATIONS_SET_FIELD_FIELD) is not associated.",err,error,*999)
11380 CALL flagerror(
"Equations set field (EQUATIONS_EQUATIONS_SET_FIELD_FIELD) is not associated.",err,error,*999)
11383 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
11386 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
11389 local_error=
"Problem subtype "//
trim(
number_to_vstring(controlloop%PROBLEM%specification(3),
"*",err,error))// &
11390 &
" is not valid for boundary flux calculation." 11391 CALL flagerror(local_error,err,error,*999)
11394 CALL flagerror(
"Problem is not associated.",err,error,*999)
11397 CALL flagerror(
"Solvers is not associated.",err,error,*999)
11400 CALL flagerror(
"Solver is not associated.",err,error,*999)
11403 localboundaryarea=0.0_dp
11404 localboundaryflux=0.0_dp
11406 SELECT CASE(equationsset%specification(3))
11412 dependentvariable=>equations%EQUATIONS_MAPPING%NONLINEAR_MAPPING%RESIDUAL_VARIABLES(1)%PTR
11414 decomposition=>dependentvariable%FIELD%DECOMPOSITION
11415 elementsmapping=>decomposition%DOMAIN(decomposition%MESH_COMPONENT_NUMBER)%PTR%MAPPINGS%ELEMENTS
11417 CALL field_parameter_set_get_constant(equationssetfield,field_u1_variable_type,field_values_set_type, &
11418 & 2,tolerancecourant,err,error,*999)
11421 maxcourant = 0.0_dp
11422 DO elementidx=1,elementsmapping%TOTAL_NUMBER_OF_LOCAL
11423 meshcomponentnumber=dependentvariable%COMPONENTS(1)%MESH_COMPONENT_NUMBER
11424 dependentbasis=>decomposition%DOMAIN(meshcomponentnumber)%PTR%TOPOLOGY%ELEMENTS% &
11425 & elements(elementidx)%BASIS
11426 decompelement=>decomposition%TOPOLOGY%ELEMENTS%ELEMENTS(elementidx)
11428 CALL navierstokes_calculateelementmetrics(equationsset,elementidx,err,error,*999)
11433 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11434 & elementidx,3,courant,err,error,*999)
11436 CALL flag_warning(
"Negative Courant (CFL) number.",err,error,*999)
11438 IF(courant > maxcourant) maxcourant = courant
11440 IF(courant > tolerancecourant)
THEN 11444 &
". Decrease timestep or increase CFL tolerance for the 3D Navier-Stokes problem." 11445 CALL flagerror(local_error,err,error,*999)
11450 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11451 & elementidx,5,elementnormal(1),err,error,*999)
11452 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11453 & elementidx,6,elementnormal(2),err,error,*999)
11454 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11455 & elementidx,7,elementnormal(3),err,error,*999)
11456 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11457 & elementidx,8,boundaryvalue,err,error,*999)
11459 boundaryid=nint(boundaryvalue)
11460 IF(boundaryid>1)
THEN 11462 facevelocity=0.0_dp
11464 dependentinterpolationparameters=>equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS( &
11465 & dependentvariable%VARIABLE_TYPE)%PTR
11466 dependentinterpolatedpoint=>equations%INTERPOLATION%DEPENDENT_INTERP_POINT( &
11467 & dependentvariable%VARIABLE_TYPE)%PTR
11469 DO faceidx=1,dependentbasis%NUMBER_OF_LOCAL_FACES
11471 IF(
ALLOCATED(decompelement%ELEMENT_FACES))
THEN 11472 facenumber=decompelement%ELEMENT_FACES(faceidx)
11474 CALL flagerror(
"Decomposition element faces is not allocated.",err,error,*999)
11476 face=>decomposition%TOPOLOGY%FACES%FACES(facenumber)
11479 IF(.NOT.(face%BOUNDARY_FACE)) cycle
11481 SELECT CASE(dependentbasis%TYPE)
11483 normalcomponentidx=abs(face%XI_DIRECTION)
11485 CALL flag_warning(
"Boundary flux calculation not yet set up for simplex element types.",err,error,*999)
11487 local_error=
"Face integration for basis type "//
trim(
number_to_vstring(dependentbasis%TYPE,
"*",err,error))// &
11488 &
" is not yet implemented for Navier-Stokes." 11489 CALL flagerror(local_error,err,error,*999)
11492 CALL field_interpolation_parameters_face_get(field_values_set_type,facenumber, &
11493 & dependentinterpolationparameters,err,error,*999)
11494 facebasis=>decomposition%DOMAIN(meshcomponentnumber)%PTR%TOPOLOGY%FACES%FACES(facenumber)%BASIS
11498 DO gaussidx=1,facequadraturescheme%NUMBER_OF_GAUSS
11500 geometricinterpolationparameters=>equations%INTERPOLATION%GEOMETRIC_INTERP_PARAMETERS( &
11501 & field_u_variable_type)%PTR
11502 CALL field_interpolation_parameters_element_get(field_values_set_type,elementidx, &
11503 & geometricinterpolationparameters,err,error,*999)
11504 geometricinterpolatedpoint=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR
11506 & geometricinterpolatedpoint,err,error,*999)
11507 pointmetrics=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR
11510 gaussweight=facequadraturescheme%GAUSS_WEIGHTS(gaussidx)
11513 & dependentinterpolatedpoint,err,error,*999)
11515 velocitygauss=dependentinterpolatedpoint%values(1:3,
no_part_deriv)
11518 elementbasedofidx=0
11519 SELECT CASE(dependentbasis%TYPE)
11523 DO componentidx=1,dependentvariable%NUMBER_OF_COMPONENTS-1
11524 normalprojection=dot_product(pointmetrics%GU(normalcomponentidx,:),pointmetrics%DX_DXI(componentidx,:))
11525 IF(face%XI_DIRECTION<0)
THEN 11526 normalprojection=-normalprojection
11528 facenormal(componentidx)=normalprojection
11530 unitnormal=facenormal/
l2norm(facenormal)
11531 normaldifference=
l2norm(elementnormal-unitnormal)
11532 normaltolerance=0.1_dp
11533 IF(normaldifference>normaltolerance)
EXIT 11535 facenormal=unitnormal
11537 local_error=
"Face integration for basis type "//
trim(
number_to_vstring(dependentbasis%TYPE,
"*",err,error))// &
11538 &
" is not yet implemented for Navier-Stokes." 11539 CALL flagerror(local_error,err,error,*999)
11543 DO componentidx=1,dependentvariable%NUMBER_OF_COMPONENTS-1
11544 normalprojection=facenormal(componentidx)
11547 elementbasedofidx=dependentbasis%NUMBER_OF_ELEMENT_PARAMETERS*(componentidx-1)
11548 DO facenodeidx=1,facebasis%NUMBER_OF_NODES
11549 elementnodeidx=dependentbasis%NODE_NUMBERS_IN_LOCAL_FACE(facenodeidx,faceidx)
11550 DO facenodederivativeidx=1,facebasis%NUMBER_OF_DERIVATIVES(facenodeidx)
11552 nodederivativeidx=1
11553 parameteridx=dependentbasis%ELEMENT_PARAMETER_INDEX(nodederivativeidx,elementnodeidx)
11554 faceparameteridx=facebasis%ELEMENT_PARAMETER_INDEX(facenodederivativeidx,facenodeidx)
11555 elementdofidx=elementbasedofidx+parameteridx
11556 facearea=facearea + normalprojection*gaussweight*pointmetrics%JACOBIAN* &
11557 & facequadraturescheme%GAUSS_BASIS_FNS(faceparameteridx,
no_part_deriv,gaussidx)
11558 facevelocity=facevelocity+velocitygauss(componentidx)*normalprojection*gaussweight* &
11559 & pointmetrics%JACOBIAN*facequadraturescheme%GAUSS_BASIS_FNS(faceparameteridx,
no_part_deriv,gaussidx)
11565 localboundaryflux(boundaryid) = localboundaryflux(boundaryid) + facevelocity
11566 localboundaryarea(boundaryid) = localboundaryarea(boundaryid) + facearea
11571 globalboundaryflux = 0.0_dp
11572 globalboundaryarea = 0.0_dp
11574 IF(numberofcomputationalnodes>1)
THEN 11575 CALL mpi_allreduce(localboundaryflux,globalboundaryflux,10,mpi_double_precision,mpi_sum, &
11578 CALL mpi_allreduce(localboundaryarea,globalboundaryarea,10,mpi_double_precision,mpi_sum, &
11582 globalboundaryflux = localboundaryflux
11583 globalboundaryarea = localboundaryarea
11587 DO elementidx=1,elementsmapping%TOTAL_NUMBER_OF_LOCAL
11588 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11589 & elementidx,5,elementnormal(1),err,error,*999)
11590 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11591 & elementidx,6,elementnormal(2),err,error,*999)
11592 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11593 & elementidx,7,elementnormal(3),err,error,*999)
11594 CALL field_parametersetgetlocalelement(equationssetfield,field_v_variable_type,field_values_set_type, &
11595 & elementidx,8,boundaryvalue,err,error,*999)
11596 boundaryid=nint(boundaryvalue)
11597 IF(boundaryid>1)
THEN 11598 meshcomponentnumber=2
11599 decompelement=>decomposition%TOPOLOGY%ELEMENTS%ELEMENTS(elementidx)
11600 dependentbasis2=>decomposition%DOMAIN(meshcomponentnumber)%PTR%TOPOLOGY%ELEMENTS% &
11601 & elements(elementidx)%BASIS
11602 DO faceidx=1,dependentbasis2%NUMBER_OF_LOCAL_FACES
11604 IF(
ALLOCATED(decompelement%ELEMENT_FACES))
THEN 11605 facenumber=decompelement%ELEMENT_FACES(faceidx)
11607 CALL flagerror(
"Decomposition element faces is not allocated.",err,error,*999)
11609 face=>decomposition%TOPOLOGY%FACES%FACES(facenumber)
11610 IF(.NOT.(face%BOUNDARY_FACE)) cycle
11611 facebasis=>decomposition%DOMAIN(meshcomponentnumber)%PTR%TOPOLOGY%FACES%FACES(facenumber)%BASIS
11614 SELECT CASE(dependentbasis2%TYPE)
11616 normalcomponentidx=abs(face%XI_DIRECTION)
11617 pointmetrics=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR
11619 DO componentidx=1,dependentvariable%NUMBER_OF_COMPONENTS-1
11620 normalprojection=dot_product(pointmetrics%GU(normalcomponentidx,:),pointmetrics%DX_DXI(componentidx,:))
11621 IF(face%XI_DIRECTION<0)
THEN 11622 normalprojection=-normalprojection
11624 facenormal(componentidx)=normalprojection
11626 unitnormal=facenormal/
l2norm(facenormal)
11630 local_error=
"Face integration for basis type "//
trim(
number_to_vstring(dependentbasis2%TYPE,
"*",err,error))// &
11631 &
" is not yet implemented for Navier-Stokes." 11632 CALL flagerror(local_error,err,error,*999)
11634 normaldifference=
l2norm(elementnormal-unitnormal)
11635 normaltolerance=0.1_dp
11636 IF(normaldifference>normaltolerance) cycle
11639 DO facenodeidx=1,facebasis%NUMBER_OF_NODES
11640 elementnodeidx=dependentbasis2%NODE_NUMBERS_IN_LOCAL_FACE(facenodeidx,faceidx)
11641 DO facenodederivativeidx=1,facebasis%NUMBER_OF_DERIVATIVES(facenodeidx)
11642 nodenumber=decomposition%DOMAIN(meshcomponentnumber)%PTR% &
11643 & topology%ELEMENTS%ELEMENTS(elementidx)%ELEMENT_NODES(elementnodeidx)
11645 CALL field_parameter_set_update_local_node(equationssetfield,field_u_variable_type,field_values_set_type, &
11646 & versionnumber,facenodederivativeidx,nodenumber,1,globalboundaryflux(boundaryid),err,error,*999)
11655 local_error=
"Boundary flux calcluation for the third equations set specification of "// &
11657 &
" is not yet implemented for Navier-Stokes." 11658 CALL flagerror(local_error,err,error,*999)
11661 exits(
"NavierStokes_CalculateBoundaryFlux")
11663 999 errorsexits(
"NavierStokes_CalculateBoundaryFlux",err,error)
11674 SUBROUTINE navierstokes_couple1d0d(controlLoop,solver,err,error,*)
11679 INTEGER(INTG),
INTENT(OUT) :: err
11684 TYPE(
field_type),
POINTER :: dependentField,materialsField,independentField
11691 INTEGER(INTG) :: nodeNumber,nodeIdx,derivativeIdx,versionIdx,componentIdx,numberOfLocalNodes1D
11692 INTEGER(INTG) :: solver1dNavierStokesNumber,solverNumber,MPI_IERROR,timestep,iteration
11693 INTEGER(INTG) :: boundaryNumber,numberOfBoundaries,numberOfComputationalNodes
11694 REAL(DP) :: A0_PARAM,E_PARAM,H_PARAM,beta,pCellML,normalWave(2)
11695 REAL(DP) :: qPrevious,pPrevious,aPrevious,q1d,a1d,qError,aError,couplingTolerance
11696 LOGICAL :: boundaryNode,boundaryConverged(30),localConverged,MPI_LOGICAL
11697 LOGICAL,
ALLOCATABLE :: globalConverged(:)
11699 enters(
"NavierStokes_Couple1D0D",err,error,*999)
11702 SELECT CASE(controlloop%PROBLEM%specification(3))
11707 solvernumber = solver%GLOBAL_NUMBER
11709 solver1dnavierstokesnumber=2
11712 IF(solvernumber == solver1dnavierstokesnumber)
THEN 11713 solver1d=>controlloop%SUB_LOOPS(2)%PTR%SOLVERS%SOLVERS(solver1dnavierstokesnumber)%PTR
11714 iterativeloop=>controlloop%WHILE_LOOP
11715 iteration = iterativeloop%ITERATION_NUMBER
11716 timestep = controlloop%PARENT_LOOP%TIME_LOOP%ITERATION_NUMBER
11719 &
" does not correspond with the Navier-Stokes solver number for 1D-0D fluid coupling." 11720 CALL flagerror(localerror,err,error,*999)
11723 localerror=
"Problem subtype "//
trim(
number_to_vstring(controlloop%PROBLEM%specification(3),
"*",err,error))// &
11724 &
" is not valid for 1D-0D Navier-Stokes fluid coupling." 11725 CALL flagerror(localerror,err,error,*999)
11728 couplingtolerance = iterativeloop%ABSOLUTE_TOLERANCE
11730 IF(
ASSOCIATED(controlloop))
THEN 11731 IF(
ASSOCIATED(solver1d))
THEN 11732 IF(
ASSOCIATED(controlloop%PROBLEM))
THEN 11733 solverequations=>solver1d%SOLVER_EQUATIONS
11734 IF(
ASSOCIATED(solverequations))
THEN 11735 solvermapping=>solverequations%SOLVER_MAPPING
11736 IF(
ASSOCIATED(solvermapping))
THEN 11737 equationsset=>solvermapping%EQUATIONS_SETS(1)%PTR
11738 IF(
ASSOCIATED(equationsset))
THEN 11739 materialsfield=>equationsset%MATERIALS%MATERIALS_FIELD
11740 dependentfield=>equationsset%DEPENDENT%DEPENDENT_FIELD
11741 independentfield=>equationsset%INDEPENDENT%INDEPENDENT_FIELD
11743 CALL flagerror(
"Equations set is not associated.",err,error,*999)
11746 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
11749 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
11752 CALL flagerror(
"Problem is not associated.",err,error,*999)
11755 CALL flagerror(
"Solver is not associated.",err,error,*999)
11758 CALL flagerror(
"Control Loop is not associated.",err,error,*999)
11762 domainnodes=>dependentfield%DECOMPOSITION%DOMAIN(dependentfield%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
11764 IF(
ASSOCIATED(domainnodes))
THEN 11765 numberoflocalnodes1d=domainnodes%NUMBER_OF_NODES
11767 CALL flagerror(
"Domain nodes are not associated.",err,error,*999)
11771 boundaryconverged = .true.
11773 DO nodeidx=1,numberoflocalnodes1d
11774 nodenumber = domainnodes%NODES(nodeidx)%local_number
11776 boundarynode=dependentfield%DECOMPOSITION%DOMAIN(dependentfield%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
11777 & topology%NODES%NODES(nodenumber)%BOUNDARY_NODE
11780 DO componentidx=1,2
11781 CALL field_parametersetgetlocalnode(independentfield,field_u_variable_type,field_values_set_type, &
11782 & versionidx,derivativeidx,nodenumber,componentidx,normalwave(componentidx),err,error,*999)
11788 boundarynumber = boundarynumber + 1
11789 boundaryconverged(boundarynumber) = .false.
11791 CALL field_parametersetgetlocalnode(materialsfield,field_v_variable_type,field_values_set_type, &
11792 & versionidx,derivativeidx,nodenumber,1,a0_param,err,error,*999)
11793 CALL field_parametersetgetlocalnode(materialsfield,field_v_variable_type,field_values_set_type, &
11794 & versionidx,derivativeidx,nodenumber,2,e_param,err,error,*999)
11795 CALL field_parametersetgetlocalnode(materialsfield,field_v_variable_type,field_values_set_type, &
11796 & versionidx,derivativeidx,nodenumber,3,h_param,err,error,*999)
11797 beta=(4.0_dp*sqrt(
pi)*e_param*h_param)/(3.0_dp*a0_param)
11802 CALL field_parametersetgetlocalnode(dependentfield,field_u_variable_type,field_values_set_type, &
11803 & versionidx,derivativeidx,nodenumber,1,q1d,err,error,*999)
11805 CALL field_parametersetgetlocalnode(dependentfield,field_u_variable_type,field_values_set_type, &
11806 & versionidx,derivativeidx,nodenumber,2,a1d,err,error,*999)
11808 CALL field_parametersetgetlocalnode(dependentfield,field_u1_variable_type,field_values_set_type, &
11809 & versionidx,derivativeidx,nodenumber,1,pcellml,err,error,*999)
11813 IF(iteration == 1 .AND. timestep == 0)
THEN 11815 NULLIFY(fieldvariable)
11816 CALL field_variable_get(dependentfield,field_u_variable_type,fieldvariable,err,error,*999)
11817 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_previous_iteration_values_set_type)%PTR))
THEN 11818 CALL field_parameter_set_create(dependentfield,field_u_variable_type, &
11819 & field_previous_iteration_values_set_type,err,error,*999)
11821 NULLIFY(fieldvariable)
11822 CALL field_variable_get(dependentfield,field_u1_variable_type,fieldvariable,err,error,*999)
11823 IF(.NOT.
ASSOCIATED(fieldvariable%PARAMETER_SETS%SET_TYPE(field_previous_iteration_values_set_type)%PTR))
THEN 11824 CALL field_parameter_set_create(dependentfield,field_u1_variable_type, &
11825 & field_previous_iteration_values_set_type,err,error,*999)
11829 CALL field_parametersetgetlocalnode(dependentfield,field_u_variable_type,field_previous_iteration_values_set_type, &
11830 & versionidx,derivativeidx,nodenumber,1,qprevious,err,error,*999)
11832 CALL field_parametersetgetlocalnode(dependentfield,field_u_variable_type,field_previous_iteration_values_set_type, &
11833 & versionidx,derivativeidx,nodenumber,2,aprevious,err,error,*999)
11835 CALL field_parametersetgetlocalnode(dependentfield,field_u1_variable_type,field_previous_iteration_values_set_type, &
11836 & versionidx,derivativeidx,nodenumber,1,pprevious,err,error,*999)
11838 qerror = abs(qprevious - q1d)
11839 aerror = abs(aprevious - a1d)
11840 IF( qerror < couplingtolerance .AND. aerror < couplingtolerance)
THEN 11841 boundaryconverged(boundarynumber) = .true.
11846 CALL field_parameter_set_update_local_node(dependentfield,field_u_variable_type, &
11847 & field_previous_iteration_values_set_type,versionidx,derivativeidx,nodenumber,1,q1d,err,error,*999)
11848 CALL field_parameter_set_update_local_node(dependentfield,field_u_variable_type, &
11849 & field_previous_iteration_values_set_type,versionidx,derivativeidx,nodenumber,2,a1d,err,error,*999)
11850 CALL field_parameter_set_update_local_node(dependentfield,field_u1_variable_type, &
11851 & field_previous_iteration_values_set_type,versionidx,derivativeidx,nodenumber,1,pcellml,err,error,*999)
11855 numberofboundaries = boundarynumber
11857 IF(solvernumber == solver1dnavierstokesnumber)
THEN 11862 IF(numberofboundaries == 0 .OR. all(boundaryconverged(1:numberofboundaries)))
THEN 11863 localconverged = .true.
11865 localconverged = .false.
11869 IF(numberofcomputationalnodes>1)
THEN 11871 ALLOCATE(globalconverged(numberofcomputationalnodes),stat=err)
11872 IF(err/=0)
CALL flagerror(
"Could not allocate global convergence check array.",err,error,*999)
11873 CALL mpi_allgather(localconverged,1,mpi_integer,globalconverged,1,mpi_integer, &
11876 IF(all(globalconverged))
THEN 11879 iterativeloop%CONTINUE_LOOP=.false.
11881 DEALLOCATE(globalconverged)
11883 IF(localconverged)
THEN 11886 iterativeloop%CONTINUE_LOOP=.false.
11893 IF(timestep == 0)
THEN 11894 iterativeloop%CONTINUE_LOOP=.false.
11896 IF(iterativeloop%CONTINUE_LOOP .EQV. .true. )
THEN 11897 CALL field_parameter_sets_copy(dependentfield,equationsset%EQUATIONS%EQUATIONS_MAPPING%DYNAMIC_MAPPING% &
11898 & dynamic_variable_type,field_previous_values_set_type,field_values_set_type,1.0_dp,err,error,*999)
11899 CALL field_parameter_sets_copy(dependentfield,equationsset%EQUATIONS%EQUATIONS_MAPPING%DYNAMIC_MAPPING% &
11900 & dynamic_variable_type,field_previous_residual_set_type,field_residual_set_type,1.0_dp,err,error,*999)
11904 exits(
"NavierStokes_Couple1D0D")
11906 999 errorsexits(
"NavierStokes_Couple1D0D",err,error)
11916 SUBROUTINE navierstokes_couplecharacteristics(controlLoop,solver,err,error,*)
11921 INTEGER(INTG),
INTENT(OUT) :: err
11927 TYPE(
field_type),
POINTER :: dependentField,independentField,materialsField
11930 TYPE(
solver_type),
POINTER :: solver1DNavierStokes
11932 INTEGER(INTG) :: nodeNumber,nodeIdx,derivativeIdx,versionIdx,componentIdx,i
11933 INTEGER(INTG) :: solver1dNavierStokesNumber,solverNumber
11934 INTEGER(INTG) :: branchNumber,numberOfBranches,numberOfComputationalNodes,numberOfVersions
11935 INTEGER(INTG) :: MPI_IERROR,timestep,iteration,outputIteration
11936 REAL(DP) :: couplingTolerance,l2ErrorW(30),wPrevious(2,4),wNavierStokes(2,4),wCharacteristic(2,4),wError(2,4)
11937 REAL(DP) :: l2ErrorQ(100),qCharacteristic(4),qNavierStokes(4),wNext(2,4)
11938 REAL(DP) :: totalErrorWPrevious,startTime,stopTime,currentTime,timeIncrement
11939 REAL(DP) :: l2ErrorA(100),aCharacteristic(4),aNavierStokes(4),totalErrorW,totalErrorQ,totalErrorA
11940 REAL(DP) :: totalErrorMass,totalErrorMomentum
11941 REAL(DP) :: rho,alpha,normalWave,A0_PARAM,E_PARAM,H_PARAM,beta,aNew,penaltyCoeff
11942 LOGICAL :: branchConverged(100),localConverged,MPI_LOGICAL,boundaryNode,fluxDiverged
11943 LOGICAL,
ALLOCATABLE :: globalConverged(:)
11945 enters(
"NavierStokes_CoupleCharacteristics",err,error,*999)
11947 SELECT CASE(controlloop%PROBLEM%specification(3))
11950 solver1dnavierstokesnumber=2
11951 solver1dnavierstokes=>controlloop%SOLVERS%SOLVERS(solver1dnavierstokesnumber)%PTR
11953 & timestep,outputiteration,err,error,*999)
11954 iteration = controlloop%WHILE_LOOP%ITERATION_NUMBER
11955 iterativeloop=>controlloop%WHILE_LOOP
11960 solver1dnavierstokesnumber=2
11961 solver1dnavierstokes=>controlloop%PARENT_LOOP%SUB_LOOPS(2)%PTR%SOLVERS%SOLVERS(solver1dnavierstokesnumber)%PTR
11962 iterativeloop=>controlloop%WHILE_LOOP
11963 iteration = iterativeloop%ITERATION_NUMBER
11964 timestep = controlloop%PARENT_LOOP%PARENT_LOOP%TIME_LOOP%ITERATION_NUMBER
11966 localerror=
"Problem subtype "//
trim(
number_to_vstring(controlloop%PROBLEM%specification(3),
"*",err,error))// &
11967 &
" is not valid for 1D-0D Navier-Stokes fluid coupling." 11968 CALL flagerror(localerror,err,error,*999)
11971 solvernumber = solver%GLOBAL_NUMBER
11972 couplingtolerance = iterativeloop%ABSOLUTE_TOLERANCE
11974 IF(
ASSOCIATED(controlloop))
THEN 11975 IF(
ASSOCIATED(solver1dnavierstokes))
THEN 11976 IF(
ASSOCIATED(controlloop%PROBLEM))
THEN 11977 solverequations=>solver1dnavierstokes%SOLVER_EQUATIONS
11978 IF(
ASSOCIATED(solverequations))
THEN 11979 solvermapping=>solverequations%SOLVER_MAPPING
11980 IF(
ASSOCIATED(solvermapping))
THEN 11981 equationsset=>solvermapping%EQUATIONS_SETS(1)%PTR
11982 IF(
ASSOCIATED(equationsset))
THEN 11983 dependentfield=>equationsset%DEPENDENT%DEPENDENT_FIELD
11984 independentfield=>equationsset%INDEPENDENT%INDEPENDENT_FIELD
11985 materialsfield=>equationsset%MATERIALS%MATERIALS_FIELD
11987 CALL flagerror(
"Equations set is not associated.",err,error,*999)
11990 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
11993 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
11996 CALL flagerror(
"Problem is not associated.",err,error,*999)
11999 CALL flagerror(
"Solver is not associated.",err,error,*999)
12002 CALL flagerror(
"Control Loop is not associated.",err,error,*999)
12005 domainnodes=>dependentfield%DECOMPOSITION%DOMAIN(dependentfield%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
12008 branchconverged = .true.
12009 fluxdiverged = .false.
12010 totalerrorq = 0.0_dp
12011 totalerrora = 0.0_dp
12012 totalerrorw = 0.0_dp
12013 totalerrormass = 0.0_dp
12014 totalerrormomentum = 0.0_dp
12015 totalerrorwprevious = 0.0_dp
12021 CALL field_parameter_set_get_constant(materialsfield,field_u_variable_type,field_values_set_type, &
12022 & 2,rho,err,error,*999)
12023 CALL field_parameter_set_get_constant(materialsfield,field_u_variable_type,field_values_set_type, &
12024 & 3,alpha,err,error,*999)
12025 CALL field_parameter_set_get_constant(equationsset%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD,field_u_variable_type, &
12026 & field_values_set_type,1,penaltycoeff,err,error,*999)
12029 DO nodeidx=1,domainnodes%NUMBER_OF_NODES
12030 nodenumber = domainnodes%NODES(nodeidx)%local_number
12032 numberofversions=domainnodes%NODES(nodenumber)%DERIVATIVES(derivativeidx)%numberOfVersions
12033 boundarynode=domainnodes%NODES(nodenumber)%BOUNDARY_NODE
12036 CALL field_parametersetgetlocalnode(independentfield,field_u_variable_type, &
12037 & field_values_set_type,1,1,nodenumber,1,normalwave,err,error,*999)
12039 branchnumber = branchnumber + 1
12040 branchconverged(branchnumber) = .false.
12044 DO componentidx=1,2
12045 DO versionidx=1,numberofversions
12047 CALL field_parametersetgetlocalnode(independentfield,field_u_variable_type, &
12048 & field_values_set_type,versionidx,derivativeidx,nodenumber,componentidx,normalwave,err,error,*999)
12054 CALL field_parametersetgetlocalnode(dependentfield,field_v_variable_type,field_values_set_type, &
12055 & versionidx,derivativeidx,nodenumber,componentidx,wprevious(componentidx,versionidx),err,error,*999)
12058 CALL field_parametersetgetlocalnode(materialsfield,field_v_variable_type,field_values_set_type, &
12059 & versionidx,derivativeidx,nodenumber,1,a0_param,err,error,*999)
12060 CALL field_parametersetgetlocalnode(materialsfield,field_v_variable_type,field_values_set_type, &
12061 & versionidx,derivativeidx,nodenumber,2,e_param,err,error,*999)
12062 CALL field_parametersetgetlocalnode(materialsfield,field_v_variable_type,field_values_set_type, &
12063 & versionidx,derivativeidx,nodenumber,3,h_param,err,error,*999)
12064 beta=(4.0_dp*sqrt(
pi)*e_param*h_param)/(3.0_dp*a0_param)
12067 CALL field_parametersetgetlocalnode(dependentfield,field_u_variable_type,field_values_set_type, &
12068 & versionidx,derivativeidx,nodenumber,1,qnavierstokes(versionidx),err,error,*999)
12069 CALL field_parametersetgetlocalnode(dependentfield,field_u_variable_type,field_values_set_type, &
12070 & versionidx,derivativeidx,nodenumber,2,anavierstokes(versionidx),err,error,*999)
12074 wnavierstokes(componentidx,versionidx)= ((qnavierstokes(versionidx)/anavierstokes(versionidx))+ &
12075 & normalwave*4.0_dp*sqrt(beta/(2.0_dp*rho))*(anavierstokes(versionidx)**(0.25_dp) - (a0_param)**(0.25_dp)))
12077 IF(boundarynode)
THEN 12078 anew = (1.0_dp/(beta/(2.0_dp*rho)))**2.0_dp*((wnavierstokes(componentidx,versionidx))/8.0_dp+ &
12079 & sqrt(beta/(2.0_dp*rho))*((a0_param)**0.25_dp))**4.0_dp
12080 CALL field_parameter_set_update_local_node(dependentfield,field_u_variable_type, &
12081 & field_previous_values_set_type,versionidx,derivativeidx,nodenumber, &
12082 & 2,anew,err,error,*999)
12086 CALL field_parametersetgetlocalnode(dependentfield,field_u_variable_type,field_upwind_values_set_type, &
12087 & versionidx,derivativeidx,nodenumber,1,qcharacteristic(versionidx),err,error,*999)
12088 CALL field_parametersetgetlocalnode(dependentfield,field_u_variable_type,field_upwind_values_set_type, &
12089 & versionidx,derivativeidx,nodenumber,2,acharacteristic(versionidx),err,error,*999)
12092 wcharacteristic(componentidx,versionidx)= ((qcharacteristic(versionidx)/acharacteristic(versionidx))+ &
12093 & normalwave*4.0_dp*sqrt((beta/(2.0_dp*rho)))*(acharacteristic(versionidx)**(0.25_dp) - (a0_param)**(0.25_dp)))
12099 IF(numberofversions > 1 )
THEN 12100 l2errorq(branchnumber) =
l2norm(qnavierstokes-qcharacteristic)
12101 l2errora(branchnumber) =
l2norm(anavierstokes-acharacteristic)
12104 IF((abs(l2errorq(branchnumber)) < couplingtolerance) .AND. (abs(l2errora(branchnumber)) < couplingtolerance))
THEN 12105 branchconverged(branchnumber) = .true.
12107 totalerrorq = totalerrorq + l2errorq(branchnumber)
12108 totalerrora = totalerrora + l2errora(branchnumber)
12110 wnext = ((wnavierstokes + wcharacteristic)/2.0_dp)
12112 IF(numberofversions > 1)
THEN 12113 DO componentidx=1,2
12114 DO versionidx=1,numberofversions
12115 CALL field_parametersetgetlocalnode(independentfield,field_u_variable_type, &
12116 & field_values_set_type,versionidx,derivativeidx,nodenumber,componentidx,normalwave,err,error,*999)
12119 CALL field_parameter_set_update_local_node(dependentfield,field_v_variable_type,field_values_set_type, &
12120 & versionidx,derivativeidx,nodenumber,componentidx,wnext(componentidx,versionidx),err,error,*999)
12128 numberofbranches = branchnumber
12134 IF(numberofbranches == 0 .OR. all(branchconverged(1:numberofbranches)))
THEN 12135 localconverged = .true.
12137 localconverged = .false.
12141 IF(numberofcomputationalnodes>1)
THEN 12143 ALLOCATE(globalconverged(numberofcomputationalnodes),stat=err)
12144 IF(err/=0)
CALL flagerror(
"Could not allocate global convergence check array.",err,error,*999)
12145 CALL mpi_allgather(localconverged,1,mpi_integer,globalconverged,1,mpi_integer, &
12148 IF(all(globalconverged))
THEN 12151 controlloop%WHILE_LOOP%CONTINUE_LOOP=.false.
12153 DEALLOCATE(globalconverged)
12155 IF(localconverged)
THEN 12158 controlloop%WHILE_LOOP%CONTINUE_LOOP=.false.
12162 exits(
"NavierStokes_CoupleCharacteristics")
12164 999 errorsexits(
"NavierStokes_CoupleCharacteristics",err,error)
12167 END SUBROUTINE navierstokes_couplecharacteristics
12174 SUBROUTINE navierstokes_shearratecalculate(equationsSet,ERR,ERROR,*)
12178 INTEGER(INTG),
INTENT(OUT) :: err
12195 INTEGER(INTG) :: elementIdx,decompositionLocalElementNumber
12196 INTEGER(INTG) :: gaussIdx
12197 INTEGER(INTG) :: meshComponentNumber,numberOfDimensions,i,j,userElementNumber
12198 INTEGER(INTG) :: localElementNumber,startElement,stopElement
12199 REAL(DP) :: gaussWeight,shearRate,secondInvariant,strainRate
12200 REAL(DP) :: dUdXi(3,3),dXidX(3,3),dUdX(3,3),dUdXTrans(3,3),rateOfDeformation(3,3),velocityGauss(3)
12201 REAL(DP) :: shearRateDefault
12202 LOGICAL :: ghostElement,elementExists,defaultUpdate
12204 enters(
"NavierStokes_ShearRateCalculate",err,error,*999)
12208 NULLIFY(decomposition)
12209 NULLIFY(dependentbasis)
12211 NULLIFY(quadraturescheme)
12212 NULLIFY(fieldvariable)
12213 NULLIFY(dependentinterpolatedpoint)
12214 NULLIFY(dependentinterpolationparameters)
12215 NULLIFY(geometricinterpolatedpoint)
12216 NULLIFY(dependentfield)
12217 NULLIFY(materialsfield)
12220 IF(
ASSOCIATED(equationsset))
THEN 12221 equations=>equationsset%EQUATIONS
12222 IF(
ASSOCIATED(equations))
THEN 12223 dependentfield=>equationsset%DEPENDENT%DEPENDENT_FIELD
12224 IF(.NOT.
ASSOCIATED(dependentfield))
THEN 12225 CALL flagerror(
"Dependent field is not associated.",err,error,*999)
12227 materialsfield=>equationsset%MATERIALS%MATERIALS_FIELD
12228 IF(.NOT.
ASSOCIATED(materialsfield))
THEN 12229 CALL flagerror(
"Materials field is not associated.",err,error,*999)
12232 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
12235 CALL flagerror(
"Equations set is not associated.",err,error,*999)
12238 SELECT CASE(equationsset%specification(3))
12240 dependentvariable=>equations%EQUATIONS_MAPPING%NONLINEAR_MAPPING%RESIDUAL_VARIABLES(1)%PTR
12241 meshcomponentnumber=dependentvariable%COMPONENTS(1)%MESH_COMPONENT_NUMBER
12243 decomposition=>dependentvariable%FIELD%DECOMPOSITION
12244 elementsmapping=>decomposition%DOMAIN(decomposition%MESH_COMPONENT_NUMBER)%PTR%MAPPINGS%ELEMENTS
12245 fieldvariable=>equations%EQUATIONS_MAPPING%NONLINEAR_MAPPING%RESIDUAL_VARIABLES(1)%PTR
12246 numberofdimensions=fieldvariable%NUMBER_OF_COMPONENTS - 1
12247 dependentinterpolatedpoint=>equations%INTERPOLATION%DEPENDENT_INTERP_POINT(dependentvariable%VARIABLE_TYPE)%PTR
12248 geometricinterpolatedpoint=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR
12249 defaultupdate=.false.
12252 startelement = elementsmapping%INTERNAL_START
12253 stopelement = elementsmapping%BOUNDARY_FINISH
12255 DO elementidx=startelement,stopelement
12256 localelementnumber=elementsmapping%DOMAIN_LIST(elementidx)
12257 userelementnumber = elementsmapping%LOCAL_TO_GLOBAL_MAP(localelementnumber)
12259 elementexists=.false.
12260 ghostelement=.true.
12261 CALL decomposition_topology_element_check_exists(decomposition%TOPOLOGY, &
12262 & userelementnumber,elementexists,decompositionlocalelementnumber,ghostelement,err,error,*999)
12263 IF(ghostelement)
THEN 12267 IF(elementexists)
THEN 12268 dependentbasis=>decomposition%DOMAIN(meshcomponentnumber)%PTR%TOPOLOGY%ELEMENTS%ELEMENTS(localelementnumber)%BASIS
12271 CALL field_interpolation_parameters_element_get(field_values_set_type,localelementnumber,equations%INTERPOLATION% &
12272 & dependent_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
12273 CALL field_interpolation_parameters_element_get(field_values_set_type,localelementnumber,equations%INTERPOLATION% &
12274 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
12277 DO gaussidx=1,quadraturescheme%NUMBER_OF_GAUSS
12280 & dependentinterpolatedpoint,err,error,*999)
12282 & geometricinterpolatedpoint,err,error,*999)
12283 pointmetrics=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR
12285 gaussweight=quadraturescheme%GAUSS_WEIGHTS(gaussidx)
12289 velocitygauss=dependentinterpolatedpoint%values(1:3,
no_part_deriv)
12291 dudxi(1:3,1)=dependentinterpolatedpoint%VALUES(1:3,
part_deriv_s1)
12292 dudxi(1:3,2)=dependentinterpolatedpoint%VALUES(1:3,
part_deriv_s2)
12293 IF(numberofdimensions == 3)
THEN 12294 dudxi(1:3,3)=dependentinterpolatedpoint%VALUES(1:3,
part_deriv_s3)
12296 dudxi(1:3,3)=0.0_dp
12298 dxidx=pointmetrics%DXI_DX(:,:)
12307 strainrate = strainrate + (dudx(i,j)*dudxtrans(i,j))
12308 rateofdeformation(i,j) = (dudx(i,j) + dudxtrans(i,j))/2.0_dp
12311 secondinvariant= - rateofdeformation(1,2)**2.0_dp - &
12312 & rateofdeformation(2,3)**2.0_dp - rateofdeformation(1,3)**2.0_dp
12314 IF(secondinvariant > -1.0e-30_dp)
THEN 12316 &
"WARNING: positive second invariant of rate of deformation tensor: ",secondinvariant,err,error,*999)
12319 defaultupdate=.true.
12322 shearrate=sqrt(-4.0_dp*secondinvariant)
12324 CALL field_parametersetupdatelocalgausspoint(materialsfield,field_v_variable_type, &
12325 & field_values_set_type,gaussidx,localelementnumber,2,shearrate,err,error,*999)
12329 IF(defaultupdate .EQV. .true.)
THEN 12334 IF(defaultupdate .EQV. .true.)
THEN 12335 shearratedefault=1.0e-10_dp
12337 & shearratedefault,err,error,*999)
12338 CALL field_component_values_initialise(materialsfield,field_v_variable_type, &
12339 & field_values_set_type,1,shearratedefault,err,error,*999)
12343 localerror=
"Equations set subtype "//
trim(
number_to_vstring(equationsset%specification(3),
"*",err,error))// &
12344 &
" is not valid for shear rate calculation in a Navier-Stokes equation type of a classical field equations set class." 12345 CALL flagerror(localerror,err,error,*999)
12348 exits(
"NavierStokes_ShearRateCalculate")
12350 999 errorsexits(
"NavierStokes_ShearRateCalculate",err,error)
12353 END SUBROUTINE navierstokes_shearratecalculate
12360 SUBROUTINE navierstokes_finiteelementpreresidualevaluate(equationsSet,err,error,*)
12364 INTEGER(INTG),
INTENT(OUT) :: err
12369 enters(
"NavierStokes_FiniteElementPreResidualEvaluate",err,error,*999)
12371 IF(
ASSOCIATED(equationsset))
THEN 12372 SELECT CASE(equationsset%specification(3))
12393 local_error=
"The third equations set specification of "// &
12395 &
" is not valid for a Navier-Stokes fluid mechanics equations set." 12396 CALL flagerror(local_error,err,error,*999)
12399 CALL flagerror(
"Equations set is not associated.",err,error,*999)
12402 exits(
"NavierStokes_FiniteElementPreResidualEvaluate")
12404 999
errors(
"NavierStokes_FiniteElementPreResidualEvaluate",err,error)
12405 exits(
"NavierStokes_FiniteElementPreResidualEvaluate")
12408 END SUBROUTINE navierstokes_finiteelementpreresidualevaluate
12415 SUBROUTINE navierstokes_controllooppostloop(controlLoop,err,error,*)
12419 INTEGER(INTG),
INTENT(OUT) :: err
12427 enters(
"NavierStokes_ControlLoopPostLoop",err,error,*999)
12429 NULLIFY(dependentfield)
12430 NULLIFY(fieldvariable)
12432 IF(
ASSOCIATED(controlloop))
THEN 12433 SELECT CASE(controlloop%PROBLEM%specification(3))
12445 SELECT CASE(controlloop%LOOP_TYPE)
12450 navierstokessolver=>controlloop%SUB_LOOPS(1)%PTR%SOLVERS%SOLVERS(2)%PTR
12451 CALL navier_stokes_post_solve_output_data(navierstokessolver,err,error,*999)
12453 navierstokessolver=>controlloop%SOLVERS%SOLVERS(2)%PTR
12454 CALL navierstokes_couplecharacteristics(controlloop,navierstokessolver,err,error,*999)
12456 localerror=
"The control loop type of "//
trim(
number_to_vstring(controlloop%LOOP_TYPE,
"*",err,error))// &
12457 &
" is invalid for a Coupled 1D0D Navier-Stokes problem." 12458 CALL flagerror(localerror,err,error,*999)
12464 SELECT CASE(controlloop%LOOP_TYPE)
12469 navierstokessolver=>controlloop%SUB_LOOPS(1)%PTR%SUB_LOOPS(2)%PTR%SOLVERS%SOLVERS(2)%PTR
12470 CALL navier_stokes_post_solve_output_data(navierstokessolver,err,error,*999)
12473 IF(controlloop%CONTROL_LOOP_LEVEL==2)
THEN 12474 navierstokessolver=>controlloop%SUB_LOOPS(2)%PTR%SOLVERS%SOLVERS(2)%PTR
12476 CALL navierstokes_couple1d0d(controlloop,navierstokessolver,err,error,*999)
12478 ELSE IF(controlloop%CONTROL_LOOP_LEVEL==3)
THEN 12479 navierstokessolver=>controlloop%SOLVERS%SOLVERS(2)%PTR
12480 CALL navierstokes_couplecharacteristics(controlloop,navierstokessolver,err,error,*999)
12482 localerror=
"The while loop level of "//
trim(
number_to_vstring(controlloop%CONTROL_LOOP_LEVEL,
"*",err,error))// &
12483 &
" is invalid for a Coupled 1D0D Navier-Stokes problem." 12484 CALL flagerror(localerror,err,error,*999)
12487 localerror=
"The control loop type of "//
trim(
number_to_vstring(controlloop%LOOP_TYPE,
"*",err,error))// &
12488 &
" is invalid for a Coupled 1D0D Navier-Stokes problem." 12489 CALL flagerror(localerror,err,error,*999)
12492 localerror=
"Problem subtype "//
trim(
number_to_vstring(controlloop%PROBLEM%specification(3),
"*",err,error))// &
12493 &
" is not valid for a Navier-Stokes fluid type of a fluid mechanics problem class." 12494 CALL flagerror(localerror,err,error,*999)
12497 CALL flagerror(
"Control loop is not associated.",err,error,*999)
12500 exits(
"NavierStokes_ControlLoopPostLoop")
12502 999 errorsexits(
"NavierStokes_ControlLoopPostLoop",err,error)
12505 END SUBROUTINE navierstokes_controllooppostloop
12512 SUBROUTINE navierstokes_updatemultiscaleboundary(solver,err,error,*)
12516 INTEGER(INTG),
INTENT(OUT) :: err
12525 TYPE(
field_type),
POINTER :: dependentField,materialsField,streeMaterialsField,independentField,geometricField
12532 REAL(DP) :: rho,A0,H0,E,beta,pExternal,lengthScale,timeScale,massScale,currentTime,timeIncrement
12533 REAL(DP) :: pCellml,qCellml,ABoundary,W1,W2,ACellML,normalWave(2,4)
12534 REAL(DP),
POINTER :: Impedance(:),Flow(:)
12535 INTEGER(INTG) :: nodeIdx,versionIdx,derivativeIdx,componentIdx,numberOfVersions,numberOfLocalNodes
12536 INTEGER(INTG) :: dependentDof,boundaryConditionType,k
12538 enters(
"NavierStokes_UpdateMultiscaleBoundary",err,error,*999)
12540 NULLIFY(dependentdomain)
12541 NULLIFY(equationsset)
12543 NULLIFY(geometricfield)
12544 NULLIFY(dependentfield)
12545 NULLIFY(independentfield)
12546 NULLIFY(materialsfield)
12547 NULLIFY(fieldvariable)
12548 NULLIFY(solverequations)
12549 NULLIFY(solvermapping)
12552 IF(
ASSOCIATED(solver))
THEN 12553 solvers=>solver%SOLVERS
12554 IF(
ASSOCIATED(solvers))
THEN 12555 controlloop=>solvers%CONTROL_LOOP
12556 parentloop=>controlloop%PARENT_LOOP
12557 streeloop=>parentloop%SUB_LOOPS(1)%PTR
12558 streesolver=>streeloop%SOLVERS%SOLVERS(1)%PTR
12560 & currenttime,timeincrement,err,error,*999)
12561 IF(
ASSOCIATED(controlloop%PROBLEM))
THEN 12562 SELECT CASE(controlloop%PROBLEM%specification(3))
12567 solverequations=>solver%SOLVER_EQUATIONS
12568 IF(
ASSOCIATED(solverequations))
THEN 12569 solvermapping=>solverequations%SOLVER_MAPPING
12570 IF(
ASSOCIATED(solvermapping))
THEN 12571 equationsset=>solvermapping%EQUATIONS_SETS(1)%PTR
12572 IF(
ASSOCIATED(equationsset))
THEN 12573 equations=>equationsset%EQUATIONS
12574 IF(
ASSOCIATED(equations))
THEN 12575 geometricfield=>equationsset%GEOMETRY%GEOMETRIC_FIELD
12576 independentfield=>equationsset%INDEPENDENT%INDEPENDENT_FIELD
12577 dependentfield=>equationsset%DEPENDENT%DEPENDENT_FIELD
12578 IF(
ASSOCIATED(dependentfield))
THEN 12579 dependentdomain=>dependentfield%DECOMPOSITION%DOMAIN(dependentfield% &
12580 & decomposition%MESH_COMPONENT_NUMBER)%PTR
12581 IF(.NOT.
ASSOCIATED(dependentdomain))
THEN 12582 CALL flagerror(
"Dependent domain is not associated.",err,error,*999)
12585 CALL flagerror(
"Geometric field is not associated.",err,error,*999)
12587 materialsfield=>equations%INTERPOLATION%MATERIALS_FIELD
12588 IF(.NOT.
ASSOCIATED(materialsfield))
THEN 12589 CALL flagerror(
"Materials field is not associated.",err,error,*999)
12592 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
12595 CALL flagerror(
"Equations set is not associated.",err,error,*999)
12598 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
12601 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
12605 solverequations=>solver%SOLVER_EQUATIONS
12606 streesolverequations=>streesolver%SOLVER_EQUATIONS
12607 IF(
ASSOCIATED(solverequations))
THEN 12608 solvermapping=>solverequations%SOLVER_MAPPING
12609 streesolvermapping=>streesolverequations%SOLVER_MAPPING
12610 IF(
ASSOCIATED(solvermapping))
THEN 12611 equationsset=>solvermapping%EQUATIONS_SETS(1)%PTR
12612 streeequationsset=>streesolvermapping%EQUATIONS_SETS(1)%PTR
12613 IF(
ASSOCIATED(equationsset))
THEN 12614 equations=>equationsset%EQUATIONS
12615 streeequations=>streeequationsset%EQUATIONS
12616 IF(
ASSOCIATED(equations))
THEN 12617 geometricfield=>equationsset%GEOMETRY%GEOMETRIC_FIELD
12618 independentfield=>equationsset%INDEPENDENT%INDEPENDENT_FIELD
12619 dependentfield=>equationsset%DEPENDENT%DEPENDENT_FIELD
12620 streematerialsfield=>streeequationsset%MATERIALS%MATERIALS_FIELD
12621 IF(
ASSOCIATED(dependentfield))
THEN 12622 dependentdomain=>dependentfield%DECOMPOSITION%DOMAIN(dependentfield% &
12623 & decomposition%MESH_COMPONENT_NUMBER)%PTR
12624 IF(.NOT.
ASSOCIATED(dependentdomain))
THEN 12625 CALL flagerror(
"Dependent domain is not associated.",err,error,*999)
12628 CALL flagerror(
"Geometric field is not associated.",err,error,*999)
12630 materialsfield=>equations%INTERPOLATION%MATERIALS_FIELD
12631 IF(.NOT.
ASSOCIATED(materialsfield))
THEN 12632 CALL flagerror(
"Materials field is not associated.",err,error,*999)
12635 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
12638 CALL flagerror(
"Equations set is not associated.",err,error,*999)
12641 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
12644 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
12647 localerror=
"The third problem specification of "// &
12649 &
" is not valid for boundary flux calculation." 12650 CALL flagerror(localerror,err,error,*999)
12653 CALL flagerror(
"Problem is not associated.",err,error,*999)
12656 CALL flagerror(
"Solvers is not associated.",err,error,*999)
12659 CALL flagerror(
"Solver is not associated.",err,error,*999)
12662 SELECT CASE(equationsset%specification(3))
12669 independentfield=>equationsset%INDEPENDENT%INDEPENDENT_FIELD
12670 numberoflocalnodes=dependentdomain%TOPOLOGY%NODES%NUMBER_OF_NODES
12673 CALL field_parameter_set_get_constant(materialsfield,field_u_variable_type, &
12674 & field_values_set_type,2,rho,err,error,*999)
12675 CALL field_parameter_set_get_constant(materialsfield,field_u_variable_type, &
12676 & field_values_set_type,4,pexternal,err,error,*999)
12678 CALL field_parameter_set_get_constant(materialsfield,field_u_variable_type, &
12679 & field_values_set_type,5,lengthscale,err,error,*999)
12680 CALL field_parameter_set_get_constant(materialsfield,field_u_variable_type, &
12681 & field_values_set_type,6,timescale,err,error,*999)
12682 CALL field_parameter_set_get_constant(materialsfield,field_u_variable_type, &
12683 & field_values_set_type,7,massscale,err,error,*999)
12686 DO nodeidx=1,numberoflocalnodes
12687 numberofversions=dependentdomain%TOPOLOGY%NODES%NODES(nodeidx)%DERIVATIVES(derivativeidx)%numberOfVersions
12691 DO componentidx=1,2
12692 DO versionidx=1,numberofversions
12693 CALL field_parametersetgetlocalnode(independentfield,field_u_variable_type,field_values_set_type,versionidx, &
12694 & derivativeidx,nodeidx,componentidx,normalwave(componentidx,versionidx),err,error,*999)
12702 CALL field_parametersetgetlocalnode(materialsfield,field_v_variable_type,field_values_set_type,versionidx, &
12703 & derivativeidx,nodeidx,1,a0,err,error,*999)
12704 CALL field_parametersetgetlocalnode(materialsfield,field_v_variable_type,field_values_set_type,versionidx, &
12705 & derivativeidx,nodeidx,2,e,err,error,*999)
12706 CALL field_parametersetgetlocalnode(materialsfield,field_v_variable_type,field_values_set_type,versionidx, &
12707 & derivativeidx,nodeidx,3,h0,err,error,*999)
12708 beta=(4.0_dp*(sqrt(
pi))*e*h0)/(3.0_dp*a0)
12710 boundaryconditions=>solverequations%BOUNDARY_CONDITIONS
12711 NULLIFY(fieldvariable)
12712 CALL field_variable_get(dependentfield,field_u_variable_type,fieldvariable,err,error,*999)
12713 dependentdof = fieldvariable%COMPONENTS(2)%PARAM_TO_DOF_MAP% &
12714 & node_param2dof_map%NODES(nodeidx)%DERIVATIVES(derivativeidx)%VERSIONS(versionidx)
12716 & fieldvariable,boundaryconditionsvariable,err,error,*999)
12717 boundaryconditiontype=boundaryconditionsvariable%CONDITION_TYPES(dependentdof)
12718 SELECT CASE(boundaryconditiontype)
12724 IF(normalwave(1,1) > 0.0_dp)
THEN 12725 CALL field_parametersetgetlocalnode(dependentfield,field_v_variable_type,field_values_set_type, &
12726 & versionidx,derivativeidx,nodeidx,1,w1,err,error,*999)
12731 CALL field_parametersetgetlocalnode(dependentfield,field_v_variable_type,field_values_set_type, &
12732 & versionidx,derivativeidx,nodeidx,2,w2,err,error,*999)
12735 aboundary = (((2.0_dp*rho)/(beta))**2.0_dp)* &
12736 & (((w1-w2)/8.0_dp+sqrt(beta/(2.0_dp*rho))*((a0)**0.25_dp))**4.0_dp)
12737 CALL field_parameter_set_update_local_node(dependentfield,field_u_variable_type, &
12738 & field_values_set_type,versionidx,derivativeidx,nodeidx,2,aboundary,err,error,*999)
12744 CALL field_parametersetgetlocalnode(dependentfield,field_u_variable_type,field_values_set_type, &
12745 & versionidx,derivativeidx,nodeidx,1,qcellml,err,error,*999)
12747 CALL field_parametersetgetlocalnode(dependentfield,field_u1_variable_type,field_values_set_type, &
12748 & versionidx,derivativeidx,nodeidx,2,pcellml,err,error,*999)
12750 pcellml = pcellml*massscale/(lengthscale*(timescale**2.0_dp))
12752 acellml=((pcellml-pexternal)/beta+sqrt(a0))**2.0_dp
12754 IF(normalwave(1,1) > 0.0_dp)
THEN 12755 CALL field_parametersetgetlocalnode(dependentfield,field_v_variable_type,field_values_set_type, &
12756 & versionidx,derivativeidx,nodeidx,1,w1,err,error,*999)
12758 w2 = qcellml/acellml - 4.0_dp*sqrt(beta/(2.0_dp*rho))*(acellml**0.25_dp - a0**0.25_dp)
12762 w1 = qcellml/acellml + 4.0_dp*sqrt(beta/(2.0_dp*rho))*(acellml**0.25_dp - a0**0.25_dp)
12764 CALL field_parametersetgetlocalnode(dependentfield,field_v_variable_type,field_values_set_type, &
12765 & versionidx,derivativeidx,nodeidx,2,w2,err,error,*999)
12768 aboundary = (((2.0_dp*rho)/(beta))**2.0_dp)* &
12769 & (((w1-w2)/8.0_dp+sqrt(beta/(2.0_dp*rho))*((a0)**0.25_dp))**4.0_dp)
12770 CALL field_parameter_set_update_local_node(dependentfield,field_u_variable_type, &
12771 & field_values_set_type,versionidx,derivativeidx,nodeidx,2,aboundary,err,error,*999)
12779 CALL field_parametersetgetlocalnode(dependentfield,field_u_variable_type,field_values_set_type, &
12780 & versionidx,derivativeidx,nodeidx,1,qcellml,err,error,*999)
12782 CALL field_parameter_set_data_get(streematerialsfield,field_u_variable_type,field_values_set_type, &
12783 & impedance,err,error,*999)
12785 CALL field_parameter_set_data_get(streematerialsfield,field_v_variable_type,field_values_set_type, &
12786 & flow,err,error,*999)
12789 pcellml=pcellml+flow(k)*impedance(k)*timeincrement
12792 acellml=((pcellml-pexternal)/beta+sqrt(a0))**2.0_dp
12794 IF(normalwave(1,1) > 0.0_dp)
THEN 12795 CALL field_parametersetgetlocalnode(dependentfield,field_v_variable_type,field_values_set_type, &
12796 & versionidx,derivativeidx,nodeidx,1,w1,err,error,*999)
12798 w2 = qcellml/acellml-4.0_dp*sqrt(beta/(2.0_dp*rho))*(acellml**0.25_dp-a0**0.25_dp)
12802 w1 = qcellml/acellml+4.0_dp*sqrt(beta/(2.0_dp*rho))*(acellml**0.25_dp-a0**0.25_dp)
12804 CALL field_parametersetgetlocalnode(dependentfield,field_v_variable_type,field_values_set_type, &
12805 & versionidx,derivativeidx,nodeidx,2,w2,err,error,*999)
12808 aboundary = (((2.0_dp*rho)/(beta))**2.0_dp)* &
12809 & (((w1-w2)/8.0_dp+sqrt(beta/(2.0_dp*rho))*((a0)**0.25_dp))**4.0_dp)
12810 CALL field_parameter_set_update_local_node(dependentfield,field_u_variable_type, &
12811 & field_values_set_type,versionidx,derivativeidx,nodeidx,2,aboundary,err,error,*999)
12821 localerror=
"The boundary conditions type "//
trim(
number_to_vstring(boundaryconditiontype,
"*",err,error))// &
12822 &
" is not valid for a coupled characteristic problem." 12823 CALL flagerror(localerror,err,error,*999)
12843 localerror=
"Equations set subtype "//
trim(
number_to_vstring(equationsset%specification(3),
"*",err,error))// &
12844 &
" is not valid for a Navier-Stokes equation type of a fluid mechanics equations set class." 12845 CALL flagerror(localerror,err,error,*999)
12848 exits(
"NavierStokes_UpdateMultiscaleBoundary")
12850 999 errorsexits(
"NavierStokes_UpdateMultiscaleBoundary",err,error)
12853 END SUBROUTINE navierstokes_updatemultiscaleboundary
integer(intg), parameter equations_set_setup_dependent_type
Dependent variables.
integer(intg), parameter equations_set_fem_solution_method
Finite Element Method solution method.
This module contains all basis function routines.
integer(intg), parameter equations_set_setup_materials_type
Materials setup.
Contains information on the boundary conditions for the solver equations.
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
integer(intg), parameter, public boundary_condition_moved_wall
The dof is fixed as a boundary condition.
subroutine, public solvers_create_finish(SOLVERS, ERR, ERROR,)
Finish the creation of solvers.
integer, parameter ptr
Pointer integer kind.
integer(intg), parameter equations_set_laplace_navier_stokes_subtype
integer(intg), parameter second_part_deriv
Second partial derivative i.e., d^2u/ds^2.
subroutine, public equations_mapping_dynamic_variable_type_set(EQUATIONS_MAPPING, DYNAMIC_VARIABLE_TYPE, ERR, ERROR,)
Sets the mapping between a dependent field variable and the equations set dynamic matrices...
integer(intg), parameter problem_quasistatic_navier_stokes_subtype
This module handles pure advection equation routines.
This module contains all coordinate transformation and support routines.
Contains information on the Jacobian matrix for nonlinear problems.
Contains information on the equations mapping i.e., how field variable DOFS are mapped to the rows an...
Contains information about the CellML equations for a solver.
Contains information about the equations in an equations set.
integer(intg), parameter equations_set_gfem_solution_method
Grid-based Finite Element Method solution method.
Contains information for a region.
integer(intg), parameter problem_control_time_loop_type
Time control loop.
integer(intg), parameter problem_setup_control_type
Solver setup for a problem.
This module handles all problem wide constants.
integer(intg), parameter solver_equations_first_order_dynamic
Solver equations are first order dynamic.
integer(intg), parameter, public control_loop_node
The identifier for a each "leaf" node in a control loop.
Returns the transpose of a matrix A in A^T.
subroutine, public solver_dynamic_order_set(SOLVER, ORDER, ERR, ERROR,)
Sets/changes the order for a dynamic solver.
integer(intg), parameter no_global_deriv
No global derivative i.e., u.
subroutine, public advection_pre_solve(SOLVER, ERR, ERROR,)
Sets up the Poisson problem pre solve.
subroutine, public control_loop_maximum_iterations_set(CONTROL_LOOP, MAXIMUM_ITERATIONS, ERR, ERROR,)
Sets the maximum number of iterations for a while or load increment control loop. ...
Converts a number to its equivalent varying string representation.
subroutine, public equations_create_start(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Start the creation of equations for the equation set.
Contains information on the mesh decomposition.
integer(intg), parameter equations_set_constitutive_mu_navier_stokes_subtype
integer(intg), parameter equations_set_stokes_equation_two_dim_3
u=tbd
subroutine, public control_loop_sub_loop_get(CONTROL_LOOP, SUB_LOOP_INDEX, SUB_LOOP, ERR, ERROR,)
Gets/returns a pointer to the sub loops as specified by the sub loop index for a control loop...
subroutine, public equations_matrices_create_start(EQUATIONS, EQUATIONS_MATRICES, ERR, ERROR,)
Starts the creation of the equations matrices and rhs for the the equations.
Contains information on the type of solver to be used.
integer(intg), parameter, public solver_petsc_library
PETSc solver library.
real(dp), parameter pi
The double precision value of pi.
subroutine, public solvers_number_set(SOLVERS, NUMBER_OF_SOLVERS, ERR, ERROR,)
Sets/changes the number of solvers.
integer(intg), parameter no_part_deriv
No partial derivative i.e., u.
subroutine, public solver_dae_time_step_set(SOLVER, TIME_STEP, ERR, ERROR,)
Set/change the (initial) time step size for a differential-algebraic equation solver.
integer(intg), parameter, public solver_dynamic_crank_nicolson_scheme
Crank-Nicolson dynamic solver.
subroutine, public solver_dynamic_degree_set(SOLVER, DEGREE, ERR, ERROR,)
Sets/changes the degree of the polynomial used to interpolate time for a dynamic solver.
This module handles all equations matrix and rhs routines.
integer(intg), parameter, public solver_dynamic_first_order
Dynamic solver has first order terms.
integer(intg), parameter equations_set_navier_stokes_equation_two_dim_4
u=tbd
integer(intg), parameter equations_set_navier_stokes_equation_splint_from_file
Spline integration of dependent values specified in a file.
subroutine, public solver_type_set(SOLVER, SOLVE_TYPE, ERR, ERROR,)
Sets/changes the type for a solver.
integer(intg), parameter equations_static
The equations are static and have no time dependence.
integer(intg), parameter equations_set_navier_stokes_equation_two_dim_1
u=tbd
Contains information on an equations set.
This module handles all equations routines.
integer(intg), parameter, public solver_dae_type
A differential-algebraic equation solver.
integer(intg), parameter equations_set_setup_source_type
Source setup.
integer(intg), parameter equations_set_navier_stokes_equation_one_dim_1
u=tbd
Contains information on the fields defined on a region.
This module contains all string manipulation and transformation routines.
subroutine, public solvers_create_start(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Start the creation of a solvers for the control loop.
Contains information on the solvers to be used in a control loop.
integer(intg), parameter problem_control_simple_type
Simple, one iteration control loop.
integer(intg), parameter equations_set_navier_stokes_equation_flowrate_olufsen
A fourier decomposed flow waveform for boundary conditions.
integer(intg), parameter first_part_deriv
First partial derivative i.e., du/ds.
subroutine, public solver_dynamic_linearity_type_set(SOLVER, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for the dynamic solver.
subroutine, public solver_newton_cellml_solver_get(SOLVER, CELLML_SOLVER, ERR, ERROR,)
Returns the CellML solver associated with a Newton solver.
This module contains routines for timing the program.
subroutine, public control_loop_current_times_get(CONTROL_LOOP, CURRENT_TIME, TIME_INCREMENT, ERR, ERROR,)
Gets the current time parameters for a time control loop.
subroutine, public fluidmechanics_io_updateboundaryconditionupdatenodes(GeometricField, SolverType, InletNodes, BoundaryValues, BoundaryCondition, Option, Time, StopTime)
Updates the boundary condition for a given node and component.
integer(intg), parameter, public basis_simplex_type
Simplex basis type.
integer(intg), parameter solver_equations_static
Solver equations are static.
integer(intg), parameter problem_laplace_navier_stokes_subtype
integer(intg), parameter part_deriv_s2
First partial derivative in the s2 direction i.e., du/ds2.
subroutine, public equations_time_dependence_type_set(EQUATIONS, TIME_DEPENDENCE_TYPE, ERR, ERROR,)
Sets/changes the time dependence type for equations.
subroutine, public spline_cubic_val(n, t, y, ypp, tval, yval, ypval, yppval, err, error,)
Evaluates a cubic spline at a specified point. First call spline_cubic_set to calculate derivatives a...
subroutine, public solver_equations_sparsity_type_set(SOLVER_EQUATIONS, SPARSITY_TYPE, ERR, ERROR,)
Sets/changes the sparsity type for solver equations.
This module handles all analytic analysis routines.
integer(intg), parameter equations_set_navier_stokes_equation_three_dim_3
u=tbd
subroutine, public spline_cubic_set(n, t, y, ibcbeg, ybcbeg, ibcend, ybcend, ypp, err, error,)
Calculates second derivatives of a cubic spline function for a tabulated function y(x)...
This module contains all mathematics support routines.
subroutine, public solvers_solver_get(SOLVERS, SOLVER_INDEX, SOLVER, ERR, ERROR,)
Returns a pointer to the specified solver in the list of solvers.
Contains information for a field defined on a region.
integer(intg), parameter, public equations_matrices_full_matrices
Use fully populated equation matrices.
integer(intg), parameter equations_set_navier_stokes_equation_two_dim_5
u=tbd
integer(intg), parameter problem_coupled1d0d_navier_stokes_subtype
integer(intg), parameter equations_set_fluid_mechanics_class
subroutine, public equations_mapping_rhs_variable_type_set(EQUATIONS_MAPPING, RHS_VARIABLE_TYPE, ERR, ERROR,)
Sets the mapping between a dependent field variable and the equations set rhs vector.
integer(intg), parameter solver_equations_linear
Solver equations are linear.
integer(intg), parameter global_deriv_s2
First global derivative in the s2 direction i.e., du/ds2.
Contains information on a control loop.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
subroutine, public solver_equations_create_finish(SOLVER_EQUATIONS, ERR, ERROR,)
Finishes the process of creating solver equations.
integer(intg), parameter, public solver_sparse_matrices
Use sparse solver matrices.
subroutine, public solver_equations_create_start(SOLVER, SOLVER_EQUATIONS, ERR, ERROR,)
Starts the process of creating solver equations.
integer(intg), parameter, public solver_dynamic_type
A dynamic solver.
integer(intg), parameter equations_set_stokes_equation_three_dim_4
u=tbd
integer(intg), parameter, public basis_default_quadrature_scheme
Identifier for the default quadrature scheme.
integer(intg), parameter, public boundary_condition_fixed_stree
The dof is fixed and set to values specified based on the transmission line theory at the dof...
integer(intg), parameter problem_setup_solvers_type
Solver setup for a problem.
integer(intg), parameter equations_set_setup_equations_type
Equations setup.
Contains information for mapping field variables to the dynamic matrices in the equations set of the ...
integer(intg), parameter equations_set_ale_navier_stokes_subtype
This module handles all Stree equation routines.
integer(intg), parameter equations_set_setup_independent_type
Independent variables.
This module contains all program wide constants.
integer(intg), parameter solver_equations_nonlinear
Solver equations are nonlinear.
subroutine, public solver_library_type_set(SOLVER, SOLVER_LIBRARY_TYPE, ERR, ERROR,)
Sets/changes the type of library type to use for the solver.
integer(intg), parameter, public boundary_condition_fixed_inlet
The dof is fixed as a boundary condition.
integer(intg), parameter part_deriv_s1
First partial derivative in the s1 direction i.e., du/ds1.
Flags a warning to the user.
subroutine, public equationsmapping_linearmatricesnumberset(EQUATIONS_MAPPING, NUMBER_OF_LINEAR_EQUATIONS_MATRICES, ERR, ERROR,)
Sets/changes the number of linear equations matrices.
integer(intg), parameter equations_set_navier_stokes_equation_sinusoid
A sinusoidal flow waveform.
integer(intg), parameter problem_transient1d_navier_stokes_subtype
subroutine, public control_loop_times_get(CONTROL_LOOP, START_TIME, STOP_TIME, CURRENT_TIME, TIME_INCREMENT, CURRENT_LOOP_ITERATION, OUTPUT_ITERATION_NUMBER, ERR, ERROR,)
Gets the current time parameters for a time control loop.
integer(intg), parameter equations_set_navier_stokes_equation_two_dim_taylor_green
2D dynamic nonlinear Taylor-Green vortex decay
Contains the information for a face in a decomposition.
integer(intg), parameter equations_set_navier_stokes_equation_flowrate_aorta
A fourier decomposed flow waveform for boundary conditions.
integer(intg), parameter equations_set_navier_stokes_equation_two_dim_poiseuille
fully developed 2D channel flow (parabolic), u=u_max(1-y^2/H^2)
integer(intg), parameter equations_set_stokes_equation_two_dim_2
u=tbd
integer(intg), parameter equations_set_navier_stokes_equation_three_dim_5
u=tbd
integer(intg), parameter problem_setup_initial_type
Initial setup for a problem.
integer(intg), parameter, public boundary_condition_fixed_nonreflecting
The dof is fixed and set to a non-reflecting type for 1D wave propagation problems.
Contains the interpolated point coordinate metrics. Old CMISS name GL,GU,RG.
Contains the topology information for the elements of a domain.
integer(intg), parameter problem_ale_navier_stokes_subtype
subroutine, public equationsmapping_linearmatricesvariabletypesset(EQUATIONS_MAPPING, LINEAR_MATRIX_VARIABLE_TYPES, ERR, ERROR,)
Sets the mapping between the dependent field variable types and the linear equations matrices...
subroutine, public fluid_mechanics_io_read_data(SOLVER_TYPE, INPUT_VALUES, NUMBER_OF_DIMENSIONS, INPUT_TYPE, INPUT_OPTION, TIME_STEP, LENGTH_SCALE)
Reads input data from a file.
integer(intg), parameter equations_set_stokes_equation_two_dim_4
u=tbd
integer(intg), parameter, public boundary_condition_free
The dof is free.
Contains information for a nonlinear solver.
integer(intg), parameter problem_navier_stokes_equation_type
subroutine, public characteristic_extrapolate(solver, currentTime, timeIncrement, ERR, ERROR,)
Extrapolate W for branch nodes and boundaries .
integer(intg), parameter equations_first_order_dynamic
The equations are first order dynamic.
Contains information on the boundary conditions for a dependent field variable.
integer(intg), parameter solver_equations_quasistatic
Solver equations are quasistatic.
subroutine, public solver_equations_linearity_type_set(SOLVER_EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for solver equations.
integer(intg), parameter equations_set_setup_start_action
Start setup action.
subroutine, public cellml_equations_create_start(SOLVER, CELLML_EQUATIONS, ERR, ERROR,)
Starts the process of creating CellML equations.
Sets the storage type (sparsity) of the nonlinear (Jacobian) equations matrices.
subroutine, public exits(NAME)
Records the exit out of the named procedure.
recursive subroutine, public control_loop_solvers_get(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Returns a pointer to the solvers for a control loop.
integer(intg), parameter equations_set_mooney_rivlin_subtype
This module contains all type definitions in order to avoid cyclic module references.
subroutine, public solver_cellml_equations_get(SOLVER, CELLML_EQUATIONS, ERR, ERROR,)
Returns a pointer to the CellML equations for a solver.
integer(intg), parameter, public boundary_condition_fixed_outlet
The dof is fixed as a boundary condition.
integer(intg), parameter equations_set_elasticity_class
integer(intg), parameter equations_set_coupled1d0d_navier_stokes_subtype
Contains information on the equations mapping for nonlinear matrices i.e., how a field variable is ma...
Contains information on the equations matrices and vectors.
integer(intg), parameter, public equations_matrix_fem_structure
Finite element matrix structure.
integer(intg), parameter part_deriv_s3
First partial derivative in the s3 direction i.e., du/ds3.
integer(intg), parameter problem_multiscale_navier_stokes_subtype
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
Contains information of the linear matrices for equations matrices.
integer(intg), parameter, public general_output_type
General output type.
subroutine, public equationsmatrices_dynamicstructuretypeset(EQUATIONS_MATRICES, STRUCTURE_TYPE, ERR, ERROR,)
Sets the structure (sparsity) of the dynamic equations matrices.
Contains information on the solver matrix.
integer(intg), parameter part_deriv_s1_s1
Second partial derivative in the s1 direction i.e., d^2u/ds1ds1.
integer(intg), parameter equations_set_stokes_equation_three_dim_2
u=tbd
This module contains the interface descriptions to the LAPACK routines.
subroutine, public equations_matrices_linear_storage_type_set(EQUATIONS_MATRICES, STORAGE_TYPE, ERR, ERROR,)
Sets the storage type (sparsity) of the linear equations matrices.
subroutine, public equationsmatrices_linearstructuretypeset(EQUATIONS_MATRICES, STRUCTURE_TYPE, ERR, ERROR,)
Sets the structure (sparsity) of the linear equations matrices.
subroutine, public equations_mapping_create_finish(EQUATIONS_MAPPING, ERR, ERROR,)
Finishes the process of creating an equations mapping.
integer(intg), parameter equations_set_stokes_equation_three_dim_3
u=tbd
subroutine, public controlloop_absolutetoleranceset(controlLoop, absoluteTolerance, err, error,)
Sets the absolute tolerance (convergence condition tolerance) for a while control loop...
Returns the specified control loop as indexed by the control loop identifier from the control loop ro...
subroutine, public control_loop_type_set(CONTROL_LOOP, LOOP_TYPE, ERR, ERROR,)
Sets/changes the control loop type.
integer(intg), parameter problem_multi_physics_class
integer(intg), parameter equations_set_navier_stokes_equation_three_dim_2
u=tbd
integer(intg), parameter problem_coupled1d0d_adv_navier_stokes_subtype
integer(intg), parameter equations_set_stokes_equation_three_dim_1
u=tbd
integer(intg), parameter equations_set_quasistatic_navier_stokes_subtype
integer(intg), parameter part_deriv_s2_s3
Cross derivative in the s2 and s3 direction i.e., d^2u/ds2ds3.
integer(intg), parameter equations_set_navier_stokes_equation_two_dim_3
u=tbd
integer(intg), parameter, public solver_nonlinear_type
A nonlinear solver.
integer(intg), parameter equations_set_navier_stokes_equation_three_dim_4
u=tbd
integer(intg), parameter equations_set_static_navier_stokes_subtype
integer(intg), parameter, public equations_jacobian_analytic_calculated
Use an analytic Jacobian evaluation.
integer(intg), parameter part_deriv_s1_s3
Cross derivative in the s1 and s3 direction i.e., d^2u/ds1ds3.
subroutine, public equations_set_equations_get(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Gets the equations for an equations set.
This module contains all computational environment variables.
integer(intg), parameter equations_set_navier_stokes_equation_flowrate_heart
A fourier decomposed flow waveform for boundary conditions.
integer(intg), parameter, public solver_cellml_evaluator_type
A CellML evaluation solver.
Sets the structure (sparsity) of the nonlinear (Jacobian) equations matrices.
This module contains CMISS MPI routines.
integer(intg), dimension(4) partial_derivative_first_derivative_map
PARTIAL_DERIVATIVE_FIRST_DERIVATIVE_MAP(nic) gives the partial derivative index for the first derivat...
subroutine, public equations_create_finish(EQUATIONS, ERR, ERROR,)
Finish the creation of equations.
Contains information on a do-while control loop.
This module handles all domain mappings routines.
integer(intg), parameter problem_setup_finish_action
Finish setup action.
integer(intg), parameter, public boundary_condition_fixed_cellml
The dof is fixed and set to values specified based on the coupled CellML solution at the dof...
This module handles all equations mapping routines.
Contains information about the solver equations for a solver.
integer(intg), parameter, public matrix_compressed_row_storage_type
Matrix compressed row storage type.
subroutine, public equations_matrices_dynamic_storage_type_set(EQUATIONS_MATRICES, STORAGE_TYPE, ERR, ERROR,)
Sets the storage type (sparsity) of the dynamic equations matrices.
subroutine, public stree_pre_solve(solver, err, error,)
Evaluates the residual nodal stiffness matrices and RHS for a Stree equation nodal equations set...
type(computational_environment_type), target, public computational_environment
The computational environment the program is running in.
Contains information on the analytic setup for the equations set.
integer(intg), parameter equations_set_static_rbs_navier_stokes_subtype
subroutine, public solver_newton_cellml_evaluator_create(SOLVER, CELLML_SOLVER, ERR, ERROR,)
Create a CellML evaluator solver for the Newton solver.
integer(intg), parameter equations_set_gfv_solution_method
Grid-based Finite Volume solution method.
Contains information on the geometry for an equations set.
integer(intg), parameter equations_set_setup_geometry_type
Geometry setup.
integer(intg), parameter global_deriv_s1_s2
Global Cross derivative in the s1 and s2 direction i.e., d^2u/ds1ds2.
Contains information for a problem.
integer(intg), parameter problem_setup_cellml_equations_type
CellML equations setup for a problem.
integer(intg), parameter problem_pgm_navier_stokes_subtype
subroutine, public analyticanalysis_output(FIELD, FILENAME, ERR, ERROR,)
Output the analytic error analysis for a dependent field compared to the analytic values parameter se...
Contains the topology information for the nodes of a domain.
integer(intg), parameter equations_set_transient1d_navier_stokes_subtype
subroutine, public equations_matrices_create_finish(EQUATIONS_MATRICES, ERR, ERROR,)
Finishes the creation of the equations matrices and RHS for the the equations.
integer(intg), parameter equations_set_transient_rbs_navier_stokes_subtype
integer(intg), parameter, public basis_lagrange_hermite_tp_type
Lagrange-Hermite tensor product basis type.
integer(intg), parameter, public solver_dynamic_linear
Dynamic solver has linear terms.
This module handles all distributed matrix vector routines.
This module handles all Navier-Stokes fluid routines.
integer(intg), parameter problem_transient_rbs_navier_stokes_subtype
integer(intg), parameter global_deriv_s1
First global derivative in the s1 direction i.e., du/ds1.
This module handles all boundary conditions routines.
This module handles all solver routines.
subroutine, public equations_mapping_create_start(EQUATIONS, EQUATIONS_MAPPING, ERR, ERROR,)
Finishes the process of creating an equations mapping for a equations set equations.
Contains the interpolated value (and the derivatives wrt xi) of a field at a point. Old CMISS name XG.
Contains information about an equations matrix.
integer(intg), parameter equations_set_finite_elasticity_type
integer(intg), parameter problem_finite_elasticity_navier_stokes_ale_subtype
Contains information for a particular quadrature scheme.
subroutine, public solver_linked_solver_add(SOLVER, SOLVER_TO_LINK, SOLV_TYPE, ERR, ERROR,)
Adds a linked solver to the solver. Also sets the solver type for the linked solver, als well as its linking solver.
integer(intg), parameter problem_finite_elasticity_navier_stokes_type
integer(intg), parameter equations_set_transient1d_adv_navier_stokes_subtype
Implements lists of Field IO operation.
This module contains all routines dealing with (non-distributed) matrix and vectors types...
subroutine, public equations_linearity_type_set(EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for equations.
subroutine, public control_loop_create_start(PROBLEM, CONTROL_LOOP, ERR, ERROR,)
Start the process of creating a control loop for a problem.
integer(intg), parameter equations_set_stokes_equation_two_dim_1
u=tbd
integer(intg), parameter problem_transient_navier_stokes_subtype
integer(intg), parameter problem_setup_solver_equations_type
Solver equations setup for a problem.
integer(intg), parameter, public diagnostic_output_type
Diagnostic output type.
Sets a boundary condition on the specified local DOF.
Contains information on the solver mapping between the global equation sets and the solver matrices...
Contains information on the dependent variables for the equations set.
subroutine, public solver_dynamic_scheme_set(SOLVER, SCHEME, ERR, ERROR,)
Sets/changes the scheme for a dynamic solver.
integer(intg), parameter equations_set_stokes_equation_two_dim_5
u=tbd
integer(intg), parameter equations_set_navier_stokes_equation_three_dim_1
u=tbd
integer(intg), parameter part_deriv_s1_s2
Cross derivative in the s1 and s2 direction i.e., d^2u/ds1ds2.
integer(intg), parameter part_deriv_s2_s2
Second partial derivative in the s2 direction i.e., d^2u/ds2ds2.
Contains information on the solver matrices and rhs vector.
integer(intg), parameter equations_set_coupled1d0d_adv_navier_stokes_subtype
Contains information for a field variable defined on a field.
subroutine, public cellml_equations_create_finish(CELLML_EQUATIONS, ERR, ERROR,)
Finishes the process of creating CellML equations.
integer(intg), parameter, public solver_dynamic_nonlinear
Dynamic solver has nonlinear terms.
integer(intg), parameter equations_set_pgm_navier_stokes_subtype
integer(intg), parameter equations_set_fd_solution_method
Finite Difference solution method.
integer(intg), parameter, public equations_matrices_sparse_matrices
Use sparse equations matrices.
This module handles all characteristic equation routines.
subroutine, public fluid_mechanics_io_write_encas(REGION, EQUATIONS_SET_GLOBAL_NUMBER, NAME, ERR, ERROR,)
Writes solution into encas.
integer(intg), parameter part_deriv_s3_s3
Second partial derivative in the s3 direction i.e., d^2u/ds3ds3.
Contains information on the domain mappings (i.e., local and global numberings).
Contains the parameters required to interpolate a field variable within an element. Old CMISS name XE.
Contains information on the setup information for an equations set.
integer(intg), parameter problem_stree1d0d_navier_stokes_subtype
A pointer to the domain decomposition for this domain.
integer(intg), parameter problem_setup_start_action
Start setup action.
integer(intg), parameter, public boundary_condition_fixed_fitted
The dof is fixed as a boundary condition to be updated from fitting data.
Contains information of the nolinear matrices and vectors for equations matrices. ...
integer(intg), parameter problem_transient1d_adv_navier_stokes_subtype
integer(intg), parameter equations_set_multiscale3d_navier_stokes_subtype
subroutine, public solver_equations_time_dependence_type_set(SOLVER_EQUATIONS, TIME_DEPENDENCE_TYPE, ERR, ERROR,)
Sets/changes the time dependence type for solver equations.
integer(intg), parameter equations_set_compressible_finite_elasticity_subtype
This module handles all control loop routines.
integer(intg), parameter, public solver_cmiss_library
CMISS (internal) solver library.
Calculates and returns the matrix-product A*B in the matrix C.
subroutine, public equationsmatrices_jacobiantypesset(equationsMatrices, jacobianTypes, err, error,)
Sets the Jacobian calculation types of the residual variables.
integer(intg), parameter, public boundary_condition_fixed
The dof is fixed as a boundary condition.
integer(intg), parameter problem_optimised_navier_stokes_subtype
integer(intg), parameter equations_set_navier_stokes_equation_two_dim_2
u=tbd
subroutine, public errors(NAME, ERR, ERROR)
Records the exiting error of the subroutine.
This module defines all constants shared across equations set routines.
integer(intg), parameter equations_set_optimised_navier_stokes_subtype
integer(intg), parameter equations_set_bem_solution_method
Boundary Element Method solution method.
subroutine, public solver_solver_equations_get(SOLVER, SOLVER_EQUATIONS, ERR, ERROR,)
Returns a pointer to the solver equations for a solver.
subroutine, public fluid_mechanics_io_read_boundary_conditions(SOLVER_TYPE, BOUNDARY_VALUES, NUMBER_OF_DIMENSIONS, BOUNDARY_CONDITION, OPTION, TIME_STEP, TIME, LENGTH_SCALE)
Reads boundary conditions from a file.
subroutine, public boundary_conditions_variable_get(BOUNDARY_CONDITIONS, FIELD_VARIABLE, BOUNDARY_CONDITIONS_VARIABLE, ERR, ERROR,)
Find the boundary conditions variable for a given field variable.
Contains all information about a basis .
integer(intg), parameter equations_set_fv_solution_method
Finite Volume solution method.
integer(intg), parameter, public matrix_block_storage_type
Matrix block storage type.
integer(intg), parameter, public coordinate_jacobian_volume_type
Volume type Jacobian.
Returns the L2 norm of a vector.
integer(intg), parameter, public solver_dynamic_first_degree
Dynamic solver uses a first degree polynomial for time interpolation.
integer(intg), parameter equations_set_setup_initial_type
Initial setup.
recursive subroutine, public control_loop_create_finish(CONTROL_LOOP, ERR, ERROR,)
Finish the process of creating a control loop.
integer(intg), parameter, public boundary_condition_pressure
The dof is a surface pressure boundary condition.
subroutine, public equationsmapping_residualvariabletypesset(EQUATIONS_MAPPING, RESIDUAL_VARIABLE_TYPES, ERR, ERROR,)
Sets the mapping between a dependent field variable and the equations set residual vector...
subroutine, public control_loop_number_of_sub_loops_set(CONTROL_LOOP, NUMBER_OF_SUB_LOOPS, ERR, ERROR,)
Sets/changes the number of sub loops in a control loop.
integer(intg), parameter problem_static_navier_stokes_subtype
integer(intg), parameter equations_quasistatic
The equations are quasi-static.
integer(intg), parameter equations_set_setup_analytic_type
Analytic setup.
subroutine, public solver_dae_times_set(SOLVER, START_TIME, END_TIME, ERR, ERROR,)
Set/change the times for a differential-algebraic equation solver.
Flags an error condition.
integer(intg), parameter equations_set_nodal_solution_method
Similar to Finite Element Method with looping over nodes instead of elements.
integer(intg), parameter problem_stree1d0d_adv_navier_stokes_subtype
integer(intg), parameter problem_control_while_loop_type
While control loop.
integer(intg), parameter equations_set_transient_navier_stokes_subtype
integer(intg), parameter, public solver_linear_type
A linear solver.
integer(intg), parameter problem_fluid_mechanics_class
Contains information of the RHS vector for equations matrices.
subroutine, public field_io_elements_export(FIELDS, FILE_NAME, METHOD, ERR, ERROR,)
Export elemental information into multiple files.
integer(intg), parameter equations_nonlinear
The equations are non-linear.
real(dp), parameter zero_tolerance
recursive subroutine, public solver_solve(SOLVER, ERR, ERROR,)
Solve the problem.
integer(intg), parameter equations_set_stokes_equation_three_dim_5
u=tbd
Contains information for mapping field variables to the linear matrices in the equations set of the m...
This module contains all kind definitions.
Temporary IO routines for fluid mechanics.
subroutine, public field_io_nodes_export(FIELDS, FILE_NAME, METHOD, ERR, ERROR,)
Export nodal information.
Contains the information for an element in a decomposition.
integer(intg), parameter equations_set_setup_finish_action
Finish setup action.
integer(intg), parameter, public distributed_matrix_compressed_row_storage_type
Distributed matrix compressed row storage type.
Contains information of the dynamic matrices for equations matrices.
integer(intg), parameter equations_set_navier_stokes_equation_type
subroutine, public mpi_error_check(ROUTINE, MPI_ERR_CODE, ERR, ERROR,)
Checks to see if an MPI error has occured during an MPI call and flags a CMISS error it if it has...