|
[Sponsors] |
Using Field Function to call excel file table data |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 3, 2019, 10:20 |
Using Field Function to call excel file table data
|
#1 |
New Member
Mohamed
Join Date: Jan 2019
Posts: 21
Rep Power: 7 |
i would like to create a field function that to determine the level of water inlet and air which will vary with time through a certain formula. i will specify the volume fraction of the water to be "1" at a certain level and hence the air shall equip the rest of the remaining volume.
i have created a table on excel file with the csv format with different columns (x, y, z, VF) wheres the VF stand for the water volume fraction. I cannot get the required scalar from my field function when i view. you may check attached caption where i have took varies captions for the field function, excel file table and star-ccm+ gemotry. |
|
June 3, 2019, 16:53 |
|
#2 |
Senior Member
Sebastian Engel
Join Date: Jun 2011
Location: Germany
Posts: 566
Rep Power: 20 |
Hi Mohamed,
let's start with the (for me) obvious. You have an analytic equation for the VF at your inlet, haven't you? If that's the case why do you not define that function directly in a field function using the Time field function as input. This would render the intermediate step of using a csv table obsolete. If you really need the table input, then your field function, and your table are incorrect for the described task, in multiple ways... In your field function you are using a position interpolation. This will take spacially distributed point data as input to create a field (by interpolation) on your mesh - once. But you are missing time in this case. Consequently, you'd need to interpolate VF over x,z,y, and t. Check the other interpolation methods which take another input to interpolate VF. Check the manual for that matter. Looking into your table, we see that you have t, x, and VF defined. But the VF column is constantly at 1 for all time steps, but you say it should vary with time. X is varying but the values do not look as intended for the spacial distribution. Because you have given a function, i expect the points on x are not experimental reference points. It seems the columns are mixed up. How many points per period do you need to sufficiently draw a sinus curve with discreet points? Calculate the period of your function. Please draw your table over time in a diagram and assess. i am certain, that you'd need significantly more points in time to get a good representation of your function from the interpolation of the discreet points in time. Do you really need spacially and temporal distributed data for your inlet? i believe, you probably only need a time table consisting of t and VF. which will then be used as boundary condition for your inlet. The simplest way to get this table is to define the function in starccm and let starccm calculate the steps itself - via that field function. If you don't have an analytic function for the boundary condition: define a proper table. Make a plot from it to assess whether your input is plausible. Best regards, Sebastian |
|
June 3, 2019, 21:23 |
|
#3 |
New Member
Mohamed
Join Date: Jan 2019
Posts: 21
Rep Power: 7 |
Hi Sebastian,
I was trying to define the field function using Time Field Function as input but I have failed and also I have tried many times to go through the manual but couldn't get what shall I do to define this equation. and I believe this would be the easiest way. why I have keep VF for X consistently at 1 ? this is required for my simulation model in which my intention is to let STAR-CCM+ understand that for all flow belo the specified "X" Point in the table would be 100% Water wheres the remaining volume (above the specified "X" point) shall be 100% gas. as you know the Star-ccm+ if have one voulme fraction is defined for any phase of multi-phase flow, the second phase shall be defined automatically. take note that my piping center is at X=0, Y=0 & Z=0. so when I put VF=1 at the specified X point on the coordination, my intention of this to assume all area below this point shall be equipped 100% with water. and I have tried to draw the Sin curve that I obtained and it was good representation but I failed to let star-ccm+ understand. appreciate if you could guide me on how to create the Time Field Function to call out the equation. |
|
June 7, 2019, 06:32 |
|
#4 | ||
Senior Member
Sebastian Engel
Join Date: Jun 2011
Location: Germany
Posts: 566
Rep Power: 20 |
Hi Mohamed,
Quote:
Quote:
Next, research about the difference between the Centroid and Position field function. Then, figure out how you can get the x-component from those field functions (because these are vector field functions). If i interpret your description, i understand that everything above the position X=0, so position >=0 should be the VF=1 for air, else it would be 0 for air. The VF for water would be one minus the VF or air. You'll need two user field functions. One with the if-loop checking for the coordinate, and the second to compute the remainder to 1. By taking bits from the example page mentioned above, you'll be able to translate this paragraph into field functions. If you don't succeed, show what you have tried. What you don't describe, is the use of the sinus function. Are you putting a wave on top of the initial conditions? Best regards, Sebastian |
|||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] Installation Problem with OF 6 version | Aurel | OpenFOAM Community Contributions | 14 | November 18, 2020 16:18 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 01:22 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 12:41 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 09:56 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 14:11 |