Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
home_server:mswindows_notes [2024-02-25 Sun wk08 12:08] – [friction factor calculation] baumkp | home_server:mswindows_notes [2024-04-05 Fri wk14 05:38] (current) – [Excel Conditional Formatting Applies to Field Changing Unexpectedly] baumkp | ||
---|---|---|---|
Line 237: | Line 237: | ||
====friction factor calculation==== | ====friction factor calculation==== | ||
Earlier in my engineering career I used Lotus123 and MSExcel with iteration to calculate the friction factor of piping with Newtonian fluid according to the [[https:// | Earlier in my engineering career I used Lotus123 and MSExcel with iteration to calculate the friction factor of piping with Newtonian fluid according to the [[https:// | ||
- | < | + | ++++VSBasic code for Colebrook Equation| |
- | </ | + | < |
- | As can be seen in the wiki page, [[https:// | + | ' |
+ | Public Ff As Double ' | ||
+ | Public Fnew As Double | ||
+ | Public error As Double | ||
+ | Public i As Integer | ||
+ | |||
+ | |||
+ | Public Function Pipefriction(Re, | ||
+ | ' | ||
+ | ' Calculated Moody Friction Factor for fluid flows | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | 'The log function is understood to be base-10 (as is customary in engineering fields): if x = log(y), then y = 10x. | ||
+ | ' | ||
+ | ' | ||
+ | Ff = -1 | ||
+ | i = 0 | ||
+ | If Re > 0 And Re <= 2000 Then | ||
+ | |||
+ | Ff = 64 / Re | ||
+ | |||
+ | |||
+ | ElseIf Re > 2000# And Re < 90000000000# | ||
+ | |||
+ | Ff = 0.015 | ||
+ | |||
+ | Do | ||
+ | |||
+ | ' Fnew = 1 / (2 * Log10(Rr / 3.7 + 2.51 / (Re * Ff ^ 0.5))) ^ 2 | ||
+ | Fnew = 1 / (0.8685889638065 * Log(Rr / 3.7 + 2.51 / (Re * Ff ^ 0.5))) ^ 2 | ||
+ | error = Abs(Fnew - Ff) / Fnew | ||
+ | |||
+ | Ff = Fnew | ||
+ | i = i + 1 | ||
+ | |||
+ | Loop Until error < 0.00001 | ||
+ | |||
+ | End If | ||
+ | |||
+ | Pipefriction = Ff | ||
+ | |||
+ | End Function | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | 'End Function</ | ||
+ | As can be seen in the wiki page, [[https:// | ||
+ | |||
+ | ====Excel Conditional Formatting Applies to Field Changing Unexpectedly==== | ||
+ | MSExcel unnecessarily and annoyingly changes conditional formatting ranges. | ||
+ | |||
+ | The options menu, advanced options, Editing options, unselect Extend data range formats and formulas reputedly stops this behavior. | ||
+ | |||
+ | References: | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
======MS Word====== | ======MS Word====== |