Question
Hello you good experts! I'm a big rookie at c++ (or in general) and could only hardly get past asking for the length and radius
Hello you good experts!
I'm a big rookie at c++ (or in general) and could only hardly get past asking for the length and radius of the hose and the temperature.
I have added the declarations and equations needed for the code below if that helps!
I know this is a bit too long but if someone can help me with this, I would forever be thankful to you.
Question
Designing an oxygen ventilator for COVID-19 patients all over the world. The task is to design and develop software that will use the provided equations to calculate the flow rate of oxygen delivered to a patient. It is known, from the Hagen-Poiseuille equation that the flow rate of a fluid depends on its pressure and viscosity as well the length and radius of the tube ('hose'). The problem is complicated by the fact that you are going to be pumping oxygen to patients around the world, in all climates - and the viscosity of oxygen also varies with temperature. You have been able to source pumps that can achieve a pressure of 12 MPa, but you must choose the length and diameter of the hose used to deliver oxygen to the patient in different countries where the range of expected temperatures will be different. Most people normally breathe air at the rate of about 5 to 8 L/min - so the ventilator must provide an oxygen flow rate within the same range.
The task is to code (in c++):
accept only valid input from the user:
The hose length from 0.4 m to 8.0 m in multiples of 0.4 m.
The hose radius from 0.3 mm to 3.0 mm in multiples of 0.3 mm.
The temperature must be from -22 C to 55 C
Display a full description of the calculated flow rate and user parameters, using the correct units.
Display the minimum allowed flow rate, your calculated flow rate and maximum allowed flow rate in a labelled horizontal bar chart.
Display a message describing whether the calculated flow rate is acceptable or above the maximum allowed or below the minimum required.
///Declarations
// Min, Max and factor for the length of the hose.
const double minHoseLength_m = 0.40, maxHoseLength_m = 8.00, lengthFactor_m = 0.40;
// Min, Max and factor for the radius of the hose.
const double minHoseRadius_mm = 0.30, maxHoseRadius_mm = 3.00, radiusFactor_mm = 0.30;
// Min and Max for the temperature.
const double minTemperature_c = -20.0, maxTemperature_c = 55.0;
double temperature_c,temperature_k, hoseRadius_mm, hoseLength_m;
double oxygenFlowrate, oxygenViscosity;
double area_m2, hoseRadius_m;
double MPa = 12;
= 2
(Hagen-Poiseuille Equation) Finding the volumetric flow rate
= ^2/ 8
(dynamic viscosity of oxygen)
= (6.212 10^11)^ 2 + (8.894 10^8 ) (5.672 10^7 )
(celsius to kelvin)
K = C + 273.15
THANK YOU VERY MUCH!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started