|
[Sponsors] |
January 28, 2016, 04:59 |
Different inlet mediums at different times
|
#1 |
New Member
Join Date: Dec 2015
Posts: 15
Rep Power: 10 |
Dear All,
Would it be possible please to help me with the below issue. I need to perform CFD transient analysis in a pipe section and insert three different mediums (oil and gas and water) at different times. For example: Initial state: t=0s / The pipe is full of water (density: 1025kg/m3) From t=1s to t=5s / Oil enters the pipe (density: 800kg/m3, u: 1.5m/s) From t=5s to t=10s / Gas enters the pipe (density: 400kg/m3, u: 1.5m/s) From t=10s to t=15s / Oil enters the pipe (density: 800kg/m3, u: 1.5m/s) From t=15s to t=20s / Gas enters the pipe (density: 400kg/m3, u: 1.5m/s) Is this feasible in OpenFOAM? Could you please give me some advice on how to implement this sequence? I am using InterFoam solver for my analysis. I can provide the run files if needed. Thank you in advance. |
|
January 31, 2016, 14:33 |
|
#2 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quote:
__________________
|
||
January 31, 2016, 16:59 |
|
#3 |
New Member
Join Date: Dec 2015
Posts: 15
Rep Power: 10 |
Dear wyldckat,
Thank you very much for your informative reply. I will follow your advice and come back with results! Best Regards |
|
February 17, 2016, 10:16 |
|
#4 |
New Member
Join Date: Dec 2015
Posts: 15
Rep Power: 10 |
Hello wyldckat,
I think I managed to install swak4foam. For information, the “swak4foam” folder is now located in my OpenFOAM’s “tutorials” folder. Once I type “funkySetFields”, while being into the “swak4foam” folder, I get the message below. Code:
[ofuser@boot2docker swak4Foam]$ funkySetFields /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 3.0.0-6abec57f5449 Exec : funkySetFields Date : Feb 17 2016 Time : 11:39:23 Host : "boot2docker" PID : 10036 Case : /home/ofuser/OpenFOAM/ofuser-3.0.0/run/tutorials/swak4Foam nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMas ter allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // swakVersion: 0.4.0 (Release date: Next release) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // In the test case's inlet field, I have included: From t=0s to t=3s, the velocity is 3m/s, otherwise the velocity is 0m/s. OpenFOAM zeros the velocity at 3s, as intended. Code:
internalField uniform (3 0 0); boundaryField { inlet1 { type groovyBC; valueExpression "(time()< 3?vector(3,0,0):vector(0,0,0))"; value uniform (3 0 0); } From t=0s to t=5s, oil comes from my inlet From t=5s to t=10s, gas comes from my inlet From t=10s to t=15s, oil comes from my inlet …… and so on. Would it be possible please to advise me if there is a way to use the groovyBC for this sequence? For simplicity, I currently use water and air as my phases. Since my velocity is same for both phases, I would assume that the “U” file would not need the groovyBC and it can be in the form: Code:
internalField uniform (3 0 0); boundaryField { inlet1 { type fixedValue; value uniform (3 0 0); } At the moment, I have only a “alpha.water” file in my “0” folder. Would I need a “alpha.air” file as well? How could I link the different times to each phase? I also tried the UniformFixedValue command in the transportProperties file (without using groovyBC) but unfortunately with no success. Would it be possible please to show me an example on how to use this command for my purpose? Does this command need to be used in conjunction with swak4foam? Apologies for the long message. Thank you, Best Regards koscfd |
|
February 21, 2016, 15:27 |
|
#5 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick answer: OK, this is a good start:
Quote:
Code:
internalField uniform (3 0 0); boundaryField { inlet1 { type groovyBC; valueExpression "(time()<5.0?vector(3,0,0):(time()<10.0?vector(2,0,0):(time()<15.0?vector(1,0,0):vector(0,0,0))))"; value uniform (3 0 0); }
__________________
|
||
February 24, 2016, 05:05 |
|
#6 |
New Member
Join Date: Dec 2015
Posts: 15
Rep Power: 10 |
Dear wyldckat,
Your help was phenomenal! Thank you very much. I need to run a few cases to finalise my desired result, however, OpenFOAM/Swak runs fine with the syntax you provided. In the meantime, I also managed to achieve this sequence with your alternative suggestion, i.e., by typing the code below in the alpha.water: Code:
boundaryField { inlet1 { type uniformFixedValue; uniformValue table ( (0.0 1.0) (3.999 1.0) (4.0 0.0) (7.999 0.0) (8.0 1.0) (11.999 1.0) (12.0 0.0) ); } I will come back with more results. Kind Regards koscfd |
|
March 17, 2016, 06:09 |
|
#7 |
New Member
Join Date: Dec 2015
Posts: 15
Rep Power: 10 |
Dear wyldckat,
I finalised the model and I am now in the post-processing stage where I need to extract the pressure profile along the pipe. In my "0" folder, the input field relevant to pressure is the "p_rgh" which I have set as below: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; } outlet { type zeroGradient; } walls { type zeroGradient; } defaultFaces { type empty; } } // ************************************************************************* //
0s-4s Oil 4s-8s Gas 8s-12s Oil 12s onwards Gas Thank you, Kind Regards, Koscfd |
|
March 28, 2016, 13:48 |
|
#8 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings Koscfd,
I've finally managed to take a look into your questions. Quote:
Code:
p_rgh = p - rho * g * height In principle, yes, the "p" field is the pressure field you're looking for. Problem is that (as far as I can remember) this "p" pressure field doesn't include the dynamic pressure... but usually this term is very small. Quote:
Therefore, the values you are getting are related to the reference pressure level of 0 Pascal. If your actual reference pressure is 1 atm, then the values you are getting are in fact:
Quote:
Although... hold on... now that I think about it, the range of 5 to -17 kPa seems to be a lot. Maybe you've got the units wrong for the pipe dimensions? Then again, the mesh does look like it's a bit coarse. Again, you might want to do a bit of a mesh resolution study, to get a better notion of what you're getting. Best regards, Bruno
__________________
|
||||
April 4, 2016, 09:36 |
|
#9 |
New Member
Join Date: Dec 2015
Posts: 15
Rep Power: 10 |
Dear wyldckat,
Thank you very much for your input! It was really helpful! I have already started a mesh resolution study. Best Regards, koscfd |
|
May 6, 2016, 07:31 |
|
#10 |
New Member
Join Date: Dec 2015
Posts: 15
Rep Power: 10 |
Greetings wyldckat,
In my model, I have set the multiphase flow as we discussed above with an inlet velocity of 13.25m/s. What I would need is to also set operating pressure in the pipe. This would mean that my flow would run inside the pipe with a velocity of 13.25m/s and at a pressure of say 100bar. I ran a few sensitivity cases and noticed that when I set pressure to “zero gradient” at inlet, outlet and walls, the flow speed is constant and unaffected. However, when I set the pressure to 100bar, the flow speed seems to gradually slow down for both phases. Could you please advise me if this is the correct way to define the operating pressure in the pipe? U Field: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.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 (13.25 0 0); boundaryField { inlet { type pressureInletOutletVelocity; value uniform (13.25 0 0); } outlet { type zeroGradient; } walls { type fixedValue; value uniform (0 0 0); } defaultFaces { type empty; } } // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 1.0E7; boundaryField { inlet { type uniformFixedValue; uniformValue constant 1.0E7; } outlet { type zeroGradient; } walls { type zeroGradient; } defaultFaces { type empty; } } // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object alpha.oil; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type groovyBC; valueExpression "((time()<7.925 || (12.861<=time() && time()<20.786) || (25.722<=time() && time()<33.647) || (38.583<=time() && time()<46.508) || (51.444<=time() && time()<59.369)) ? 1.0 : 0.0)"; value uniform 0; } outlet { type zeroGradient; } walls { type zeroGradient; } defaultFaces { type empty; } } // ************************************************************************* // Kind Regards, koscfd |
|
Tags |
time dependent, transient analysis |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
setting the correct format of nonuniform List<vector> for inlet in 0 Folder | cfdonline2mohsen | OpenFOAM Running, Solving & CFD | 8 | July 18, 2019 09:03 |
Total pressure and mass flow boundary condition at inlet | bscphil | OpenFOAM Pre-Processing | 3 | July 9, 2017 15:39 |
velocity inlet and ideal gas simultaneously-what's wrong? | preetam69 | FLUENT | 0 | September 28, 2013 05:51 |
benchmark: flow over a circular cylinder | goodegg | Main CFD Forum | 12 | January 22, 2013 12:47 |
length scales at inlet for internal flows | Anne-Marie Giroux | Main CFD Forum | 3 | July 5, 1999 22:28 |