CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   groovyBC_2Way_Coupling_001 example (http://www.cfd-online.com/Forums/openfoam-solving/118083-groovybc_2way_coupling_001-example.html)

haze_1986 May 21, 2013 00:21

groovyBC_2Way_Coupling_001 example
 
Hi all, I am not sure if this example is made to work on OF 2.1.1 as I had issues with it. For a start, it can't seem to read the timeVaryingUniform BC and has to be changed to
inlet
{
type uniformFixedValue;
uniformValue tableFile;
tableFileCoeffs
{
fileName "pressureRamp";
outOfBounds clamp;
value $internalField;
}
}


Running it now produces the following error:
--> FOAM FATAL ERROR:
Parser Error at "1.21-27" :"field Q_int11 not existing or of wrong type"
"(Q_int12 + U_relax*(Q_int11 - Q_int12))/sum(mag(Sf()))*normal()"


From function parsingValue
in file lnInclude/CommonValueExpressionDriverI.H at line 802.

FOAM exiting



Then I tried removing the Q_int11 just as a trial.

Now the error becomes:

--> FOAM FATAL IO ERROR:
attempt to read beyond EOF

file: /home/caelinux/OpenFOAM/caelinux-2.1.0/run/tutorials/incompressible/simpleFoam/groovyBC_2Way_Coupling_001/system/fvSchemes::divSchemes::default at line 41.

From function ITstream::read(token&)
in file db/IOstreams/Tstreams/ITstream.C at line 83.

FOAM exiting

gschaider May 21, 2013 05:12

Quote:

Originally Posted by haze_1986 (Post 428782)
Hi all, I am not sure if this example is made to work on OF 2.1.1 as I had issues with it. For a start, it can't seem to read the timeVaryingUniform BC and has to be changed to
inlet
{
type uniformFixedValue;
uniformValue tableFile;
tableFileCoeffs
{
fileName "pressureRamp";
outOfBounds clamp;
value $internalField;
}
}


Running it now produces the following error:
--> FOAM FATAL ERROR:
Parser Error at "1.21-27" :"field Q_int11 not existing or of wrong type"
"(Q_int12 + U_relax*(Q_int11 - Q_int12))/sum(mag(Sf()))*normal()"


From function parsingValue
in file lnInclude/CommonValueExpressionDriverI.H at line 802.

FOAM exiting



Then I tried removing the Q_int11 just as a trial.

Now the error becomes:

--> FOAM FATAL IO ERROR:
attempt to read beyond EOF

file: /home/caelinux/OpenFOAM/caelinux-2.1.0/run/tutorials/incompressible/simpleFoam/groovyBC_2Way_Coupling_001/system/fvSchemes::divSchemes::default at line 41.

From function ITstream::read(token&)
in file db/IOstreams/Tstreams/ITstream.C at line 83.

FOAM exiting

Could you please start again? The boundary condition you're specifying (uniformFixedValue) has got nothing to with the error message you're posting (which is from swak/groovyBC) and the fix you're doing.

The problem in fvSchemes is certainly unrelated to the boundary condition thing. If I understand your initial sentence correctly this is a case that used to work with an old OF version but now doesn't work anymore (but it is not even clear to me whether you upgraded from or to 2.1.1): the error message you show is typical for instances where some more information is expected before the ';'. My suggestion: check fvSchemes in the tutorials relevant for your solver in the old OF-version (where it used to work) and in the new version and see what changed

haze_1986 May 21, 2013 05:18

Quote:

Originally Posted by gschaider (Post 428829)
Could you please start again? The boundary condition you're specifying (uniformFixedValue) has got nothing to with the error message you're posting (which is from swak/groovyBC) and the fix you're doing.

The problem in fvSchemes is certainly unrelated to the boundary condition thing. If I understand your initial sentence correctly this is a case that used to work with an old OF version but now doesn't work anymore (but it is not even clear to me whether you upgraded from or to 2.1.1): the error message you show is typical for instances where some more information is expected before the ';'. My suggestion: check fvSchemes in the tutorials relevant for your solver in the old OF-version (where it used to work) and in the new version and see what changed

Hi, would like to clarify, in the example the inlet type is timeVaryingUniform BC and I read somewhere that it is no longer in OF2.1.1 (I installed this version from scratch)

I also read that changing it to the BC above in blue will fix it. Seems that it fixes to run in 2.1.1 but there are more errors as shown above. Is it due to changing the BC or is it something inherent that I am missing out? Or is it version difference causing it?

Could you please recommend which version should I run it in? So I can try again. Thanks.

gschaider May 21, 2013 05:53

Quote:

Originally Posted by haze_1986 (Post 428836)
Hi, would like to clarify, in the example the inlet type is timeVaryingUniform BC and I read somewhere that it is no longer in OF2.1.1 (I installed this version from scratch)

I also read that changing it to the BC above in blue will fix it. Seems that it fixes to run in 2.1.1 but there are more errors as shown above. Is it due to changing the BC or is it something inherent that I am missing out? Or is it version difference causing it?

Could you please recommend which version should I run it in? So I can try again. Thanks.

Took me some googling to find out which case you're talking about: it's the one downloaded from http://openfoamwiki.net/index.php/Contrib_groovyBC, right? The problem is that this case is quite old and probably uses a syntax for coupling boundary conditions that is not supported anymore. See the swak-page. "Q_int11@interface11" is now written as "Q_int11{patch'interface11}". That's why it was not found in your initial post. Because it was evaluated on the same patch and assigned to a variable Q_int11@interface11

The problem with fvSchemes is almost certainly there because the case is rather old. Copy over a schemes-file from one of the current simpleFoam-tutorials and you should be fine (same for fvSolution: I'm sure you're going to see problems there too).

haze_1986 May 21, 2013 08:23

Quote:

Originally Posted by gschaider (Post 428844)
Took me some googling to find out which case you're talking about: it's the one downloaded from http://openfoamwiki.net/index.php/Contrib_groovyBC, right? The problem is that this case is quite old and probably uses a syntax for coupling boundary conditions that is not supported anymore. See the swak-page. "Q_int11@interface11" is now written as "Q_int11{patch'interface11}". That's why it was not found in your initial post. Because it was evaluated on the same patch and assigned to a variable Q_int11@interface11

The problem with fvSchemes is almost certainly there because the case is rather old. Copy over a schemes-file from one of the current simpleFoam-tutorials and you should be fine (same for fvSolution: I'm sure you're going to see problems there too).

Hi I have just did as you advised, still the exact same problem. Schemes files from pitzDaily example.

gschaider May 21, 2013 14:23

Quote:

Originally Posted by haze_1986 (Post 428883)
Hi I have just did as you advised, still the exact same problem. Schemes files from pitzDaily example.

It is not clear to me what you mean with "Exact same problem". The problem with the boundary conditions or fvScheme?

haze_1986 May 21, 2013 19:36

Quote:

Originally Posted by gschaider (Post 428972)
It is not clear to me what you mean with "Exact same problem". The problem with the boundary conditions or fvScheme?

Hi, both problems. It is exactly the same.

gschaider May 22, 2013 09:52

Quote:

Originally Posted by haze_1986 (Post 429035)
Hi, both problems. It is exactly the same.

Currently we can only guess what you changed about your files. So please post the pressure file that you adapted to the new syntax.

fvSolution is definitely not a problem of swak. Check that you really use an updated version

haze_1986 May 22, 2013 10:00

Hi, appreciate your help

P

dimensions [0 2 -2 0 0 0 0];

internalField uniform 1176.471;

boundaryField
{
fixedWalls
{
type zeroGradient;
}
inlet
{
type uniformFixedValue;
uniformValue tableFile;
tableFileCoeffs
{
fileName "pressureRamp";
outOfBounds clamp;
value $internalField;
}
}
outlet
{
type fixedValue;
value $internalField;
}
interface11
{
type groovyBC;
variables "p_int12@interface12=sum(p*mag(Sf()))/sum(mag(Sf()));p_int11=sum(p*mag(Sf()))/sum(mag(Sf()));p_relax=0.3;";
valueExpression "(p_int11 + p_relax*(p_int12 - p_int11))";
value $internalField;
}
interface12
{
type zeroGradient;
}
interface21
{
type groovyBC;
variables "p_int22@interface22=sum(p*mag(Sf()))/sum(mag(Sf()));p_int21=sum(p*mag(Sf()))/sum(mag(Sf()));p_relax=0.3;";
valueExpression "(p_int21 + p_relax*(p_int22 - p_int21))";
value $internalField;
}
interface22
{
type zeroGradient;
}
}



fvSolution

solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.01;
}

