Added pipe friction
This commit is contained in:
@@ -15,17 +15,18 @@ namespace FluidSim.Core
|
||||
private static float sample;
|
||||
private static double ambientPressure = 1.0 * Units.atm;
|
||||
|
||||
private static bool enableLogging = false;
|
||||
|
||||
public static void Initialize(int sampleRate)
|
||||
{
|
||||
dt = 1.0 / sampleRate;
|
||||
|
||||
double length = 0.2;
|
||||
double radius = 5 * Units.mm;
|
||||
double length = 2;
|
||||
double radius = 20 * Units.mm;
|
||||
double area = Units.AreaFromDiameter(radius);
|
||||
|
||||
pipe = new Pipe1D(length, area, sampleRate, forcedCellCount: 80);
|
||||
pipe.SetUniformState(1.225, 0.0, ambientPressure);
|
||||
pipe.FrictionFactor = 0.0;
|
||||
|
||||
solver = new Solver();
|
||||
solver.SetTimeStep(dt);
|
||||
@@ -56,6 +57,7 @@ namespace FluidSim.Core
|
||||
|
||||
public static void Log()
|
||||
{
|
||||
if (!enableLogging) return;
|
||||
if (stepCount % 10 == 0 && stepCount < 1000)
|
||||
{
|
||||
double pMid = pipe.GetPressureAtFraction(0.5);
|
||||
|
||||
Reference in New Issue
Block a user