|
[Sponsors] |
February 10, 2016, 16:20 |
setting a Constant Inlet flow - Interfoam
|
#1 |
New Member
Bradley
Join Date: Feb 2016
Posts: 7
Rep Power: 10 |
Hello.
I am trying to modify a case of Interfoam to include real world geometry with a constant inlet flow rate. For a basis, I started with this case: https://www.youtube.com/watch?v=1zQbU-E4k1U I am able to replicate the box to cell case for any configuration using a step file and Salome. However, I can not figure out how to set a constant inlet flow instead of box to cell. Here is an example of the constant flow I'm trying to create: https://www.youtube.com/watch?v=0K2QBjFS5VM In addition to alpha.water, I would like for the simulation to show the velocity of the fluid. Please let me know if I have left any relevant information out. This is my first time using the CFD forums. My relevant code is below /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object setFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defaultFieldValues ( volScalarFieldValue alpha.water 0 ); regions ( boxToCell { box (0 -0.12 0.195) (0.05 0.03 0.23); fieldValues ( volScalarFieldValue alpha.water 1 ); } ); __________________________________________________ ____________________ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { wall { type fixedValue; value uniform (0 0 0); } inlet { type pressureInletOutletVelocity; value uniform (0 0 -1); } outlet { type pressureInletOutletVelocity; value uniform (0 0 0); } __________________________________________________ ___________________ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { wall { type zeroGradient; } outlet { type inletOutlet; inletValue uniform 0; value uniform 0; } inlet { type inletOutlet; inletValue uniform 0; value uniform 0; } } |
|
February 12, 2016, 01:41 |
|
#2 |
Senior Member
Hesam
Join Date: Feb 2015
Posts: 139
Rep Power: 11 |
Hi Bradley,
For inlet you can assign alpha=1 to inlet water: inlet { type fixedValue; value uniform 1; } |
|
February 12, 2016, 13:51 |
|
#3 |
New Member
Bradley
Join Date: Feb 2016
Posts: 7
Rep Power: 10 |
Thank you very much for your time and willingness to help. Unfortunately, setting alpha equal to 1 for the inlet doesn't quite work. It creates a thin layer of liquid where my inlet is located (at t=0) and then immediately falls. It doesn't form a continuous flow.
|
|
February 12, 2016, 16:24 |
|
#4 |
Senior Member
Hesam
Join Date: Feb 2015
Posts: 139
Rep Power: 11 |
In this case alpha1 distribution depend on your velocity at inlet.
In my case,I assign a fixed value to alpha at inlet(alpha=1 or water) and assign alpha=0 (or air) to internal field.after 1 second water fill the whole of the domain. |
|
February 15, 2016, 14:16 |
|
#5 |
New Member
Bradley
Join Date: Feb 2016
Posts: 7
Rep Power: 10 |
Again, I am very new to OpenFOAM so I am extremely grateful for all suggestions and I thank you. Unfortunately, It still does not seem to be working, even when the suggested code is copied and pasted directly. I've attached two files to demonstrate my issue. The inlet patch is red, giving an alpha=1 as desired at time=0. However, in the next time frame, the figure remains exactly the same. The liquid does not seem to be flowing.
In addition, interFoam is having a hard time solving the problem now. It must use a time step around the magnitude of E-26. I'm not sure what could have caused such a drastic change. |
|
February 15, 2016, 18:41 |
|
#6 |
Senior Member
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 18 |
Hello bdh1103,
I think you missed setFields command to start the volume of liquid. edit: sorry misread your first item. Your problem is probably that at time zero there is a big change, because you do not start with a stable situation. I think you need to make the influent first going up, so it can fill with liquid or you must first fill the top box with liquid (setFields) and than start with a flow from the top. Hope that helps, Wouter |
|
February 15, 2016, 18:45 |
|
#7 |
New Member
Bradley
Join Date: Feb 2016
Posts: 7
Rep Power: 10 |
Hello wouter,
Thank you for your input and suggestion. I actually left the box to cell coordinates in the code but gave the dimensions (0 0 0) (0 0 0) so I could isolate the effect of only the inlet stream (or at least the one I'm trying to create). If you have any other recommendations, please do not hesitate to put them. I've searched for weeks for a solution to this problem. |
|
February 16, 2016, 09:12 |
|
#8 |
Senior Member
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 200
Rep Power: 18 |
Hi Bradley,
I don't know why, but this kind of inlet condition that you are trying to use, don't work with interFoam version 2.3 and all newer versions. I was trying to solve a similar case and wasn't able to get convergence with this inlet condition. If you look at the weirOverflow tutorial you'll notice that the inlet is done through variableHeightFlowRateInletVelocity for U and variableHeightFlowRate for alpha.water. Using this kind of inlet I was able to converge the simulations. So, I suggest that you try it. Another solution would be using an older version, like 2.2, to do the simulation. Best Regards, Paulo |
|
February 17, 2016, 14:37 |
Update
|
#9 |
New Member
Bradley
Join Date: Feb 2016
Posts: 7
Rep Power: 10 |
First, I would like to thank you, Paulo. This answer makes sense.
I'm attempting to implement your suggestion but I am having a little difficulty. perhaps you could be of assistance. Here is the current relevant code (error message displayed at the end). __________________________________________________ _______________________ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { wall { type zeroGradient; } inlet { type variableHeightFlowRate; lowerBound 1; // I have also tried setting this to 0. upperBound 1; value uniform 1; } outlet { type inletOutlet; inletValue uniform 0; value uniform 0; } } // ************************************************** *********************** // __________________________________________________ _______________________ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "include/initialConditions" dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { wall { type fixedValue; value uniform (0 0 0); } inlet { type variableHeightFlowRateInletVelocity; flowRate $inletFlowRate; alpha alpha.water; value uniform (0 0 0); } outlet { type pressureInletOutletVelocity; value uniform (0 0 0); } } // ************************************************** *********************** // __________________________________________________ _______________________ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ inletFlowRate 75; #inputMode merge // ************************************************** *********************** // __________________________________________________ ________________________ Here is the error code after setFields-->decompPar-->mpirun -n 8 interFoam -parallel __________________________________________________ ___________________ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 PIMPLE: Operating solver in PISO mode Reading field p_rgh Reading field U Reading/calculating face flux field phi Reading transportProperties Selecting incompressible transport model Newtonian Selecting incompressible transport model Newtonian Selecting turbulence model type laminar Reading g Reading hRef Calculating field g.h No MRF models present No finite volume options present DICPCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0, global = 0, cumulative = 0 Courant Number mean: 0 max: 0 Starting time loop Courant Number mean: 0 max: 0 Interface Courant Number mean: 0 max: 0 deltaT = 0.001 Time = 0.001 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 0, Final residual = 0, No Iterations 0 Phase-1 volume fraction = 0 Min(alpha.water) = 0 Max(alpha.water) = 0 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0 Min(alpha.water) = 0 Max(alpha.water) = 0 [4] #0 Foam::error:rintStack(Foam::Ostream&)[5] [6] #0 Foam::error:rintStack(Foam::Ostream&)[7] #0 Foam::error:rintStack(Foam::Ostream&)[0] #0 Foam::error:rintStack(Foam::Ostream&)[1] #[2] #0 Foam::error:rintStack(Foam::Ostream&)[3] #0 Foam::error:rintStack(Foam::Ostream&)0 #0Foam::error:rintStack(Foam::Ostream&) Foam::error:rintStack(Foam::Ostream&) at ??:? [0] #1 Foam::sigFpe::sigHandler(int) at ??:? [6] #1 Foam::sigFpe::sigHandler(int) at ??:? [3] #1 Foam::sigFpe::sigHandler(int) at ??:? [2] #1 Foam::sigFpe::sigHandler(int) at ??:? [4] #1 Foam::sigFpe::sigHandler(int) at ??:? [1] #1 Foam::sigFpe::sigHandler(int) at ??:? [5] #1 Foam::sigFpe::sigHandler(int) at ??:? [0] #2 ? at ??:? [7] #1 Foam::sigFpe::sigHandler(int) at ??:? [2] #2 ? at ??:? [6] #2 ? at ??:? [1] #2 ? at ??:? [3] #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" [0] #3 Foam::variableHeightFlowRateInletVelocityFvPatchVe ctorField::updateCoeffs() at ??:? [5] #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" at ??:? [4] #2 ?[2] #3 Foam::variableHeightFlowRateInletVelocityFvPatchVe ctorField::updateCoeffs() in "/lib/x86_64-linux-gnu/libc.so.6" [6] #3 Foam::variableHeightFlowRateInletVelocityFvPatchVe ctorField::updateCoeffs() in "/lib/x86_64-linux-gnu/libc.so.6" [1] #3 Foam::variableHeightFlowRateInletVelocityFvPatchVe ctorField::updateCoeffs() in "/lib/x86_64-linux-gnu/libc.so.6" [3] #3 Foam::variableHeightFlowRateInletVelocityFvPatchVe ctorField::updateCoeffs() at ??:? [7] #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" ... this goes on for awhile.... [ubuntu:03518] *** Process received signal *** [ubuntu:03518] Signal: Floating point exception (8) [ubuntu:03518] Signal code: (-6) [ubuntu:03518] Failing at address: 0x3e800000dbe [ubuntu:03518] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x36d40) [0x7f05147b8d40] [ubuntu:03518] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7f05147b8cc9] [ubuntu:03518] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x36d40) [0x7f05147b8d40] [ubuntu:03518] [ 3] /opt/openfoam30/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so(_ZN4Foam53variableHeightFlowRat eInletVelocityFvPatchVectorField12updateCoeffsEv+0 x384) [0x7f0517812d94] [ubuntu:03518] [ 4] interFoam(_ZN4Foam14GeometricFieldINS_6VectorIdEEN S_12fvPatchFieldENS_7volMeshEE22GeometricBoundaryF ield12updateCoeffsEv+0x3d) [0x455b7d] [ubuntu:03518] [ 5] interFoam(_ZN4Foam8fvMatrixINS_6VectorIdEEEC1ERKNS _14GeometricFieldIS2_NS_12fvPatchFieldENS_7volMesh EEERKNS_12dimensionSetE+0x229) [0x45f569] [ubuntu:03518] [ 6] interFoam() [0x45f6bb] [ubuntu:03518] [ 7] interFoam() [0x431e9e] [ubuntu:03518] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f05147a3ec5] [ubuntu:03518] [ 9] interFoam() [0x4382e0] [ubuntu:03518] *** End of error message *** -------------------------------------------------------------------------- mpirun noticed that process rank 2 with PID 3513 on node ubuntu exited on signal 8 (Floating point exception). I've also tried modifying the weirOverflow tutorial itself to no avail. Last edited by bdh1103; February 17, 2016 at 15:42. |
|
February 24, 2016, 15:38 |
|
#10 |
New Member
Bradley
Join Date: Feb 2016
Posts: 7
Rep Power: 10 |
UPDATE:
I have tried to alter the weirflow tutorial as well as the water channel tutorial. I can not get either case to work. |
|
March 6, 2016, 10:29 |
|
#11 |
Senior Member
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 200
Rep Power: 18 |
Hi,
An update of my post above: Recently I sent a bug report about the inlet conditions for interfoam. See the report in this link http://www.openfoam.org/mantisbt/view.php?id=2013 As explained by Henry, the problem was related to the condition in p_rgh and not in the conditions for U and alpha, as I tought. So it's possible to create an inlet condition, for version 2.3 and newer, as long as you use the correct boundary conditon for p_rgh which is fixedFluxPressure. Best regards, Paulo |
|
Tags |
constant, flow, geometry, interfoam, real |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Issues on the simulation of high-speed compressible flow within turbomachinery | dowlee | OpenFOAM Running, Solving & CFD | 11 | August 6, 2021 07:40 |
Two Mass flow inlet bc convergence problem | nabidinhomessi | Main CFD Forum | 5 | December 14, 2015 08:11 |
Multiphase Flow BC-Mass Flow inlet not available? | yimingchen.ok@gmail.com | Siemens | 1 | July 18, 2014 07:08 |
Cells with t below lower limit | Purushothama | Siemens | 2 | May 31, 2010 22:58 |
Mass Flow Inlet | Pravir Kumar Rai | FLUENT | 0 | February 19, 2003 15:03 |