|
[Sponsors] |
csv table with measured flows as inflow possible? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 8, 2023, 23:47 |
csv table with measured flows as inflow possible?
|
#1 |
New Member
Tobias
Join Date: Jul 2022
Posts: 14
Rep Power: 3 |
Hello everyone,
I have a question that has probably already been answered somewhere. In that case, I apologize that I apparently did not find the right search terms. Then I would also appreciate a reference to a suitable thread. I am working on the following problem: I am working on an experimental setup for which real measurements exist. First the water flows in a basin in free level, then it is passed through a tube filled only with water and ends again in a basin with free level. In the first basin, the flow is split, then reunited in the tube. I work with interFoam. Now my simulated values do not match the experimental values, the distribution of splitting is completely different from the experimental values. However, as I said, measured values exist in the open channel for the discharge in the form of a csv table at the point still open to the top where the flow is split. Measured values exist for different points in an x-y coordinate system in the water phase. Is there a way that I can use this table as an inflow condition? So far I have U inlet { type variableHeightFlowRateInletVelocity; flowRate $inletFlowRate; alpha alpha.water; value uniform (0 0 0); } to ensure a constant inlet flow rate for the free level basin. Any hint would be appreciated Best regards |
|
January 9, 2023, 04:09 |
|
#2 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,074
Rep Power: 26 |
Hello,
If you are using a recent version of OpenFOAM, the flowRate parameter of variableHeightFlowRateInletVelocity is a type Function1 which means you can use time-varying tables or files as an input: Code:
inlet { type variableHeightFlowRateInletVelocity; alpha alpha.water; value uniform (0 0 0); flowRate table ( (0.0 3) (1.0 6) ); } Code:
inlet { type variableHeightFlowRateInletVelocity; alpha alpha.water; value uniform (0 0 0); flowRate csvFile; nHeaderLine 1; refColumn 0; componentColumns ( 1 ); separator ","; mergeSeparators no; file "<constant>/inlet.csv"; } Regards, Yann |
|
January 9, 2023, 04:19 |
|
#3 |
New Member
Tobias
Join Date: Jul 2022
Posts: 14
Rep Power: 3 |
Thank you, I'll have a look into it but on the first sight I think that is exactly what I was looking for
|
|
January 15, 2023, 11:54 |
|
#4 |
New Member
Tobias
Join Date: Jul 2022
Posts: 14
Rep Power: 3 |
I tried to understand the use of csvFile, but unfortunately I don't.
My CSV looks like this: Code:
y, z, vX, vY, vZ 0.1, 0.1, 0.31, -0.23, 0.01 0.1, 0.2, 0.59, -0.11, 0.12 0.2, 0.1, 0.31, 0.22, 0.04 0.2, 0.2, 0.32, -0.12, 0.13 ... From CSV.H (OpenFOAM 2212) I read Code:
Description Templated CSV function. Reference column is always a scalar, e.g. time. Usage: \verbatim <entryName> csvFile; <entryName>Coeffs { nHeaderLine 4; // number of header lines refColumn 0; // reference column index componentColumns (1 2 3); // component column indices separator ","; // optional (defaults to ",") mergeSeparators no; // merge multiple separators file "fileXYZ"; // name of csv data file outOfBounds clamp; // optional out-of-bounds handling interpolationScheme linear; // optional interpolation scheme } \endverbatim Code:
nHeaderLine So I need a Code:
refColumn Code:
componentColumns |
|
January 16, 2023, 05:38 |
|
#5 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,074
Rep Power: 26 |
Hello Tobias,
My apologies, I did not pay enough attention to your first message and my answer was meant to set a time-varying flowrate. The variableHeightFlowRateInletVelocity BC is meant to maintain a user-specified flowrate on a phase with variable height. For instance on an inlet partially filled with water, this BC will allow to define a flowrate for the water, and the velocity on the patch will adjust to maintain this flowrate (if water height on the patch increases, the velocity will decrease to maintain the proper flowrate, and vice versa) So you cannot define a spatially varying velocity with this condition as it is not really what it has been designed to do. You should have a look at the uniformFixedValue condition, which should allow to define both time and space varying velocity. Unfortunately I'm not sure there are examples with space varying parameters in the tutorials so you might have to dig a bit into it to find how to use it. Another option would be to use the timeVaryingMappedFixedValue condition. There is one tutorial using it to map experimental data to the inlet, but it requires to properly format input data: $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDailyExptInlet I don't have experience with those conditions so I cannot guarantee it will work as you expect but I think it is worth having a look at it. Regards, Yann |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
QGDsolver - OpenFOAM computational framework for fluid flows based on regularized equ | mkraposhin | OpenFOAM Announcements from Other Sources | 7 | September 13, 2021 03:09 |
Swirl component in inflow BC for 2d axisymmetric flows | vishalsacharya | OpenFOAM Pre-Processing | 2 | November 2, 2018 05:33 |
Derivation of the pressure-correction equation for compressible flows | luftraudi | Main CFD Forum | 0 | July 17, 2012 06:35 |
penalty-projection method for incompressible flows | Isabel | Main CFD Forum | 0 | May 8, 2006 03:49 |
Prescribed inflow velocity profile - how to? | Alan | Main CFD Forum | 10 | October 28, 2005 12:14 |