|
[Sponsors] |
time dependence - inlet velocity - validation (paper) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 9, 2014, 23:25 |
time dependence - inlet velocity - validation (paper)
|
#1 |
Member
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11 |
Hi. how can I use this velocity profile(inlet) in my simulation? My code gives error( as follows).
This is the picture of my profile (please, see FIG. 2 ): http://www.ijens.org/Vol_13_I_03/133...JMME-IJENS.pdf I tried use this code: Code:
nlet { type timeVaryingUniformFixedValue; fileName "$FOAM_CASE/time-series"; outOfBounds clamp; // (error|warn|clamp|repeat) } And the time-series example file: Code:
( (0 1.3332) (0.05 10) (0.1 0) ) But gives the following error: HTML Code:
a@a-Aspire-V3-571:~/Desktop/teste_time_series/pitzDaily$ pimpleFoam /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.3.0-f5222ca19ce6 Exec : pimpleFoam Date : Nov 10 2014 Time : 02:23:50 Host : "a-Aspire-V3-571" PID : 26336 Case : /home/a/Desktop/teste_time_series/pitzDaily nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading field p Reading field U --> FOAM FATAL IO ERROR: Unknown patchField type timeVaryingUniformFixedValue for patch type patch Valid patchField types are : 74 ( SRFFreestreamVelocity SRFVelocity activeBaffleVelocity activePressureForceBaffleVelocity advective atmBoundaryLayerInletVelocity calculated codedFixedValue codedMixed cyclic cyclicACMI cyclicAMI cyclicSlip cylindricalInletVelocity directionMixed empty externalCoupled fixedGradient fixedInternalValue fixedJump fixedJumpAMI fixedMean fixedNormalSlip fixedValue flowRateInletVelocity fluxCorrectedVelocity freestream inletOutlet interstitialInletVelocity kqRWallFunction mapped mappedField mappedFixedInternalValue mappedFixedPushedInternalValue mappedFlowRate mappedVelocityFlux mixed movingWallVelocity nonuniformTransformCyclic oscillatingFixedValue outletInlet outletMappedUniformInlet outletPhaseMeanVelocity partialSlip pressureDirectedInletOutletVelocity pressureDirectedInletVelocity pressureInletOutletParSlipVelocity pressureInletOutletVelocity pressureInletUniformVelocity pressureInletVelocity pressureNormalInletOutletVelocity processor processorCyclic rotatingPressureInletOutletVelocity rotatingWallVelocity sliced slip supersonicFreestream surfaceNormalFixedValue swirlFlowRateInletVelocity symmetry symmetryPlane timeVaryingMappedFixedValue translatingWallVelocity turbulentInlet uniformFixedGradient uniformFixedValue uniformInletOutlet uniformJump uniformJumpAMI variableHeightFlowRateInletVelocity waveTransmissive wedge zeroGradient ) file: /home/a/Desktop/teste_time_series/pitzDaily/0/U.boundaryField.inlet from line 36 to line 38. From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&) in file /home/opencfd/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 143. FOAM exiting Best Regards, Vitor |
|
November 10, 2014, 03:50 |
|
#2 |
Senior Member
|
Hi,
it's just Code:
uniformFixedValue |
|
November 10, 2014, 10:04 |
|
#3 |
Member
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11 |
alexmye, gives erros again...
see: Code:
a@a-Aspire-V3-571:~/Desktop/teste_time_series/pitzDaily$ pimpleFoam /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.3.0-f5222ca19ce6 Exec : pimpleFoam Date : Nov 10 2014 Time : 12:54:23 Host : "a-Aspire-V3-571" PID : 3892 Case : /home/a/Desktop/teste_time_series/pitzDaily nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading field p Reading field U --> FOAM FATAL IO ERROR: keyword uniformValue is undefined in dictionary "/home/a/Desktop/teste_time_series/pitzDaily/0/U.boundaryField.inlet" file: /home/a/Desktop/teste_time_series/pitzDaily/0/U.boundaryField.inlet from line 42 to line 44. From function dictionary::lookupEntry(const word&, bool, bool) const in file db/dictionary/dictionary.C at line 437. FOAM exiting Code:
FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type uniformFixedValue; fileName "$FOAM_CASE/time-series"; outOfBounds clamp; // (error|warn|clamp|repeat) } outlet { type zeroGradient; } ... Code:
( time0 velocity0 time1 velocity1 time2 velocity2 time3 velocity3 time4 velocity4 ) Code:
( (time0 velocity0) (time1 velocity1) (time2 velocity2) (time3 velocity3) (time4 velocity4) ) |
|
November 10, 2014, 10:21 |
|
#4 | |
Senior Member
|
Hi,
guess I missed it So let's go to source file of the BC and check syntax: this is for constant (uniformFixedValueFvPatchField.H) Code:
myPatch { type uniformFixedValue; uniformValue constant 0.2; } Code:
myPatch { type uniformFixedValue; uniformValue tableFile; tableFileCoeffs { dimensions [0 0 1 0 0]; // optional dimensions fileName dataFile; // name of data file outOfBounds clamp; // optional out-of-bounds handling interpolationScheme linear; // optional interpolation method }; value uniform (0 0 0); // placeholder } Quote:
Last edited by alexeym; November 10, 2014 at 10:24. Reason: typo |
||
November 10, 2014, 11:52 |
|
#5 |
Member
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11 |
ok.. My mesh is from pitzDaily tutorial case. My inlet is exactly the same from the case, with normal vector = (1,0,0) , as you can see:
http://postimg.org/image/r6ouivpuf/ But, I did not undertand well how would be my time-serie file... For example, If my intention is to generate the following inlet velocity time-serie: 0 seconds = (1 0 0) -> velocity vector to the patch face of 1m/s in x direction,because normal face is (1,0,0) 0.5 seconds = (5 0 0) -> velocity vector to the patch face of 5m/s in x direction 1 seconds = (10 0 0) -> velocity vector to the patch face of 10m/s in x direction 1.5 seconds = (0 0 0) -> velocity vector to the patch face of 0m/s in x direction My file would be: Code:
( 0.0 (1 0 0) 0.5 (5 0 0) 1.0 (10 0 0) 1.5 (0 0 0) ); Code:
inlet { type uniformFixedValue; uniformValue tableFile; tableFileCoeffs { dimensions [0 0 1 0 0]; // optional dimensions fileName time-series; // name of data file outOfBounds clamp; // optional out-of-bounds handling interpolationScheme linear; // optional interpolation method }; value uniform (0 0 0); // placeholder } Code:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.3.0-f5222ca19ce6 Exec : pimpleFoam Date : Nov 10 2014 Time : 14:48:17 Host : "a-Aspire-V3-571" PID : 8328 Case : /home/a/Desktop/teste_time_series/pitzDaily nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading field p Reading field U --> FOAM FATAL IO ERROR: wrong token type - expected string, found on line 60 the word 'time-series' file: /home/a/Desktop/teste_time_series/pitzDaily/0/U.boundaryField.inlet.tableFileCoeffs.fileName at line 60. From function operator>>(Istream&, fileName&) in file primitives/strings/fileName/fileNameIO.C at line 56. FOAM exiting |
|
November 10, 2014, 12:15 |
|
#6 |
Senior Member
|
Hi,
the error is quite obvious (and the reason for it was explained in error message), you have to specify file name as a string (i.e. use quotation marks). Concerning your first question, it depends on how you'd like the velocity to change. With the file you've posted it'll linearly increase from 1 to 5 during 0.5 s, the to 10 during next 0.5 s and finally linearly go to zero during next 0.5 s. If it's what you want, yes, file is right. About format, it seems to be correct. Also you can try to use csvFile, it has more clear configuration dictionary: Code:
csvFileCoeffs { nHeaderLine 4; refColumn 0; // reference column index componentColumns (1 2 3); // component column indices separator ","; // optional (defaults to ",") mergeSeparators no; // merge multiple separators fileName "fileXYZ"; // name of csv data file outOfBounds clamp; // optional out-of-bounds handling interpolationScheme linear; // optional interpolation scheme } |
|
November 10, 2014, 19:27 |
|
#7 |
Member
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11 |
ok.
For those in the future have the same question that I follow the solution to my original question. The solution was given by our friend Alexeym. Thank you Alex! I just had to make a correction in the time series file, inserting brackets as seen below. Then follows my test case to other beginers (like me). I changed the name of "time-series" for "time"): Here is it: http://www.4shared.com/rar/IM-5z-lzb...ity_chang.html Alex, can you tell me the other schemes beyond the linear interpolation? They are mentioned in the documentation or some other file? I am studying the openfoam shortly. Sorry, I'm still very novice. Thank you! I hope this post can help others. |
|
November 11, 2014, 02:16 |
|
#8 | |
Senior Member
|
Hi,
Quote:
In your case put banana instead of linear for interpolationScheme. Or you can go to $WM_PROJECT_DIR/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.H (well, not exactly TableFile/TableFile.H but Table/Table.H, as TableFile is more-or-less just responsible for I/O), learn that interpolation is done via interpolationWeights class, then go to $WM_PROJECT_DIR/src/OpenFOAM/interpolations/interpolationWeights and learn that there are two subclasses: linear and spline. I guess, first method is simpler. |
||
November 16, 2014, 17:48 |
Pressure instead of velocity
|
#9 |
New Member
Fredrik Eikeland Fossan
Join Date: Oct 2014
Posts: 6
Rep Power: 11 |
Hello. How would the syntax be if I was to load pressure at inlet from a .csv?
for instance something like this? t=0 : p=0 t=0.1=1 t=0.2=2 also I guess that the time set in contradict would have to match time in 0-directory? |
|
November 17, 2014, 01:35 |
|
#10 |
Senior Member
|
Hi,
in general CSV files have the following format (http://tools.ietf.org/html/rfc4180): val11,val12 val21,val22 ... So your pressure CSV file should be something like: 0,0 0.1,1 0.2,2 ... Didn't quite get the second part of the question. |
|
November 17, 2014, 14:34 |
|
#11 |
New Member
Fredrik Eikeland Fossan
Join Date: Oct 2014
Posts: 6
Rep Power: 11 |
Hello. I I´m trying to do this now, and my code looks like this:
PHP Code:
PHP Code:
|
|
November 17, 2014, 14:37 |
|
#12 |
Senior Member
|
Eh... you've forgotten semicolon after
Code:
fileName "~/Table_Pressure" |
|
November 17, 2014, 15:05 |
componentColumns
|
#13 |
New Member
Fredrik Eikeland Fossan
Join Date: Oct 2014
Posts: 6
Rep Power: 11 |
aha. Thanks
Now it manages to read the file and solving, but it seems like it only uses the value in the first row: 0,4 which is time=0, pressure=4 from then on the pressure is constant and does not change according to the .csv file next couple of rows are: 0.04,3.5052 0.08,2.1433 0.12,0.2511 but from the solution the pressure is kept constant at the inlet my code is as follows: PHP Code:
|
|
November 18, 2014, 03:18 |
|
#14 |
Senior Member
|
Post your case. I've just created test case and pressure follows CSV-file values.
|
|
November 18, 2014, 05:07 |
Cavity_Case_Pessure_From_CSV
|
#15 |
New Member
Fredrik Eikeland Fossan
Join Date: Oct 2014
Posts: 6
Rep Power: 11 |
Here it is. Tried with and without having commas after the pressures in the csv file.
Thanks Fred |
|
November 18, 2014, 05:49 |
|
#16 |
Senior Member
|
Well
1. You've got wrong line endings (Windows?), so I guess OpenFOAM reads the file as a single line (then takes 0 as a single time value in the table and 4 as a single pressure value). 2. When I corrected line ending, I also found that after 0.96 you go back in time to 0.1. This also makes OpenFOAM quite unhappy. Last edited by alexeym; November 22, 2014 at 13:52. |
|
November 18, 2014, 07:00 |
|
#17 |
New Member
Fredrik Eikeland Fossan
Join Date: Oct 2014
Posts: 6
Rep Power: 11 |
Aha. yeah I made a new file now, which works. I made the original in excel and than exported as .csv, maybe something went wrong. Thanks a lot for your help
Fred |
|
November 4, 2015, 22:04 |
|
#18 | |
Member
methma Rajamuni
Join Date: Jul 2015
Location: Victoria, Australia
Posts: 40
Rep Power: 10 |
Quote:
I have the same question. I would like to see your files since it gives me an error when I run the decomposePar. I could not get it from the link you mentions, so can you please give me your files to have a look? Thank you very much Methma |
||
November 4, 2015, 22:36 |
|
#19 |
Member
methma Rajamuni
Join Date: Jul 2015
Location: Victoria, Australia
Posts: 40
Rep Power: 10 |
||
April 23, 2016, 08:57 |
|
#20 |
Member
Lorenzo
Join Date: Oct 2015
Location: Graz
Posts: 49
Rep Power: 10 |
hello,
I know the thread is old but maybe you can help me with a very similar issue. My inlet patch, under the name "throat" has a uniformFixedValue BC. My settings are: throat { type uniformFixedValue; uniformValue csvFile; csvFileCoeffs { fileName "~/Documenti/Lorenzo/Materie_quinto_anno/Tesi_Les_Naso/Manara_Copia/DeltaPTot/pressure_profile.dat"; nHeaderLine 0; mergeSeparators no; oufOfBounds clamp; refColumn 0; componentColumns (1); } } I just copied them from the uploaded cavityOscPcsv case. Using pimpleFoam as solver for my case I get the following error: FOAM FATAL IO ERROR: keyword uniformValueCoeffs is undefined in dictionary "/home/user/Documenti/Lorenzo/Materie_quinto_anno/Tesi_Les_Naso/Manara_Copia/DeltaPTot/0/p.boundaryField.throat" file: /home/user/Documenti/Lorenzo/Materie_quinto_anno/Tesi_Les_Naso/Manara_Copia/DeltaPTot/0/p.boundaryField.throat from line 76 to line 85. From function dictionary::subDict(const word& keyword) const in file db/dictionary/dictionary.C at line 648. FOAM exiting What am I missing to specify? Thanks |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
High Courant Number @ icoFoam | Artex85 | OpenFOAM Running, Solving & CFD | 11 | February 16, 2017 13:40 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 00:01 |
Help for the small implementation in turbulence model | shipman | OpenFOAM Programming & Development | 25 | March 19, 2014 10:08 |
Reusing the inlet time directories in timeVaryingMappedFixedValue | ngj_22 | OpenFOAM Running, Solving & CFD | 0 | January 24, 2013 10:22 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 02:58 |