collapsible_channel_domain.h
Go to the documentation of this file.
1// LIC// ====================================================================
2// LIC// This file forms part of oomph-lib, the object-oriented,
3// LIC// multi-physics finite-element library, available
4// LIC// at http://www.oomph-lib.org.
5// LIC//
6// LIC// Copyright (C) 2006-2025 Matthias Heil and Andrew Hazel
7// LIC//
8// LIC// This library is free software; you can redistribute it and/or
9// LIC// modify it under the terms of the GNU Lesser General Public
10// LIC// License as published by the Free Software Foundation; either
11// LIC// version 2.1 of the License, or (at your option) any later version.
12// LIC//
13// LIC// This library is distributed in the hope that it will be useful,
14// LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// LIC// Lesser General Public License for more details.
17// LIC//
18// LIC// You should have received a copy of the GNU Lesser General Public
19// LIC// License along with this library; if not, write to the Free Software
20// LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21// LIC// 02110-1301 USA.
22// LIC//
23// LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24// LIC//
25// LIC//====================================================================
26// Include guards
27#ifndef OOMPH_COLLAPSIBLE_CHANNEL_DOMAIN_HEADER
28#define OOMPH_COLLAPSIBLE_CHANNEL_DOMAIN_HEADER
29
30// Generic oomph-lib includes
31#include "generic/quadtree.h"
32#include "generic/domain.h"
33#include "generic/geom_objects.h"
34
35namespace oomph
36{
37 //==================================================================
38 /// Collapsible channel domain
39 //==================================================================
40 class CollapsibleChannelDomain : public Domain
41 {
42 public:
43 /// Constructor: Pass the number of (macro-)elements,
44 /// the domain lengths in the x- and y-direction
45 /// and the pointer to the geometric object that specifies
46 /// the shape of the "collapsible" segment.
48 const unsigned& ncollapsible,
49 const unsigned& ndown,
50 const unsigned& ny,
51 const double& lup,
52 const double& lcollapsible,
53 const double& ldown,
54 const double& ly,
59 {
60 Nup = nup;
62 Ndown = ndown;
63 Ny = ny;
64 Lup = lup;
66 Ldown = ldown;
67 Ly = ly;
69
70 // Total number of macro elements
71 unsigned nmacro = (Nup + Ncollapsible + Ndown) * Ny;
72
73 // Build the macro elements
75 for (unsigned i = 0; i < nmacro; i++)
76 {
78 }
79 }
80
81 /// Destructor: emtpy; cleanup done in base class
83
84 /// Number of vertical columns of macro elements the upstream section
85 unsigned nup()
86 {
87 return Nup;
88 }
89
90 /// Number of vertical clumns of macro elements in the "collapsible" segment
91 unsigned ncollapsible()
92 {
93 return Ncollapsible;
94 }
95
96 /// Number of vertical columns of macro elements in the downstream section
97 unsigned ndown()
98 {
99 return Ndown;
100 }
101
102 /// Number of macro-elements across the channel
103 unsigned ny()
104 {
105 return Ny;
106 }
107
108 /// Length of upstream section
109 double l_up()
110 {
111 return Lup;
112 }
113
114 /// Length of collapsible segment
116 {
117 return Lcollapsible;
118 }
119
120 /// Length of downstream section
121 double l_down()
122 {
123 return Ldown;
124 }
125
126 /// Width of channel
127 double l_y()
128 {
129 return Ly;
130 }
131
132 /// Access to pointer to the geometric object that parametrises
133 /// the collapsible wall
135 {
136 return Wall_pt;
137 }
138
139
140 /// Access to pointer to the geometric object that parametrises
141 /// the collapsible wall (const version)
143 {
144 return Wall_pt;
145 }
146
147 /// Typedef for function pointer for function that squashes
148 /// the macro elements near the wall to help resolution of any
149 /// wall boundary layers.
150 typedef double (*BLSquashFctPt)(const double& s);
151
152
153 /// Default for function that squashes
154 /// the macro elements near the walls. Identity.
155 static double default_BL_squash_fct(const double& s)
156 {
157 return s;
158 }
159
160 /// Function pointer for function that squashes
161 /// the macro elements near wall. Default mapping (identity)
162 /// leaves the y-coordinate of the nodal points unchanged.
167
168 /// Function that squashes the macro elements near the wall.
169 /// Input argument should vary between 0 and 1; function should return
170 /// stretched/squashed coordinate in the same range. Default implementation
171 /// is the identity; can be overloaded by specifying a different
172 /// function pointer with bl_squash_fct_pt().
173 double s_squash(const double& s)
174 {
175 return BL_squash_fct_pt(s);
176 }
177
178 /// Typedef for function pointer for function that implements
179 /// axial spacing of macro elements
180 typedef double (*AxialSpacingFctPt)(const double& xi);
181
182 /// Function pointer for function that implements
183 /// axial spacing of macro elements
188
189 /// Function that implements
190 /// axial spacing of macro elements
191 double axial_spacing_fct(const double& xi)
192 {
193 return Axial_spacing_fct_pt(xi);
194 }
195
196
197 /// Vector representation of the imacro-th macro element
198 /// boundary idirect (N/S/W/E) at time level t
199 /// (t=0: present; t>0: previous): \f$ {\bf r}({\bf zeta}) \f$
200 /// Note that the local coordinate \b zeta is a 1D
201 /// Vector rather than a scalar -- this is unavoidable because
202 /// this function implements the pure virtual function in the
203 /// Domain base class.
204 void macro_element_boundary(const unsigned& t,
205 const unsigned& imacro,
206 const unsigned& idirect,
207 const Vector<double>& zeta,
209
211 {
212 Rotate_domain = true;
213 }
214
215 /// Undo rotation of the domain (for axisymmetric problems)
217 {
218 Rotate_domain = false;
219 }
220
221 private:
222 /// Northern boundary of the macro element imacro in the
223 /// upstream (part=0) or downstream (part=1) sections
224 void r_N_straight(const Vector<double>& zeta,
226 const unsigned& imacro,
227 const unsigned& part);
228
229 /// Western boundary of the macro element imacro in the
230 /// upstream (part=0) or downstream (part=1) sections
231 void r_W_straight(const Vector<double>& zeta,
233 const unsigned& imacro,
234 const unsigned& part);
235
236 /// Southern boundary of the macro element imacro in the
237 /// upstream (part=0) or downstream (part=1) sections
238 void r_S_straight(const Vector<double>& zeta,
240 const unsigned& imacro,
241 const unsigned& part);
242
243 /// Eastern boundary of the macro element imacro in the
244 /// upstream (part=0) or downstream (part=1) sections
245 void r_E_straight(const Vector<double>& zeta,
247 const unsigned& imacro,
248 const unsigned& part);
249
250 /// Northern boundary of the macro element imacro in the collapsible
251 /// section
252 void r_N_collapsible(const unsigned& t,
253 const Vector<double>& zeta,
255 const unsigned& imacro);
256
257 /// Western boundary of the macro element imacro in the collapsible
258 /// section
259 void r_W_collapsible(const unsigned& t,
260 const Vector<double>& zeta,
262 const unsigned& imacro);
263
264 /// Southern boundary of the macro element imacro in the collapsible
265 /// section
266 void r_S_collapsible(const unsigned& t,
267 const Vector<double>& zeta,
269 const unsigned& imacro);
270
271 /// Eastern boundary of the macro element imacro in the collapsible
272 /// section
273 void r_E_collapsible(const unsigned& t,
274 const Vector<double>& zeta,
276 const unsigned& imacro);
277
278
279 /// Function pointer for function that squashes
280 /// the macro elements near the walls
282
283 /// Function pointer for function that implements
284 /// axial spacing of macro elements
286
287 /// Default for function that implements
288 /// axial spacing of macro elements
289 static double default_axial_spacing_fct(const double& xi)
290 {
291 return xi;
292 }
293
294 /// Number of vertical element columns in upstream section
295 unsigned Nup;
296
297 /// Number of vertical element columns in "collapsible" section
298 unsigned Ncollapsible;
299
300 /// Number of vertical element columns in downstream section
301 unsigned Ndown;
302
303 /// Number of macro elements across channel
304 unsigned Ny;
305
306 /// x-length in the upstream part of the channel
307 double Lup;
308
309 /// x-length in the "collapsible" part of the channel
311
312 /// x-length in the downstream part of the channel
313 double Ldown;
314
315 /// Width
316 double Ly;
317
318 /// Pointer to the geometric object that parametrises the collapsible wall
320
321 /// Rotate domain (for axisymmetric problems, say)
323 };
324
325
326 /////////////////////////////////////////////////////////////////////////
327 /////////////////////////////////////////////////////////////////////////
328 /////////////////////////////////////////////////////////////////////////
329
330 //===================================================================
331 /// Vector representation of the imacro-th macro element
332 /// boundary idirect (N/S/W/E) at time level t
333 /// (t=0: present; t>0: previous): \f$ {\bf r}({\bf zeta}) \f$
334 /// Note that the local coordinate \b zeta is a 1D
335 /// Vector rather than a scalar -- this is unavoidable because
336 /// this function implements the pure virtual function in the
337 /// Domain base class.
338 //=================================================================
340 const unsigned& t,
341 const unsigned& imacro,
342 const unsigned& idirect,
343 const Vector<double>& zeta,
345 {
346 using namespace QuadTreeNames;
347
348#ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
349 // Warn about time argument being moved to the front
351 "Order of function arguments has changed between versions 0.8 and 0.85",
352 "CollapsibleChannelDomain::macro_element_boundary(...)",
354#endif
355
356 // Total number of vertical columns of (macro-)elements
357 unsigned n_x = Nup + Ncollapsible + Ndown;
358
359 // Which direction?
360 if (idirect == N)
361 {
362 // Upstream part of the channel
363 if ((imacro % n_x) < Nup)
364 {
366 }
367 // Downstream part of channel
368 else if ((imacro % n_x) >= Nup + Ncollapsible)
369 {
371 }
372 // Collapsible segment
373 else if (((imacro % n_x) < Nup + Ncollapsible) && ((imacro % n_x) >= Nup))
374 {
376 }
377 else
378 {
379 std::ostringstream error_stream;
380 error_stream << "Never get here! imacro, idirect: " << imacro << " "
381 << idirect << std::endl;
382
383 throw OomphLibError(
385 }
386 }
387 else if (idirect == S)
388 {
389 // Upstream part
390 if ((imacro % n_x) < Nup)
391 {
393 }
394 // Downstream part
395 else if ((imacro % n_x) >= Nup + Ncollapsible)
396 {
398 }
399 // "Collapsible" bit
400 else if (((imacro % n_x) < Nup + Ncollapsible) && ((imacro % n_x) >= Nup))
401 {
403 }
404 else
405 {
406 std::ostringstream error_stream;
407 error_stream << "Never get here! imacro, idirect: " << imacro << " "
408 << idirect << std::endl;
409
410 throw OomphLibError(
412 }
413 }
414 else if (idirect == E)
415 {
416 // Upstream bit
417 if ((imacro % n_x) < Nup)
418 {
420 }
421 // Downstream bit
422 else if ((imacro % n_x) >= Nup + Ncollapsible)
423 {
425 }
426 // "Collapsible" bit
427 else if (((imacro % n_x) < Nup + Ncollapsible) && ((imacro % n_x) >= Nup))
428 {
430 }
431 else
432 {
433 std::ostringstream error_stream;
434 error_stream << "Never get here! imacro, idirect: " << imacro << " "
435 << idirect << std::endl;
436
437 throw OomphLibError(
439 }
440 }
441
442 else if (idirect == W)
443 {
444 // Upstream bit
445 if ((imacro % n_x) < Nup)
446 {
448 }
449 // Downstream bit
450 else if ((imacro % n_x) >= Nup + Ncollapsible)
451 {
453 }
454 // "Collapsible" bit
455 else if (((imacro % n_x) < Nup + Ncollapsible) && ((imacro % n_x) >= Nup))
456 {
458 }
459 else
460 {
461 std::ostringstream error_stream;
462 error_stream << "Never get here! imacro, idirect: " << imacro << " "
463 << idirect << std::endl;
464
465 throw OomphLibError(
467 }
468 }
469
470 // Rotate?
471 if (Rotate_domain)
472 {
473 double radius = r[1];
474 double z = r[0];
475
476 r[0] = radius;
477 r[1] = -z;
478 }
479 }
480
481 //===========================================================================
482 /// Western edge of the macro element in the upstream (part=0)
483 /// or downstream (part=1) parts of the channel; \f$ \zeta \in [-1,1] \f$
484 //===========================================================================
487 const unsigned& imacro,
488 const unsigned& part)
489 {
490 // Determines the "coordinates" of the macro-element
491 unsigned x = unsigned(imacro % (Nup + Ncollapsible + Ndown));
492 unsigned y = unsigned(double(imacro) / double(Nup + Ncollapsible + Ndown));
493
494 // Where are we?
495 switch (part)
496 {
497 case 0: // in the upstream part of the channel
498
499 // Parametrize the boundary
500 r[0] = axial_spacing_fct(double(x) * (Lup / double(Nup)));
501 r[1] = (double(y) + (0.5 * (1.0 + zeta[0]))) * (Ly / double(Ny));
502
503 // Map it via squash fct
504 r[1] = Ly * s_squash(r[1] / Ly);
505
506 break;
507
508 case 1: // in the downstream part of the channel
509
510 // Parametrizes the boundary
511 r[0] = axial_spacing_fct(double(x - Nup - Ncollapsible) *
512 (Ldown / double(Ndown)) +
513 Lup + Lcollapsible);
514 r[1] = (double(y) + (0.5 * (1.0 + zeta[0]))) * (Ly / double(Ny));
515
516 // Map it via squash fct
517 r[1] = Ly * s_squash(r[1] / Ly);
518
519 break;
520
521 default:
522
523 std::ostringstream error_stream;
524 error_stream << "Never get here! part=" << part << std::endl;
525
526 throw OomphLibError(
528 }
529 }
530
531 //===========================================================================
532 /// Eastern edge of the macro element in the straight parts
533 /// of the channel; \f$ \zeta \in [-1,1] \f$
534 /// part=0 in the upstream part, part=1 in the downstream part
535 //===========================================================================
538 const unsigned& imacro,
539 const unsigned& part)
540 {
541 // Determines the "coordinates" of the macro-element
542 unsigned x = unsigned(imacro % (Nup + Ncollapsible + Ndown));
543 unsigned y = unsigned(double(imacro) / double(Nup + Ncollapsible + Ndown));
544
545 // Where are we?
546 switch (part)
547 {
548 case 0: // in the upstream part of the channel
549
550 // Parametrizes the boundary
551 r[0] = axial_spacing_fct((double(x) + 1.0) * (Lup / double(Nup)));
552 r[1] = (double(y) + (0.5 * (1.0 + zeta[0]))) * (Ly / double(Ny));
553
554 // Map it via squash fct
555 r[1] = Ly * s_squash(r[1] / Ly);
556
557 break;
558
559 case 1: // in the downstream part of the channel
560
561 // Parametrizes the boundary
562 r[0] = axial_spacing_fct((double(x - Nup - Ncollapsible) + 1.0) *
563 (Ldown / double(Ndown)) +
564 Lup + Lcollapsible);
565 r[1] = (double(y) + (0.5 * (1.0 + zeta[0]))) * (Ly / double(Ny));
566
567 // Map it via squash fct
568 r[1] = Ly * s_squash(r[1] / Ly);
569
570 break;
571
572 default:
573
574 std::ostringstream error_stream;
575 error_stream << "Never get here! part=" << part << std::endl;
576
577 throw OomphLibError(
579 }
580 }
581
582 //==========================================================================
583 /// Northern edge of the macro element in the straight parts of
584 /// the channel; \f$ \zeta \in [-1,1] \f$
585 /// part=0 in the left part, part=1 in the right part
586 //==========================================================================
589 const unsigned& imacro,
590 const unsigned& part)
591 {
592 // Determines the "coordinates" of the macro-element
593 unsigned x = unsigned(imacro % (Nup + Ncollapsible + Ndown));
594 unsigned y = unsigned(double(imacro) / double(Nup + Ncollapsible + Ndown));
595
596 // Where are we?
597 switch (part)
598 {
599 case 0: // in the upstream part of the channel
600
601 // Parametrizes the boundary
602 r[0] = axial_spacing_fct((double(x) + (0.5 * (1.0 + zeta[0]))) *
603 (Lup / double(Nup)));
604 r[1] = (double(y) + 1.0) * (Ly / double(Ny));
605
606 // Map it via squash fct
607 r[1] = Ly * s_squash(r[1] / Ly);
608
609 break;
610
611 case 1: // in the downstream part of the channel
612
613 // Parametrizes the boundary
614 r[0] = axial_spacing_fct(
615 (double(x - Nup - Ncollapsible) + (0.5 * (1.0 + zeta[0]))) *
616 (Ldown / double(Ndown)) +
617 Lup + Lcollapsible);
618 r[1] = (double(y) + 1.0) * (Ly / double(Ny));
619
620 // Map it via squash fct
621 r[1] = Ly * s_squash(r[1] / Ly);
622
623 break;
624
625 default:
626
627 std::ostringstream error_stream;
628 error_stream << "Never get here! part=" << part << std::endl;
629
630 throw OomphLibError(
632 }
633 }
634
635 //=========================================================================
636 /// Southern edge of the macro element in the straight parts of
637 /// the channel; \f$ \zeta \in [-1,1] \f$
638 /// part=0 in the left part, part=1 in the right part
639 //=========================================================================
642 const unsigned& imacro,
643 const unsigned& part)
644 {
645 // Determines the "coordinates" of the macro-element
646 unsigned x = unsigned(imacro % (Nup + Ncollapsible + Ndown));
647 unsigned y = unsigned(double(imacro) / double(Nup + Ncollapsible + Ndown));
648
649 // Where are we?
650 switch (part)
651 {
652 case 0: // in the upstream bit
653
654 // Parametrizes the boundary
655 r[0] = axial_spacing_fct((double(x) + (0.5 * (1 + zeta[0]))) *
656 (Lup / double(Nup)));
657 r[1] = double(y) * (Ly / double(Ny));
658
659 // Map it via squash fct
660 r[1] = Ly * s_squash(r[1] / Ly);
661
662 break;
663
664 case 1: // in the downstream bit
665
666 // Parametrizes the boundary
667 r[0] = axial_spacing_fct(
668 (double(x - Nup - Ncollapsible) + (0.5 * (1 + zeta[0]))) *
669 (Ldown / double(Ndown)) +
670 Lup + Lcollapsible);
671 r[1] = double(y) * (Ly / double(Ny));
672
673 // Map it via squash fct
674 r[1] = Ly * s_squash(r[1] / Ly);
675
676 break;
677
678 default:
679
680 std::ostringstream error_stream;
681 error_stream << "Never get here! part=" << part << std::endl;
682
683 throw OomphLibError(
685 }
686 }
687
688 //========================================================================
689 /// Western edge of the macro element in the collapsible part of the
690 /// channel; \f$ \zeta \in [-1,1] \f$.
691 //========================================================================
693 const Vector<double>& zeta,
695 const unsigned& imacro)
696 {
697 // Determines the "coordinates" of the macro-element
698 unsigned x = unsigned(imacro % (Nup + Ncollapsible + Ndown));
699 unsigned y = unsigned(double(imacro) / double(Nup + Ncollapsible + Ndown));
700
701 // Vector of Lagrangian coordinates
703 xi[0] = double(x - Nup) * (Lcollapsible / double(Ncollapsible));
704
705 // Position vector on upper wall:
707 Wall_pt->position(t, xi, r_wall);
708
709 // Point will be located on straight line from bottom to top wall
710 double fract = (double(y) + (0.5 * (1.0 + zeta[0]))) / double(Ny);
711
712 // Map it via squash fct
714
715 // x-cooordinate -- straight line from fixed position on the bottom
716 // wall to moving position on the top wall
717 r[0] = Lup + xi[0] + (r_wall[0] - (xi[0] + Lup)) * fract;
718
719 // y-coordinate
720 r[1] = r_wall[1] * fract;
721 }
722
723 //=========================================================================
724 /// Eastern edge of the macro element in the collapsible part of the
725 /// channel; \f$ \zeta \in [-1,1] \f$
726 //=========================================================================
728 const Vector<double>& zeta,
730 const unsigned& imacro)
731 {
732 // Determines the "coordinates" of the macro-element
733 unsigned x = unsigned(imacro % (Nup + Ncollapsible + Ndown));
734 unsigned y = unsigned(double(imacro) / double(Nup + Ncollapsible + Ndown));
735
736 // Vector of Lagrangian coordinates
738 xi[0] = (double(x - Nup) + 1.0) * (Lcollapsible / double(Ncollapsible));
739
740 // Position vector on upper wall:
742 Wall_pt->position(t, xi, r_wall);
743
744 // Point will be located on straight line from bottom to top wall
745 double fract = (double(y) + (0.5 * (1.0 + zeta[0]))) / double(Ny);
746
747 // Map it via squash fct
749
750 // x-cooordinate -- straight line from fixed position on the bottom
751 // wall to moving position on the top wall
752 r[0] = Lup + xi[0] + (r_wall[0] - (xi[0] + Lup)) * fract;
753
754 // y-coordinate
755 r[1] = r_wall[1] * fract;
756 }
757
758 //==========================================================================
759 /// Northern edge of the macro element in the collapsible part of the
760 /// channel; \f$ \zeta \in [-1,1] \f$
761 //==========================================================================
763 const Vector<double>& zeta,
765 const unsigned& imacro)
766 {
767 // Determines the "coordinates" of the macro-element
768 unsigned x = unsigned(imacro % (Nup + Ncollapsible + Ndown));
769 unsigned y = unsigned(double(imacro) / double(Nup + Ncollapsible + Ndown));
770
771 // Vector of Lagrangian coordinates
773 xi[0] = (double(x - Nup) + (0.5 * (1.0 + zeta[0]))) *
774 (Lcollapsible / double(Ncollapsible));
775
776 // Position vector on upper wall:
778 Wall_pt->position(t, xi, r_wall);
779
780 // Point will be located on straight line from bottom to top wall
781 double fract = (double(y) + 1.0) / double(Ny);
782
783 // Map it via squash fct
785
786 // x-cooordinate -- straight line from fixed position on the bottom
787 // wall to moving position on the top wall
788 r[0] = Lup + xi[0] + (r_wall[0] - (xi[0] + Lup)) * fract;
789
790 // y-coordinate
791 r[1] = r_wall[1] * fract;
792 }
793
794 //========================================================================
795 /// Southern edge of the macro element in the collapsible part of the
796 /// channel; \f$ \zeta \in [-1,1] \f$
797 //========================================================================
799 const Vector<double>& zeta,
801 const unsigned& imacro)
802 {
803 // Determines the "coordinates" of the macro-element
804 unsigned x = unsigned(imacro % (Nup + Ncollapsible + Ndown));
805 unsigned y = unsigned(double(imacro) / double(Nup + Ncollapsible + Ndown));
806
807 // Vector of Lagrangian coordinates
809 xi[0] = (double(x - Nup) + (0.5 * (1.0 + zeta[0]))) *
810 (Lcollapsible / double(Ncollapsible));
811
812 // Position vector on upper wall:
814 Wall_pt->position(t, xi, r_wall);
815
816 // Point will be located on straight line from bottom to top wall
817 double fract = double(y) / double(Ny);
818
819 // Map it via squash fct
821
822 // x-cooordinate -- straight line from fixed position on the bottom
823 // wall to moving position on the top wall
824 r[0] = Lup + xi[0] + (r_wall[0] - (xi[0] + Lup)) * fract;
825
826 // y-coordinate
827 r[1] = r_wall[1] * fract;
828 }
829
830} // namespace oomph
831
832#endif
void r_N_collapsible(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &imacro)
Northern boundary of the macro element imacro in the collapsible section.
double l_collapsible()
Length of collapsible segment.
unsigned ndown()
Number of vertical columns of macro elements in the downstream section.
AxialSpacingFctPt & axial_spacing_fct_pt()
Function pointer for function that implements axial spacing of macro elements.
void r_S_straight(const Vector< double > &zeta, Vector< double > &r, const unsigned &imacro, const unsigned &part)
Southern boundary of the macro element imacro in the upstream (part=0) or downstream (part=1) section...
unsigned Ny
Number of macro elements across channel.
unsigned Nup
Number of vertical element columns in upstream section.
double Lup
x-length in the upstream part of the channel
void r_S_collapsible(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &imacro)
Southern boundary of the macro element imacro in the collapsible section.
void r_E_straight(const Vector< double > &zeta, Vector< double > &r, const unsigned &imacro, const unsigned &part)
Eastern boundary of the macro element imacro in the upstream (part=0) or downstream (part=1) sections...
unsigned Ndown
Number of vertical element columns in downstream section.
~CollapsibleChannelDomain()
Destructor: emtpy; cleanup done in base class.
double(* BLSquashFctPt)(const double &s)
Typedef for function pointer for function that squashes the macro elements near the wall to help reso...
void macro_element_boundary(const unsigned &t, const unsigned &imacro, const unsigned &idirect, const Vector< double > &zeta, Vector< double > &r)
Vector representation of the imacro-th macro element boundary idirect (N/S/W/E) at time level t (t=0:...
GeomObject * wall_pt() const
Access to pointer to the geometric object that parametrises the collapsible wall (const version)
bool Rotate_domain
Rotate domain (for axisymmetric problems, say)
double(* AxialSpacingFctPt)(const double &xi)
Typedef for function pointer for function that implements axial spacing of macro elements.
double l_up()
Length of upstream section.
static double default_axial_spacing_fct(const double &xi)
Default for function that implements axial spacing of macro elements.
BLSquashFctPt BL_squash_fct_pt
Function pointer for function that squashes the macro elements near the walls.
static double default_BL_squash_fct(const double &s)
Default for function that squashes the macro elements near the walls. Identity.
GeomObject *& wall_pt()
Access to pointer to the geometric object that parametrises the collapsible wall.
unsigned ncollapsible()
Number of vertical clumns of macro elements in the "collapsible" segment.
unsigned Ncollapsible
Number of vertical element columns in "collapsible" section.
unsigned ny()
Number of macro-elements across the channel.
double s_squash(const double &s)
Function that squashes the macro elements near the wall. Input argument should vary between 0 and 1; ...
void disable_rotate_domain()
Undo rotation of the domain (for axisymmetric problems)
GeomObject * Wall_pt
Pointer to the geometric object that parametrises the collapsible wall.
AxialSpacingFctPt Axial_spacing_fct_pt
Function pointer for function that implements axial spacing of macro elements.
unsigned nup()
Number of vertical columns of macro elements the upstream section.
CollapsibleChannelDomain(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, GeomObject *wall_pt)
Constructor: Pass the number of (macro-)elements, the domain lengths in the x- and y-direction and th...
double l_down()
Length of downstream section.
void r_W_straight(const Vector< double > &zeta, Vector< double > &r, const unsigned &imacro, const unsigned &part)
Western boundary of the macro element imacro in the upstream (part=0) or downstream (part=1) sections...
double Lcollapsible
x-length in the "collapsible" part of the channel
void r_W_collapsible(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &imacro)
Western boundary of the macro element imacro in the collapsible section.
double axial_spacing_fct(const double &xi)
Function that implements axial spacing of macro elements.
BLSquashFctPt & bl_squash_fct_pt()
Function pointer for function that squashes the macro elements near wall. Default mapping (identity) ...
double Ldown
x-length in the downstream part of the channel
void r_N_straight(const Vector< double > &zeta, Vector< double > &r, const unsigned &imacro, const unsigned &part)
Northern boundary of the macro element imacro in the upstream (part=0) or downstream (part=1) section...
void r_E_collapsible(const unsigned &t, const Vector< double > &zeta, Vector< double > &r, const unsigned &imacro)
Eastern boundary of the macro element imacro in the collapsible section.
Simple rectangular 2D Quad mesh class. Nx : number of elements in the x direction.