1
$\begingroup$

I am a beginner here and want to learn this tool. At first, I want to make one calculator that will display the value of the Non-Dimensional number of Fluid dynamics based on user inputs.

In this code, I need to add one output display box, which will show the value of that number and named that output box name as Reynolds number.

Please help me to do that. Thanks in advance.

Manipulate[ Rey[v], {{v, 1.5, "Velocity of Fluid(m/s): "}, ControlType -> InputField, FieldSize -> 7},{{roh, 1, "Fluid Density (Kg/m^3): "}, ControlType -> InputField, FieldSize -> 7}, {{dia, 0.01, "Hydraulic Diameter (m) "}, ControlType -> InputField, FieldSize -> 7}, {{muh, 0.00089, "Dynamic Viscosity (Kg/ms): "},ControlType -> InputField, FieldSize -> 7}, Initialization :> {Rey[v_] := (roh*v*dia)/muh}]
$\endgroup$
1

1 Answer 1

1
$\begingroup$

Update 2 Improve layout, add Calculate button

CloudDeploy[
 Manipulate[ "Reynolds number: " <> ToString@Style[Rey[v], 14],
  Text[Style["Reynolds number calculator", 16]],
  Delimiter,
  {{v, 1.5, "Velocity of Fluid(m/s): "}, ControlType -> InputField, 
   FieldSize -> 7}, {{roh, 1, "Fluid Density (Kg/m^3): "}, 
   ControlType -> InputField, 
   FieldSize -> 7}, {{dia, 0.01, "Hydraulic Diameter (m) "}, 
   ControlType -> InputField, 
   FieldSize -> 7}, {{muh, 0.00089, "Dynamic Viscosity (Kg/ms): "}, 
   ControlType -> InputField, FieldSize -> 7},
  Delimiter,
  Item[Button["Calculate", Nothing, BaseStyle -> {15}]],
  LabelStyle -> {14}, 
  ContentSize -> 310,
  Initialization :> {Rey[v_] := (roh*v*dia)/muh},
  TrackedSymbols :> All]]

Update More attractive :-)

Manipulate[ 
 ResourceFunction["WolfieSay"][Labeled[Rey[v], "Reynolds number", Top]],
  {{v, 1.5, "Velocity of Fluid(m/s): "}, ControlType -> InputField, FieldSize -> 7}, 
  {{roh, 1, "Fluid Density (Kg/m^3): "}, ControlType -> InputField, FieldSize -> 7},
  {{dia, 0.01, "Hydraulic Diameter (m) "}, ControlType -> InputField, FieldSize -> 7},
  {{muh, 0.00089, "Dynamic Viscosity (Kg/ms): "},ControlType -> InputField, FieldSize -> 7}, 
 Initialization :> {Rey[v_] := (roh*v*dia)/muh}, 
 TrackedSymbols :> All]

Something like this?

Manipulate[ 
 Panel[Row[{"Reynolds number: ", Rey[v]}]],
  {{v, 1.5, "Velocity of Fluid(m/s): "}, ControlType -> InputField, FieldSize -> 7}, 
  {{roh, 1, "Fluid Density (Kg/m^3): "}, ControlType -> InputField, FieldSize -> 7},
  {{dia, 0.01, "Hydraulic Diameter (m) "}, ControlType -> InputField, FieldSize -> 7},
  {{muh, 0.00089, "Dynamic Viscosity (Kg/ms): "},ControlType -> InputField, FieldSize -> 7}, 
 Initialization :> {Rey[v_] := (roh*v*dia)/muh}, 
 TrackedSymbols :> All]
$\endgroup$
10
  • $\begingroup$ Thanks, Rohit.. it is close to what I am looking for... Do you know any other way... which shows output more attractive... $\endgroup$
    – ASHISH
    Sep 6, 2021 at 14:47
  • $\begingroup$ What exactly do you mean by "output more attractive"? The output is a string and a real number. $\endgroup$ Sep 6, 2021 at 19:58
  • $\begingroup$ I want to build a calculator something like given in this link resources.wolframcloud.com/FormulaRepository/resources/… $\endgroup$
    – ASHISH
    Sep 7, 2021 at 15:09
  • $\begingroup$ In the above link formula repository, we can input the real number on the corresponding string and after clicking the submit button we can display all values at bottom of it. In the same way, I want to build the calculator in my case. Do you know how I can get the source code of the above link? $\endgroup$
    – ASHISH
    Sep 7, 2021 at 16:04
  • $\begingroup$ The code in my answer does not require a submit button because it is not hosted on a web page. Change any of the numbers in the input fields and hit enter/return (not shift enter/return) and the computed Reynolds number will update. Are you interested in building a web interface or one that will run in Mathematica/Notebook Player? $\endgroup$ Sep 7, 2021 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.