ValveLinear Model Modelica Standard Library - Working Principle - fluid

I am implementing the ValveLinear model from the Modelica standard fluid library into a model of mine using Dymola. I have some questions regarding its parameters which I can hopefully clear up:
The key parameters for this valve are as follows:
parameter Medium.MassFlowRate m_flow_nominal
"Nominal mass flowrate at full opening";
final parameter Types.HydraulicConductance k = m_flow_nominal/dp_nominal
"Hydraulic conductance at full opening";
Modelica.Blocks.Interfaces.RealInput opening(min=0,max=1)
"=1: completely open, =0: completely closed"
The mass flow over the valve is then caclulated as
m_flow = opening*k*dp;
Am I right in assuming that m_flow_nominal is the maximum mass flow rate with a linear drop off in mass_flow down to zero as opening goes from 1 to 0?
Furthermore is dp_nominal the corresponding minimum pressure drop across the valve? (i.e. at fully open). Therefore would we see a linear increase in dp from dp_nominal to some maximum value as opening goes from 1 to 0?
The answer may seem trivial but I have run some examples with valves in Dymola so far and in some cases it seems that dp remains constant across the valve as the opening in varied which doesn't make sense to me.

The nominal mass flow rate and pressure drop are just design values used to calculate the valve coefficient k (fixed relation between pressure drop and mass flow). Since no "nominal opening degree" can be specified in ValveLinear the valve opening in the design point is assumed to be one (fully open valve).
The mass flow rate through the valve is not limited to m_flow_nominal. If you double the pressure drop the mass flow through the valve will double, regardless of the nominal mass flow rate.
An example model is shown below:
m_flow_nominal is 5 kg/s and dp_nominal is 10 bar.
At time = 0 s the (fixed) pressure drop over the valve is 10 bar and the valve is fully open. Therefore, the mass flow through the valve is 5 kg/s.
At time = 1 s the pressure drop over the valve is increased by 50
pct (from 10 to 15 bar). The mass flow increases with 50 pct as well
(to 7.5 kg/s).
At time = 3 s the valve opening is reduced by 50 % (from fully to
half open). The pressure drop remains at 15 bar (of course, since
it's a boundary value) while the mass flow rate is reduced to 50 pct (= 3.75 kg/s).
Regarding your second question. The pressure drop is not limited. If the mass flow through the valve is given as a boundary condition (e.g. if source in the model is replaced with a MassFlowSource_T) and the mass flow rate is reduced to half of the nominal value (from 5 to 2.5 kg/s) the pressure drop will also be reduced to half of the nominal value (10 to 5 bar). If the mass flow rate is zero, so will the pressure drop be.
If, on the other hand, you fix the mass flow rate to a value > 0 kg/s and ramp the valve opening towards zero, the pressure drop will approach infinity.
Best regards,
Rene Just Nielsen

Related

Adapting Smartphone Camera to derive Blackbody temperature

At first blush this presumably means -
(1) looking only at lower IR frequencies,
(2) select a IR frequency cut-off for low frequency buckets of the u/v FFT grid
(3) Once we have that, derive the power distribution - squares of amplitudes - for that IR range of frequency buckets the camera supports.
(4) Fit that distribution against the Rayleigh-Jones classical Black Box radiation formula:
(https://en.wikipedia.org/wiki/Rayleigh%E2%80%93Jeans_law#Other_forms_of_Rayleigh%E2%80%93Jeans_law)
(5) Assign a Temperature of 'best fit'.
The units for B(ν,T) are Power per unit frequency per unit surface area at equilibrium Temperature
Of course, this leaves many details out, such as (6) cancelling background, etc, but one could perhaps use the opposite facing camera to assist in that. Where buckets do not straddle the temperature of interest, (7) use a one-sided distribution to derive an inferred Gaussian curve to fit the Rayleigh-Jeans curve at that derived central frequency ν, for measured temperature T.
Finally (8) check if this procedure can consistently detect a high vs low surface temperature (9) check if it can consistently identify a 'fever' temperature (say, 101 Fahrenheit / 38 Celcius) pointing at a forehead.
If all that can be done, (10) Voila! a body fever detector
So those who are capable can fill us in on whether this is possible to do so for eventual posting at an app store as a free Covid19 safe body temperature app? I have a strong sense there's quite a few out there who can verify this in a week or two!
It appears that the analog signal assumed in (1) and (2) are not available in the Android digital Camera2 interface.
Android RAW image stream, that is uncompressed YUV, is already encoded Y green monochrome, and U,V are blue and red shifts from zero for converting green monochrome to color.
The original analog frequency / energy signal is not immediately accessible. So adaptation is not possible (yet).

Getting fuel% from analog data

I am getting analog voltage data, in mV, from a fuel gauge. The calibration readings were taken for every 10% change in the fuel gauge as mentioned below :
0% - 2000mV
10% - 2100mV
20% - 3200mV
30% - 3645mV
40% - 3755mV
50% - 3922mV
60% - 4300mV
70% - 4500mv
80% - 5210mV
90% - 5400mV
100% - 5800mV
The tank capacity is 45L.
Post calibration, I am getting reading from adc as let's say, 3000mV. How to calculate the exact % of fuel left in the tank?
If you plot the transfer function of ADC reading agaist the percentage tank contents you get a graph like this
There appears to be a fair degree of non linearity in the relationship between the sensor and the measured quantity. This could be down to a measurement error that was made while performing the calibration or it could be a true non linear relationship between the sensor reading and the tank contents. Using these results will give fairly inaccurate estimates of tank contents due to the non linearity of the transfer function.
If the relationship is linear or can be described by another mathematical relationship then you can perform an interpolation between known points using this mathematical relationship.
If the relationship is not linear than you will need many more known points in your calibration data so that the errors due to the interpolation between points is minimised.
The percentage value corresponding to the ADC reading can be approximated by finding the entries in the calibration above and below the reading that has been taken - for the ADC reading example in the question these would be the 10% and 20% values
Interpolation_Proportion = (ADC - ADC_Below) / (ADC_Above - ADC_Below) ;
Percent = Percent_Below + (Interpolation_Proportion * (Percent_Above - Percent_Below)) ;
.
Interpolation proportion = (3000-2100)/(3200-2100)
= 900/1100
= 0.82
Percent = 10 + (0.82 * (20 - 10)
= 10 + 8.2
= 18.2%
Capacity = 45 * 18.2 / 100
= 8.19 litres
When plotted it appears that the data id broadly linear, with some outliers. It is likely that this is experimental error or possibly influenced by confounding factors such as electrical noise or temperature variation, or even just the the liquid slopping around! Without details of how the data was gathered and how carefully, it is not possible to determine, but I would ask how many samples were taken per measurement, whether these are averaged or instantaneous and whether the results are exactly repeatable over more than one experiment?
Assuming the results are "indicative" only, then it is probably wisest from the data you do have to assume that the transfer function is linear, and to perform a linear regression from the scatter plot of your test data. That can be most done easily using any spreadsheet charting "trendline" function:
From your date the transfer function is:
Fuel% = (0.0262 x SensormV) - 54.5
So for your example 3000mV, Fuel% = (0.0262 x 3000) - 54.5 = 24.1%
For your 45L tank that equates to about 10.8 Litres.

How to control gap between vehicles in SUMO at high speed?

I am doing some simulation in SUMO at high speed 100 Km/h, the space between vehicles is large and i would like to narrow. I think this space is coming because of the high speed. Does there exist any command to control the maximum Gap between vehicles in SUMO same as it exist for the minimum gap "minGap.
This gap is controlled by the time gap parameter tau which can be modified just like the minGap (but has seconds as unit). The default is 1 and commonly used values for automated driving are 0.8 or 0.5 but even down to 0.2. You need to make sure though that your simulation step size (--step-length) is at most the time gap.

Buoyancy vs water flow pressure

I'm trying to design a kind of water valve with inexpensive materials as a first prototype.
The water flow from the PVC pipe (1) reach the body of the valve and pass through an aluminum grid (3) to the water tank. When the water level goes up pushes the float closing the water intake at point (2).
enter image description here
How can I calculate the buoyancy force needed to stop the water flow? And, what will be the mass of the float?
Let’s back to the basics; here I present the problem and some math that I been doing, I would like your opinion:
Connected to the PVC pipe (2) I have a garden hose whit a water flow pressure of, let's say...49 kPa (I need to check this with a manometer), and I attached a 25 diameter and 0.5 meters long PVC pipe. Let’s pretend that the float seals the other side of the PVC pipe, so I need to calculate the force generate by the water flow pressure against the float.
Please take in consideration that I'm not a fluid mechanic expert.
When I open the garden hose, the PVC pipe starts to fill, so based on this situation:
enter image description here
P1+ρgh_1+(v^1 ρ)/2=P2+ρgh_2+(v^2 ρ)/2
If I took the height of P1 as the reference, h=0, and the diameter of the PVC pipe and the garden hose pipe are the same (25 mm), the water flow velocity at those points are equals:
P1=P2+ρgh_2
So, if the garden hose pressure is 49 Kpa:
49000 kg/(m s^2 )=P2+9.8 m/(s^2 ) x 1000 kg/m^3 x 0.5 m
P2=53900 kg/(m s^2 )
P2=53.9 Kpa
Ok, assuming this math is correct…now I have to calculate the force against the bottom of the PVC pipe at point 2:
P=F/A
In order to simplify this example, I took the diameter of the PVC pipe as the contact area.
A=πr^2=π(〖0.025〗^2 )=0.002 m^2
F=107.8 N
If the pressure of the water flow generates a force of 107.8 N, I need an opposite force with a higher value to counteract it. Is that correct?
My goal is to find a material (mass; area) that generate enough buoyancy force to stop the water flow through the valve and seal the water intake, and when the water level goes down, the float valve will let pass the water flow to continue to fill the water tank.
I agree with the previous comment : the pressure at the contact is the total pressure at the line feed (corrected for gravity at height 1). When water is flowing, some of that pressure is converted to dynamic pressure, meaning you will measure a lower pressure at point 1; the total sum at p+1/2 v^2 should remain more or less the same irrespective of v - if we neglecting head losses running up to point 1 which depend on the flow rate.
Anyway, when the valve is closed, the flow is stopping anyway, so you it is even more obvious to work with the static pressure measured in the absence of flow.
You need to choose the density and form of your floater such that the buoyancy force, given by $(density of water - density of floater material)*(submerged volume at chosen reservoir height)$ is equal to $p2 * A$.

Calculating the maximum physical rate (Nyquist performance limitation) of an ADC onboard a microcontroller

I'm trying to evaluate the maximum physical rate (Nyquist performance limit) of the A/Ds integrated on board various PIC microcontrollers.
However, to do the calculation requires parameters that I'm not finding explicitly stated in the datasheets, specifically Tacq, Fosc, TAD, and divisor parameters.
I've proceeded by making some assumptions but would be helpful to have a sanity check -- am I doing the maximum physical rate calculations correctly?
For illustration purposes only, I've taken the simplest possible PIC10F220 that has an ADC. This is to focus specifically on the interpretation of Tacq, Fosc, TAD, and divisor parameters, and not to suggest that any practical functionality could be implemented on this very basic chip. (This is to Clifford's points in the comments below.)
Calculation:
Nyquist Performance Analysis of PIC10F220
- Runs at clock speed of 8MHz.
- Has an instruction cycle of 0.5us [4 clock steps per instruction]
So:
- Get Tacq = 6.06 us [acquisition time for ADC, assuming chip temp. = 50*C]
[from datasheet p34]
- Set Fosc := 8MHz [? should this be internal clock speed ?]
- Set divisor := 4 [? assuming this is 4 from 4 clock steps per CPU instruction ?]
- This gives TAD = 0.5us [TAD = 1/(Fosc/divisor) ]
- Get conversion time is 13*TAD [from datasheet p31]
- This gives conversion time 6.5 us
- So ADC duration is 12.56 us [? Tacq + 13*TAD]
Assuming 10 instructions for a simple load/store/threshold done in real-time before the next sample (this is just a stub -- the point is the rest of the calculation):
- This adds another 5 us [0.5 us per instruction]
- To give total ADC and handling time of 17.56 us [ 12.56us + 1us + 4us ]
- before the sampling loop repeats [? Again Tacq ? + 13*TAD + handling ]
- If this is correct, then the max sampling rate is 56.9 ksps [ 1/ total time ]
- So the Nyquist frequency for this sampling rate is 28 kHz. [1/2 sampling rate]
Which means the (theoretical) performance of this system --- chip's A/D with the hypothetical real-time handling code --- is for signals that are bandlimited to 28 kHz.
Is this a correct assignment / interpretation of the data sheet in obtaining Tacq, Fosc, TAD, and divisor parameters and using them to obtain the maximum physical rate, or Nyquist performance limit, of this chip?
Thanks,
You're not going to be able to do much processing in 8 instructions, but assuming you're just doing something simple like storing the incoming samples to a buffer, or detecting a threshold, then your analysis looks good.
The actual chips I'm considering for the design are the dsPIC33FJ128MC804 (with 16b A/D) or dsPIC30F3014 (with 12b A/D).
That is an important distinction; the dsPIC ADC supports ping-pong DMA transfers of multiple channels simultaneously, so can minimise the effective software overhead per sample. That makes the calculation a somewhat different one. You need to determine from the sample rate and the DMA buffer size the time between sample buffer interrupts; that is how much processing time you have to deal with each buffer. If you are using Microchip's DSP library, it gives precise cycle time formulae for each algorithm, and block processing is considerably more efficient that sample-by-sample processing.
My last project was on a dsPIC33 with two channels sampled at 48KHz and 32word sample buffers (giving 667us to process each pair of buffers). The software processing was therefore entirely independent of the sampling since by using DMA they take place simultaneously.