|
[Sponsors] |
October 27, 2016, 05:00 |
GroovyBC
|
#1 |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
Hi to all,
which is the correct file format to set a boundary condition with GroovyBC starting from an external file? Which extension typare allowed? Thanks for help! |
|
October 27, 2016, 06:07 |
|
#2 |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
ok i found it accepts the .csv and the openFoam-format. I have to work with .csv format but it seems not to work. Maybe i made some mistake in the file boundary
Code:
inlet1 { type groovyBC ; fields ( U ); outOfBounds clamp; readerType csv fileName "$FOAM_CASE/tab.csv"; hasHeaderLine 1; valueColumns 3; } Thanks! |
|
October 27, 2016, 13:01 |
|
#3 |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
Ok i changed road and i decided to insertthe li directly in U file in ti manner:
Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet1 { type fixedValue value nonuniform List<vector> 36 ( (-0.00053044 0.20173 0.002039) (-0.0023134 0.28452 0.0037276) (-0.0020482 0.38684 0.0054303) (0.0020481 0.38684 0.0054303) (0.0023134 0.28452 0.0037276) (0.00053044 0.20173 0.002039) (-0.0011778 0.2555 0.0033889) (-0.0037739 0.3664 0.0060664) (-0.003185 0.50186 0.0089382) (0.003185 0.50186 0.0089382) (0.0037739 0.3664 0.0060664) (0.0011778 0.2555 0.0033889) (-0.0013859 0.31758 0.0023695) (-0.0047678 0.45854 0.0042026) (-0.0040748 0.62904 0.006223) (0.0040748 0.62904 0.006223) (0.0047678 0.45854 0.0042026) (0.0013859 0.31758 0.0023695) (-0.0013859 0.31758 -0.0023695) (-0.0047678 0.45854 -0.0042026) (-0.0040748 0.62904 -0.006223) (0.0040748 0.62904 -0.006223) (0.0047678 0.45854 -0.0042026) (0.0013859 0.31758 -0.0023695) (-0.0011778 0.2555 -0.0033889) (-0.0037739 0.3664 -0.0060664) (-0.003185 0.50186 -0.0089382) (0.003185 0.50186 -0.0089382) (0.0037739 0.3664 -0.0060664) (0.0011778 0.2555 -0.0033889) (-0.00053044 0.20173 -0.002039) (-0.0023134 0.28452 -0.0037276) (-0.0020482 0.38684 -0.0054303) (0.0020481 0.38684 -0.0054303) (0.0023134 0.28452 -0.0037276) (0.00053044 0.20173 -0.002039) ) } inlet2 { type fixedValue; value uniform (0 -0.42 0); } outlet { type zeroGradient; } walls { type fixedValue; value uniform (0 0 0); } } // ************************************************************************* // however this error appear Code:
--> FOAM FATAL IO ERROR: Essential entry 'value' missing file: /home/roby/Scrivania/Tmixer_100/0/U.boundaryField.inlet1 from line 25 to line 26. From function Foam::fvPatchField<Type>::fvPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&, bool) [with Type = Foam::Vector<double>] in file lnInclude/fvPatchField.C at line 133. FOAM exiting |
|
October 28, 2016, 03:34 |
|
#4 |
Member
Brian Willis
Join Date: Mar 2011
Location: Cape Town, South Africa
Posts: 58
Rep Power: 15 |
Looks like you are missing a semi colon after your bracket which containers the list of vectors.
|
|
October 28, 2016, 05:04 |
|
#5 | |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
Quote:
thank you for your reply (you are saving my life in these days). I also forgotthe semi colon after "fixedValue" here the code corected Code:
boundaryField { inlet1 { type fixedValue; value nonuniform List<vector> 36 ( (-0.00053044 0.20173 0.002039) (-0.0023134 0.28452 0.0037276) (-0.0020482 0.38684 0.0054303) (0.0020481 0.38684 0.0054303) (0.0023134 0.28452 0.0037276) (0.00053044 0.20173 0.002039) (-0.0011778 0.2555 0.0033889) (-0.0037739 0.3664 0.0060664) (-0.003185 0.50186 0.0089382) (0.003185 0.50186 0.0089382) (0.0037739 0.3664 0.0060664) (0.0011778 0.2555 0.0033889) (-0.0013859 0.31758 0.0023695) (-0.0047678 0.45854 0.0042026) (-0.0040748 0.62904 0.006223) (0.0040748 0.62904 0.006223) (0.0047678 0.45854 0.0042026) (0.0013859 0.31758 0.0023695) (-0.0013859 0.31758 -0.0023695) (-0.0047678 0.45854 -0.0042026) (-0.0040748 0.62904 -0.006223) (0.0040748 0.62904 -0.006223) (0.0047678 0.45854 -0.0042026) (0.0013859 0.31758 -0.0023695) (-0.0011778 0.2555 -0.0033889) ); } ............. Best Regards, Roberto |
||
October 29, 2016, 11:17 |
|
#6 |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
Sorry for the bump.
The list vector works good but, because i have to work with a large number of vectors, i would like to load them directly starting from my csv file. The condition is not timevarying but fixed. Any suggestion? this is what i write till now Code:
inlet1 { type fixedValue; uniformValue csvFile; csvFileCoeffs { fileName "$FOAM_CASE/tab" outOfBounds clamp; hasHeaderLine true; // refColumn 0; i don't hav refColumn because it's not time Varying componentColumns (0 1 2); } } here the error Code:
--> FOAM FATAL IO ERROR: Essential entry 'value' missing file: /home/roby/Scrivania/ciao/0/U.boundaryField.inlet1 from line 26 to line 35. From function Foam::fvPatchField<Type>::fvPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&, bool) [with Type = Foam::Vector<double>] in file lnInclude/fvPatchField.C at line 133. FOAM exiting the guide is for timedipendent BC but i think it can ru also for fixedValue. i link also the file |
|
October 29, 2016, 11:42 |
|
#7 |
Member
Brian Willis
Join Date: Mar 2011
Location: Cape Town, South Africa
Posts: 58
Rep Power: 15 |
Hi Roberto
Looks like you need to still add Code:
value uniform (0 0 0); Regards, Brian Like this. Code:
inlet1 { type fixedValue; uniformValue csvFile; csvFileCoeffs { fileName "$FOAM_CASE/tab" outOfBounds clamp; hasHeaderLine true; // refColumn 0; i don't hav refColumn because it's not time Varying componentColumns (0 1 2); } value uniform (0 0 0); } Last edited by Dipsomaniac; October 29, 2016 at 11:48. Reason: Making it more explicit. |
|
October 29, 2016, 12:16 |
|
#8 | |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
Quote:
Thanks for your fast reply but, unfortunately, with this modification it works but it takes a null velocity boundary condition Best Regards, Roberto |
||
October 29, 2016, 14:29 |
|
#9 |
Member
Brian Willis
Join Date: Mar 2011
Location: Cape Town, South Africa
Posts: 58
Rep Power: 15 |
I am thinking that the fixedValue boundary condition can't be directly used with a CSV (external) file unfortunately. I am looking at other boundary conditions which may work for your purpose.
|
|
October 30, 2016, 12:56 |
|
#10 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
inlet { type groovyBC; valueExpression "profile(pos().y)*normal()"; lookuptables ( { name profile; readerType csv; fileName "$FOAM_CASE/profile.csv"; outOfBounds clamp; timeColumn 0; valueColumns (1); } ); }
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
November 3, 2016, 11:06 |
|
#11 |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
hi Bernhard, Thank you for you reply and contribution.
You were very clear, but i have only a last doubt about how setting the time column if i have a non time varying input field. Best Regards, Roberto |
|
November 3, 2016, 14:05 |
|
#12 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
"timeColumn" is just a name for the number of the column with the independent variable. It is named like this for historical reasons
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] groovyBC for oscillatory flow | liybzd | OpenFOAM Community Contributions | 5 | November 12, 2018 07:53 |
[swak4Foam] reactingMultiPhaseEulerFoam problems with groovyBC | zanilu70 | OpenFOAM Community Contributions | 4 | December 13, 2016 06:46 |
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam | dani2702 | OpenFOAM Community Contributions | 0 | November 17, 2016 03:30 |
[swak4Foam] groovyBC issue - k and epsilon | sagnikmazumdar | OpenFOAM Community Contributions | 24 | March 1, 2015 07:16 |
[swak4Foam] groovyBC and Eqn.setReference() | benk | OpenFOAM Community Contributions | 3 | June 2, 2011 08:49 |