U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
}

k
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
}

epsilon
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
}

R
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
}

nuTilda
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
}
}

SIMPLE
{
nNonOrthogonalCorrectors 0;

residualControl
{
p 1e-2;
U 1e-3;
"(k|epsilon|omega)" 1e-3;
}
}

relaxationFactors
{
fields
{
p 0.3;
}
equations
{
U 0.7;
k 0.7;
epsilon 0.7;
R 0.7;
nuTilda 0.7;
}
}


fvSchemes


ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}

divSchemes
{
default none;
div(phi,U) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind;
div(R) Gauss linear;
div(phi,nuTilda) Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}

interpolationSchemes
{
default linear;
interpolate(U) linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p ;
}

gschaider May 22, 2013 10:23

Quote:

Originally Posted by haze_1986 (Post 429238)
interface21
{
type groovyBC;
variables "p_int22@interface22=sum(p*mag(Sf()))/sum(mag(Sf()));p_int21=sum(p*mag(Sf()))/sum(mag(Sf()));p_relax=0.3;";
valueExpression "(p_int21 + p_relax*(p_int22 - p_int21))";
value $internalField;
}

It is a bit hard to help you if you don't read my answers: I quote from my previous message

The problem is that this case is quite old and probably uses a syntax for coupling boundary conditions that is not supported anymore. See the swak-page. "Q_int11@interface11" is now written as "Q_int11{patch'interface11}". That's why it was not found in your initial post. Because it was evaluated on the same patch and assigned to a variable Q_int11@interface11

haze_1986 May 22, 2013 10:36

sorry about that, changed the U but forgot about the p, thanks for you help.


All times are GMT -4. The time now is 22:45.