Comp Applic in Engineering - 2023 - Castilla
Comp Applic in Engineering - 2023 - Castilla
DOI: 10.1002/cae.22619
RESEARCH ARTICLE
1
Department of Fluid Mechanics—
CATMech, Universitat Politècnica Abstract
de Catalunya, Terrassa, Spain In recent years, Jupyter Notebooks have become a very useful free and open‐
2
Department of Mathematics, source tool in teaching, as they allow you to combine text, images,
Universitat Politècnica de Catalunya,
Barcelona, Spain mathematical expressions, links and code into a single document. This gives
students an interactive document with which they can experiment and learn
Correspondence
with the help of high‐level mathematical calculus. In Fluid Mechanics, it is
Marta Peña, Department of Mathematics,
Universitat Politècnica de Catalunya, very common for students to deal with complex computations that take away
Barcelona, Spain. attention from the Mechanic, especially in advanced topics such as Rheology,
Email: [email protected]
Turbulence, or Boundary Layer. The subject “Advanced Fluid Mechanics” is
an elective one of the last year of the Bachelor's degree in Industrial and
Aerospace Technology Engineering at the Terrassa School of Industrial,
Aerospace and Audiovisual Engineering at the Universitat Politècnica de
Catalunya. This subject has three ECTS credits and has been taught since the
academic year 2020–2021 This subject complements the compulsory subject
Fluid Mechanics and is developed in 6 weeks with 5 h of class each week. This
work presents Fluid Mechanics modules with Jupyter Notebooks that
complement the syllabus given in the compulsory subject. An elective subject
is presented where subjects of Fluid Mechanics per week are studied
independently, using different Python tools: symbolic calculation, modeling
of experimental data, statistical analysis, numerical calculation, and so forth.
The main goal is for the student to focus on mechanical concepts and actively
learn to use the tools available, especially open source, to do the associated
mathematical calculations.
KEYWORDS
active learning, collaborative work, fluid mechanics, interactive computing, Jupyter
Notebooks, open source
Abbreviations: AFM, Advanced Fluid Mechanics; CFD, computational fluid dynamics; FM, Fluid Mechanics; ODE, ordinary differential equations;
PDE, partial derivatives equation.
Robert Castilla and Marta Peña contributed equally to this study.
This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided
the original work is properly cited.
© 2023 The Authors. Computer Applications in Engineering Education published by Wiley Periodicals LLC.
software in general, and education in particular, has not exclusively for distance teaching or to support class-
stopped growing and promoting activities, as it is shown room teaching.
in Ref. [14]. The main source of inspiration for this proposal is the
This work presents the material developed in the work of Professor Lorena Barba [5, 3]. Barba and her
subject AFM, five topics of FM that are usually explained group, from George Washington University (Washing-
superficially in the compulsory subject. In this subject, ton), have for years made a strong commitment to the
they are presented in more detail and with a different ecosystem represented by Jupyter Notebooks to teach,
methodology that allows students to make autonomous especially at distance, the methodology behind Compu-
learning material. Being a subject in the last year of the tational Fluid Dynamics (CFD). An example of their
Bachelor's Degree, it is hoped that the students have efforts is the MOOC (Massive Online Open Course) they
the appropriate knowledge of FM that is taught in have published since 2017 [2]. Cardoso et al. [9] also
the compulsory subjects. In addition, they also generally report on the use of Jupyter Notebooks in engineering
have a basic knowledge of programming, including high‐ courses at the University of Coimbra, assessing that
level languages (usually Matlab, but sometimes Python students have shown an improvement in the learning
or R as well). process.
More recently, Golman [21] proposes a set of Jupyter
Notebooks for the numerical analysis of chemical and
1.2 | Objectives and research questions enzyme‐catalyzed reactions in a porous pellet. Suárez‐
García et al. [45] present an experience of using Jupyter
The main objective of this work is as follows: Notebooks as teaching material in the field of Structural
Analysis. Specifically, they report the results of using
• To provide students with an alternative study Jupyter Notebooks in two lab sessions and at the end
methodology, to complement the syllabus of the conduct a survey with 28 students about the experience.
compulsory subject of FM, making the learning of In general, they conclude that the acceptance has been
physical concepts active instead of passive and not positive and the Jupyter Notebooks have served for a
conditioned by the limitations of the knowledge of better understanding of the theory by the students.
mathematics. But if there is one publication that has had a major
impact it has been that of Helen Shen in Nature [44]
The complementary objectives that are pursued, to which has accumulated more than 200 citations in
achieve the main objective, are as follows: Google Scholar. Shen, however, still talks about the
Ipython Notebook instead of the Jupyter Notebook,
• To familiarize students with the Jupyter Notebook which was created precisely in 2014 from Ipython. In
study, writing, documentation, and math calcula- this article, Shen describes the benefits of creating,
tion tool. sharing, disseminating, and publishing documents, code,
• To generate independent modules with study material and data using Notebooks.
with advanced topics in FM.
The main idea behind a Jupyter Notebook is to create In the next sections, the Notebooks are briefly
a computational narrative, if possible, following the 10 described. The details of each Notebook can be found
rules that Rule et al. [43] suggested, and which are in the online version of the course [10].
summarized here:
p (x ) = C1 + 6μ U dx ,
ODE than can be integrated. The code to obtain the
h3 (x )
1 1
solution of Stokes equation follows dx − 2q (6)
h2 (x )
import sympy as sp
x,y,t,mu = sp.symbols(x,y,t,mu) where the constant C1 will depend on the known value of
u = sp.Function(u) the pressure on some point x .
p = sp.Function(p) As an example, in the Notebook the case of a tilting‐
h = sp.Function(h)
p_ = sp.Derivative(p(x),x)
( x
pad bearing, where h (x ) = h 0 1 + α L , with α ≪ 1, is)
solved. The case of a journal bearing (see Figure 2),
where a load W displaces the shaft and produces an
exp = p_/mu+sp.diff(u(y),y,2)
eccentricity e is left as the assignment for this Notebook.
In this case, the distance between the surface is given by
Ub,Ut = sp.symbols(U_b,U_t)
ics = {u(0):Ub,u(h(x)):Ut}
Sol = sp.dsolve(exp,u(y),ics=ics)
that yields
d
Ub y U y y 2 dx p (x )
u ( y) = − + Ub + t +
h (x ) h (x ) 2μ
d
(2)
yh (x ) dx p (x )
− ,
2μ
d d
Uy y 2 dx p (x ) yh (x ) dx p (x )
u ( y) = + − . (3)
h (x ) 2μ 2μ
d d2 d d
F I G U R E 2 Sketch of a hydrodynamics journal bearing. Due to
U dx h (x ) h3 (x ) p (x ) h2 (x ) dx h (x ) dx p (x )
− dx 2
− = 0, (4) the load W , the rotating shaft, of radius R a is not concentric to the
2 12μ 4μ housing, and, hence, the gap is a function of the angle θ with
respect to the minimum value. This produces a pressure
and pressure distribution is computed by integrating the distribution, according to the Reynolds equation, that cancels
velocity profile and isolating the pressure gradient. the load.
10990542, 2023, 4, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/cae.22619, Wiley Online Library on [19/09/2023]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
1006 | CASTILLA and PEÑA
e
with h (x ) = h 0 (1 + ε cos(θ )) where ε= h0
and
h 0 = Rb − Ra , where θ is the angular position with
respect to the minimum distance, h 0 , and Ra and Rb are,
respectively, the shaft and the housing radia.
In this notebook, the equation of Young–Laplace for
interface liquid‐gas with surface tension is also pre-
sented, and it is used to find the shape of this interface.
The main objective of this Notebook is the solution of
differential equations with the help of sympy.
3.1.3 | Rheology
df
→ 1forη → ∞. (9)
dη
officials of the [UPC] and the SEEQ survey used by the compulsory subject FM of the Bachelor's Degree of
authors. The sampling of the marks was carried out on 18 Industrial Technologies. It should be noted that the
students from the 2 academic years analyzed, 2020–21 lecturer was the same in both subjects; Not all the SEEQ
and 2021–22. Students who are not noticed in any of the questions, which are more than 40, are presented here,
two subjects (because they have not been presented) and but only the five that have been considered most relevant
foreign (Erasmus) students have been eliminated. That in relation to the subject and the methodology. The
is, only students who have completed both subjects in the questions and the results are presented in Figure 7. In
same Bachelor's Degree have been considered. The first both surveys, the student's answers are given on a scale
12 students were from the 2020–21 academic year and of 5 values: 1: Strongly disagree, 2: Disagree, 3: Neutral,
the last 6 from 2021 to 22 academic year. The small 4: Agree, and 5: Strongly agree.
number of students last year is due to the fact that more
than half were foreigners. The results are shown in
Figure 6. 4 | D I S C US S I O N A N D
Regarding the students' opinions, two different CONCLUSIONS
surveys have been considered. First, there is the official
[University] survey, which consists of three main 4.1 | Jupyter Notebooks discussion
questions:
The following are the quality principles enunciated by
1. I found the contents of the subject interesting. Chickering and Gamson [13] for a teaching innovation
2. Overall I am satisfied with this subject. action. The relationship with the present proposal is
3. The course materials are easily accessible and useful commented out with each of the principles.
for learning.
1. Stimulate contact between teachers and students.
The results of these three questions are compared to Although it is not the strong point of the proposal,
three compulsory subjects, [Subject 1], [Subject 2], and as the material could be used without the intervention
[Subject 3] of the Bachelor's Degree in the area of FM, of the teacher, it is tried to enhance this stimulation
averaging the three semesters in which the surveys were through more or less simple exercises that often
conducted, with the result obtained in the subject AFM require communication between teacher and student.
in the only semester in which survey results are available 2. Stimulate cooperation between students. The assign-
(the survey was also conducted this academic year ments that are delivered and evaluated are carried
2021–2022, but unfortunately the results depend on the out in groups of three. It is tried in the classroom, in
[University] and are not be available yet). See Table 1. addition, to avoiding the competitiveness between
Secondly, a SEEQ (Student Evaluation of Educational students and groups. The goal is to learn as much as
Quality) [19, 29] survey has been carried out in two possible, not to get the highest grade. In this way,
editions of the subject presented in this report, and the collaboration between groups is encouraged, in
T A B L E 1 Results of the Universitat Politècnica de Catalunya surveys with the three compulsory subjects of Fluid Mechanics and the
elective subject of Advanced Fluid Mechanics (AFM).
Subject Year Question 1 Question 2 Question 3 Sample
Subject 1 2021/22‐1 3.75 3.63 3.63 8/25
2020/21‐2 4.33 3.95 4.22 55/113
2019/20‐1 4.06 3.44 4.06 16/29
Subject 2 2021/22‐1 4.24 3.57 2.95 21/64
2020/21‐2 3.63 2.46 2 54/66
2019/20‐1 3.5 2.79 2.79 24/62
Subject 3 2021/22‐1 3.82 4.29 4.53 17/55
2020/21‐2 4.15 4.25 4.45 20/55
2019/20‐1 4.03 3.71 3.68 31/75
Average 3.95 3.57 3.59
AFM 4.8 4.8 4.8 5/15
classroom and in the digital classroom, through it is not that complicated and they end up doing really
forums where all deliveries are shared. interesting work.
3. Stimulate active learning. This is the most important 7. Respect the different talents and forms of learning. In fact,
point of this proposal. Students take almost no notes the course could be done completely autonomously. It is
but are encouraged to explore, play, and change designed so that students can meet small challenges
notebooks. They are encouraged to change the input gradually and at their own pace. In the classroom, it is
and interpret the results. They are asked to look for common for students to finish work very quickly and
alternative ways to solve the same problem. either play with Notebooks, start working on assign-
Throughout all Notebooks, many of the tools used ments, or collaborate with other groups.
are unexplained, and links to Wikipedia, GitHub
repositories, and so forth are provided for The fact that all the material is in a repository in a
information. well‐documented way makes it easy for any teacher to
4. Provide timely feedback. Each week a topic that is take charge of the subject at any time, just by making a
independent of the rest is worked on. At the end of the fork of the repository or working in a branch which can
week, they have an “Assignment” that they have to then be combined with the main trunk (merge). The
hand in the following week. Once delivered, the Jupyter Notebooks presented in this work, by definition,
Notebooks are posted on a Moodle forum with access are fully documented and accessible to anyone. Not only
for all students. In this way, students can analyze each of can the course be transferred to any department, school,
the deliveries, and give a comment and even a mark. or university professor but, being developed in English
Feedback is often given to each other and, more and available in a public repository, it can be used by
importantly, they see different ways of solving the same anyone in the world. To use and contribute to the
problem. Obviously, the teacher puts the final mark on proposal, it is advisable to know and use Git and GitHub,
the delivery, but it does not go far from what they put. reading previously any of the books by Chacon and
5. Spend time on the most relevant tasks. As explained in Atraub [12] or by Tsitoara [46].
Section 1, one of the motivations for this proposal is This repository is constantly being updated with large
that students often do not learn FM because they are contributions from students. More modules can be
stuck with mathematical concepts and calculations. generated with topics that may be of interest to certain
The aim of this proposal is for students to focus on the students, such as:
concepts of FM by learning to do mathematical
calculations, and visualize them, with appropriate • Aerodynamics (experimental data processing ‐ error
tools. propagation, reliability, modeling…).
6. Communicate high expectations to students. Students • Pipe flow (development of a tool for calculating
end up creating their own Notebooks. At first, they pressure losses in transport pipes).
seem skeptical, but after the first 2 weeks they see that • Potential flow (calculation with complex variable).
10990542, 2023, 4, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/cae.22619, Wiley Online Library on [19/09/2023]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
1010 | CASTILLA and PEÑA
F I G U R E 7 Results of the five most relevant questions of the SEEQ survey of the compulsory subject of Fluid Mechanics (FM) and the
elective subject of Advanced Fluid Mechanics (AFM) (a) Results of question 1: The course has seemed to me intellectually encouraging and
stimulating, (b) Results of question 2: I have learned things I consider valuable, (c) Results of question 3: My interest in the subject has
increased as a result of this course, (d) Results of question 4: I have learned and understood the contents of this course, (e) Results of
question 5: This course is better than most I have done at this university.
• CFD (with Fenics and Dolfin, or writing directly Jupyter Notebooks is becoming a standard for the
the code). research and teaching community in recent years. It
• etc. allows for combining text, images, mathematical expres-
sions, and codes in one document that can be opened and
Of course, the methodology described in this work executed in several applications and platforms. However,
can be extended to other subjects. It is very common to except for the particular case of CFD, its use for FM does
be used in computer science, but it can also be used in not seem to be extended. This work proposes a FM
other branches of Engineering, or in Physics, Mathemat- course structured with Jupyter Notebooks that are
ics, Chemistry, and so forth. presented as independent modules that encourage active
10990542, 2023, 4, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/cae.22619, Wiley Online Library on [19/09/2023]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
CASTILLA and PEÑA | 1011
and collaborative learning. The main objective is to T A B L E 2 Average of assessments of each subject according to
introduce students to work on scientific and technologi- the five questions of the SEEQ survey.
cal tools with Python, such as symbolic calculation, data Advanced Fluid
analysis, ODE and PDE solution, and numerical compu- Fluid Mechanics Mechanics
tation, using it with advanced topics on FM, such as Question 1 3.3 3.1
lubrication, rheology, compressible flow, …
Question 2 3.0 2.7
The Jupyter Notebooks are distributed in a public
repository in Github so that not only the students but Question 3 3.2 2.7
also any academic member can contribute and extend Question 4 2.7 2.5
the course. Question 5 2.4 2.8
presented in this work are publicly available in the 15. E. Corral Abad, M. J. Gómez García, R. Ruiz Blázquez,
Github repository URL https://github.com/rclUPC/ C. Castejon, and J. C. García‐Prada, Effects of an android app
AdvancedFluidMechanics. on mechanical engineering students, Comput. Appl. Eng. Educ.
26 (2018), no. 4, 1050–1057.
16. E. Corral Abad, M. J. Gomez Garcia, E. Diez‐Jimenez,
ETHI CS STATEMENT
P. M. Moreno‐Marcos, and C. Castejon Sisamon, Improving
Not applicable. the learning of engineering students with interactive teaching
applications, Comput. Appl. Eng. Educ. 29 (2021), no. 6,
ORCID 1665–1674.
Robert Castilla https://orcid.org/0000-0002-3848-2004 17. K. A. Darabkh, F. H. Alturk, and S. Z. Sweidan, VRCDEA‐
Marta Peña https://orcid.org/0000-0003-3889-8584 TCS: 3D virtual reality cooperative drawing educational
application with textual chatting system, Comput. Appl. Eng.
Educ. 26 (2018), no. 5, 1677–1698.
REFERENCES
18. B. Deliktas, Computer technology for enhancing teaching and
1. O. M. Ayala, O. Popescu, and V. M. Jovanovic, Flipped
learning modules of engineering mechanics, Comput. Appl.
classroom as blended learning in a fluid mechanics course in
Eng. Educ. 19 (2011), no. 3, 421–432.
engineering technology, 2017.
19. R. M. Espada and J. A. Masa, Impact of digital storytelling in
2. L. A. Barba, GW's MAE6286. Practical Numerical Methods
students satisfaction, measured through SEEQ questionnaire, E‐
with Python. https://openedx.seas.gwu.edu/courses/course-
learning and Smart Learning Environment for the Preparation
v1:MAE%2BMAE6286%2B2017, 2017.
of New Generation Specialists, 49.
3. L. A. Barba and G. F. Forsyth, CFD Python: the 12 steps to
20. P. J. Gamez‐Montero, M. Peña, and N. Olmedo‐Torre, Flipped
Navier‐Stokes equations, J. Open Source Educ. 2 (2018), no. 16,
learning and threshold concepts in the turbomachinery section
21.
of fluid engineering course, Comput. Appl. Eng. Educ. 29
4. L. A. Barba and O. Mesnard, Aero Python: classical aerody-
(2021), no. 4, 795–809.
namics of potential flow using Python, J. Open Source Educ. 2
21. B. Golman, A set of Jupyter notebooks for the analysis of
(2019), no. 16, 45.
transport phenomena and reaction in porous catalyst pellet,
5. L. A. Barba, L. J. Barker, D. S. Blank, J. Brown, A. B. Downey,
Comput. Appl. Eng. Educ. 27 (2019), 531–542.
T. George, L. J. Heagy, K. T. Mandli, J. K. Moore, D. Lippert,
22. J. Gruber, Introducing markdown. https://daringfireball.net/
K. E. Niemeyer, R. R. Watkins, R. H. West, E. Wickes,
2004/03/introducing_markdown
C. Willing, and M. Zingale, Teaching and learning with
23. R. R. Gutierrez, F. Escusa, J. A. Lyon, A. J. Magana,
Jupyter. Recuperado, 2017. https://jupyter4edu.github.io/
J. H. Cabrera, R. Pehovaz, O. Link, G. Rivillas‐Ospina,
jupyter-edu-book
G. J. Acuña, J. M. Kuroiwa, M. X. Guzman, and
6. H. Blasius, The boundary layers in fluids with little friction,
F. G. Latosinski, Combining hands‐on and virtual experi-
56, Zeitschrift fuer Mathematik und Physik, 1950.
ments for enhancing fluid mechanics teaching: a design‐
7. W. T. Botelho, M. d.G. B. Marietto, J. C. d.M. Ferreira, and
based research study, Comput. Appl. Eng. Educ. 30 (2022),
E. P. Pimentel, Kolb's experiential learning theory and Belhot's
no. 6, 1701–1724.
learning cycle guiding the use of computer simulation in
24. F. Irgens, Rheology and non‐newtonian fluids, 1st ed. Springer
engineering education: a pedagogical proposal to shift toward
International Publishing, 2014.
an experiential pedagogy, Comput. Appl. Eng. Educ. 24 (2016), 25. D. Irving, K. Hertweck, L. Johnston, J. Ostblom, C. Wickham,
no. 1, 79–88. and G. Wilson, Research software engineering with python:
8. J. K. Burgher, D. Finkel, B. J. Van Wie, and O. Adesope, building software that makes research possible, Chapman and
Implementing and assessing interactive physical models in the fluid Hall/CRC, New York, 2021.
mechanics classroom, Res. Eng. Educ. 32 (2016), no. 6, 2501–2516. 26. R. Johansson, Numerical Python, Apress, New York,
9. A. Cardoso, J. Leitão, and C. Teixeira, Using the Jupyter 2019.
Notebook as a tool to support the teaching and learning 27. Jupyter Community, Jupyter wiki. Accessed June 15 2022.
processes in engineering courses, The Challenges of the Digital https://github.com/jupyter/jupyter/wiki, 2022.
Transformation in Education, 2019, pp. 227–236. https://doi. 28. P. K. Kundu, I. M. Cohen, and D. R. Dowling, Fluid
org/10.1007/978-3-030-11935-5_22 mechanics, Academic Press, Oxford, U.K., 2012.
10. R. Castilla, UPC‐205237 Advanced Fluid Mechanics. https:// 29. H. W. Marsh, SEEQ: a reliable, valid, and useful instrument for
rclupc.github.io/AdvancedFluidMechanics/README.html, 2022. collecting students' evaluations of university teaching, Br.
11. Centre for Industrial Rheology, Emulsion stability: strong and J. Educ. Psychol. 52 (1982), no. 1, 77–95.
stable or weak and feeble. Accessed June 15 2022. https:// 30. T. J. Mateo Sanguino and J. M. Andújar Márquez, Simulation
www.rheologylab.com/articles/emulsion-stability/, 2022. tool for teaching and learning 3D kinematics workspaces of
12. S. Chacon and B. Straub, Progit, Springer Nature, New serial robotic arms with up to 5‐DOF, Comput. Appl. Eng.
York, 2014. Educ. 20 (2012), no. 4, 750–761.
13. A. W. Chickering and Z. F. Gamson, Seven principles for good 31. W. McKinney, Python for data analysis: data wrangling
practice in undergraduate education, AAHE Bull. 3 (1987), 7. with Pandas, NumPy, and IPython, O'Reilly Media, Inc.,
14. P. Chmielecki, Linux myth. Open source software in Sebastopol, CA, USA, 2012.
information society, Econ. Soc. Dev. Book Proc., New York, 32. V. F. Ochkov, A. S. Moscow, and A. I. Tikhonov, Jupyter
2014, p. 197. notebook, JupyterLab; integrated environment for STEM
10990542, 2023, 4, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/cae.22619, Wiley Online Library on [19/09/2023]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
CASTILLA and PEÑA | 1013