|
[Sponsors] |
[swak4Foam] funkySetFields and groovyBC error |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 22, 2014, 13:23 |
funkySetFields and groovyBC error
|
#1 |
New Member
Christopher Hughes
Join Date: Oct 2012
Posts: 27
Rep Power: 14 |
I am trying to initialize a mass velocity ( rho*U units of kg m^-2 s^-1) volVectorField using both funkySetField and groovyBC.
funkySetField works well, but the issue I have is when I try to refer back to the now nonuniform internalField, I get the following error --> FOAM FATAL IO ERROR: compound has already been transfered from token on line 20 the empty compound of type List<vector> file: /home/chris/OpenFOAM/chris-2.1.1/run/Supercritical/CO_2_No_Heat_C/0/coolant/G::boundaryField::inlet1::value at line 20. From function token::transferCompoundToken(const Istream& is) in file lnInclude/token.C at line 99. FOAM aborting #0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #1 Foam::IOerror::abort() in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #2 Foam::token::transferCompoundToken(Foam::Istream const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #3 Foam::Istream& Foam:perator>><Foam::Vector<double> >(Foam::Istream&, Foam::List<Foam::Vector<double> >&) at /opt/openfoam211/src/OpenFOAM/lnInclude/ListIO.C:58 #4 Foam::Field<Foam::Vector<double> >::Field(Foam::word const&, Foam::dictionary const&, int) at /opt/openfoam211/src/OpenFOAM/lnInclude/Field.C:229 #5 Foam::groovyBCFvPatchField<Foam::Vector<double> >::groovyBCFvPatchField(Foam::fvPatch const&, Foam:imensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/home/chris/OpenFOAM/chris-2.1.1/platforms/linuxGccDPOpt/lib/libgroovyBC.so" #6 Foam::fvPatchField<Foam::Vector<double> >::adddictionaryConstructorToTable<Foam::groovyBCF vPatchField<Foam::Vector<double> > >::New(Foam::fvPatch const&, Foam:imensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/home/chris/OpenFOAM/chris-2.1.1/platforms/linuxGccDPOpt/lib/libgroovyBC.so" #7 Foam::fvPatchField<Foam::Vector<double> >::New(Foam::fvPatch const&, Foam:imensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) at ~/OpenFOAM/chris-2.1.1/run/Supercritical/SCWR/finiteVolume/lnInclude/fvPatchFieldNew.C:171 #8 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricB oundaryField(Foam::fvBoundaryMesh const&, Foam:imensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) at /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:278 #9 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readField(Foam::dictionary const&) at /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricField.C:70 #10 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readField(Foam::Istream&) at /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricField.C:113 #11 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) at /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricField.C:363 #12 at ~/OpenFOAM/chris-2.1.1/run/Supercritical/SCWR/fluid/createFluidFields.H:162 #13 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6" #14 in "/home/chris/OpenFOAM/chris-2.1.1/platforms/linuxGccDPOpt/bin/chtMultiRegionSimplegFoam" Aborted (core dumped) This error goes away if I change my groovyBC from: inlet1 { type groovyBC; value $internalField; variables "R=0.0022;n=9.0;S=(2.0*pow(n,2))/((n+1.0)*(2.0*n+1));rsq=pow(pos().x,2.0)+pow(pos() .y,2.0);Gmax=1200.0/S;power=1/n;ratio=sqrt(rsq)/R;scale=1-ratio;Gf=Gmax*pow(scale,power);"; valueExpression "vector(0,0,Gf)"; } to : inlet1 { type groovyBC; value uniform (0 0 1200); variables "R=0.0022;n=9.0;S=(2.0*pow(n,2))/((n+1.0)*(2.0*n+1));rsq=pow(pos().x,2.0)+pow(pos() .y,2.0);Gmax=1200.0/S;power=1/n;ratio=sqrt(rsq)/R;scale=1-ratio;Gf=Gmax*pow(scale,power);"; valueExpression "vector(0,0,Gf)"; } what issue does the "value $internalField" entry have with funkySetField? Or do I need to do something additional to account for the nonuniform list? Thank you for your time. |
|
August 22, 2014, 14:11 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
It would also fail if type was fixedValue (try it). Everything with $ is basically textual replacement. It has no concept of the physics/numerics What you'd like to do is initialize the patch with the values of the cells next to the patch, right? (that won't work with $internalField as you get the values in the order in which they are found in the cells). The only way that I could think of is using funkySetBoundaryFields with an expression "internalField(rhoG)" before the solver (assuming rhoG is the name of your field)
__________________
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 |
||
August 22, 2014, 15:15 |
|
#3 |
New Member
Christopher Hughes
Join Date: Oct 2012
Posts: 27
Rep Power: 14 |
Thank you so much, especially for explaining the error so simply.
I am trying to set the values of the cells next to the patch as the patch. I'll work on setting up funkySetBoundaryField. |
|
August 22, 2014, 15:37 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
But don't hold your breath. The time from idea to implementation varies between an hour and a year
__________________
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 |
||
August 27, 2014, 10:05 |
|
#5 |
New Member
Christopher Hughes
Join Date: Oct 2012
Posts: 27
Rep Power: 14 |
This is the silliest question I've ever asked on this forum, but where do I place the funkySetBoundaryFieldsDict file? I'm running chtmultiregionsimpleFoam but the method I used for the funkySetFieldsDict file doesn't work.
Is it somehow integrated into the controlDicts file? Thank you for your time. |
|
August 27, 2014, 17:35 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
What I usually do is 1. Look at the "help": funkySetBoundaryFieldsDict -h 2. Run the utility. OpenFOAM error-messages are quite explicit about which files they are missing BTW: for your multi-region-case you'll have to use the -region-option. File will then be looked for in the proper sub-directory of system
__________________
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 |
||
September 9, 2014, 16:56 |
|
#7 |
New Member
Christopher Hughes
Join Date: Oct 2012
Posts: 27
Rep Power: 14 |
This has frustrated me to no end.
My Allrun file has the following funkySetBoundaryFields -region coolant funkySetFields -time 0 -region coolant My funkySetFieldsDict.coolant is located in the system/coolant folder. I have a funkySetBoundaryFieldsDict.coolant located in the same folder. I still get the ./Allrun: 9: ./Allrun: funkySetBoundaryFields: not found error when I run the program. Line 9 is the location of the funkySetBoundaryFields -region coolant code in the Allrun file. I have tried rewriting the Allrun line to funkySetBoundaryFields -time 0 -region coolant in case that was doing something, same error. I have changed the file name to funkySetBoundaryFieldsDict, same error. Finally I have changed the file name to funkySetBoundaryFields, same error. I type funkySetBoundaryFieldsDict -h and it says funkySetBoundaryFieldsDict: command not found Do I somehow have a version that does not include funkySetBoundaryFields? I have installed swak4Foam_2.x_release_0.2.1 |
|
September 9, 2014, 17:42 |
|
#8 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
It seems that funkySetBoundaryFields was not properly compiled (it is one of the old utilities. Older than the old version 0.2.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 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] groovyBC and funkySetFields married and got a kid named swak4Foam | gschaider | OpenFOAM Community Contributions | 169 | August 10, 2023 10:01 |
[swak4Foam] Defining constants for funkySetFields and groovyBC | anaiman | OpenFOAM Community Contributions | 14 | January 20, 2020 19:37 |
[foam-extend.org] 3.2 Installation in Debian 8.5 | jsm | OpenFOAM Installation | 2 | June 19, 2016 11:53 |
[swak4Foam] groovyBC for initial conditions? | hajott | OpenFOAM Community Contributions | 0 | July 30, 2015 10:32 |
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh | gschaider | OpenFOAM Community Contributions | 300 | October 29, 2014 19:00 |