CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

error when calculating values at boundary using refCast

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By tH3f0rC3

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 24, 2009, 07:05
Default error when calculating values at boundary using refCast
  #1
New Member
 
Praveen
Join Date: Mar 2009
Location: Goteborg, Sweden
Posts: 8
Rep Power: 17
prabhu is on a distinguished road
I am currently facing problems when calculating heat transfer values at boundary which is used for flux boundary condition.

I am fixing the heat transfer co-efficient in cells based on the value of temperature. When doing this the values are fixed in the cells but the values at the boundary are zero.
I made some changes as

label patchI = mesh.boundaryMesh().findPatchID("leftmovingwall");
zeroGradientFvPatchScalarField& bufferh = refCast<zeroGradientFvPatchScalarField>(hT.boundar yField()[patchI]);
forAll (bufferh, faceI)
{
if (T.boundaryField()[patchI][faceI] < Tmin_hT.value())
{
bufferh[faceI] = hT_Tmin.value();
}
else if (T.boundaryField()[patchI][faceI] >= Tmin_hT.value())
{
bufferh[faceI] = hT_Tmax.value();
}
}

The compilation of code did not produce any error but when i start the simulation i get the following error :

Attempt to cast type calculated to type zeroGradient#0 Foam::error:rintStack(Foam::Ostream&) in "/apps/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/apps/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 main in "/home/prabhu/OpenFOAM/prabhu-1.5/applications/bin/linux64GccDPOpt/lasersolid"
#3 __libc_start_main in "/lib64/libc.so.6"
#4 Foam::regIOobject::readIfModified() in "/home/prabhu/OpenFOAM/prabhu-1.5/applications/bin/linux64GccDPOpt/lasersolid"
From function refCast<To>(From&)
in file /apps/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/typeInfo.H at line 106.
FOAM aborting
Abort

Could any1 tell me how can this problem be solved?
prabhu is offline   Reply With Quote

Old   April 3, 2011, 21:23
Default
  #2
New Member
 
Gideon Balloch
Join Date: Apr 2011
Posts: 1
Rep Power: 0
gballo is on a distinguished road
Hi, I'm having a similar problem with chtMultiRegionFoam, where I get the following error:


--> FOAM FATAL ERROR:
Attempt to cast type calculated to type compressible::turbulentTemperatureCoupledBaffle

From function refCast<To>(From&)
in file /home/gballoch/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/typeInfo.H at line 114.

FOAM aborting


I know you posted here a long time ago but I was wondering if you resolved what the problem was? I think it is probably an inconsistency in BC's, but I've double checked all of them and they appear to be fine!
gballo is offline   Reply With Quote

Old   April 12, 2011, 09:22
Default
  #3
Senior Member
 
Join Date: Mar 2011
Posts: 158
Rep Power: 15
tH3f0rC3 is on a distinguished road
I do have the same problem.

But I still have solved one case with exactly the same settings with one exeption.
In the first case, which solved with the same settings, there was only one solid and one fluid.

Now the problem appears with two solids and one fluid.
As I said I have used exactly the same settings for the T files.

Does someone know how to solve this problem?

Best Regards,
tH3f0rC3
tH3f0rC3 is offline   Reply With Quote

Old   April 14, 2011, 02:32
Default
  #4
Senior Member
 
Join Date: Mar 2011
Posts: 158
Rep Power: 15
tH3f0rC3 is on a distinguished road
Hi,

I know now that the simulation works with the following setting:

Galvano
{
type compressible::turbulentTemperatureCoupledBaffleMix ed;
value $internalField;
neighbourFieldName T;
K K;
}
Geo2
{
type fixed value;
value uniform 573;
}


But I want to do it like this:
Galvano
{
type compressible::turbulentTemperatureCoupledBaffleMix ed;
value $internalField;
neighbourFieldName T;
K K;
}
Geo2
{
type compressible::turbulentTemperatureCoupledBaffleMix ed;
value $internalField;
neighbourFieldName T;
K K;
}

But than I recieve the following error message:
--> FOAM FATAL ERROR:
Attempt to cast type zeroGradient to type compressible::turbulentTemperatureCoupledBaffleMix ed
From function refCast<To>(From&)
in file /local/OpenFOAM/src/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/typeInfo.H at line 114.
FOAM aborting

Does someone know where the mistake is?

Best Regards,
tH3f0rC3

Last edited by tH3f0rC3; April 14, 2011 at 09:12.
tH3f0rC3 is offline   Reply With Quote

Old   April 15, 2011, 08:46
Default
  #5
Senior Member
 
Join Date: Mar 2011
Posts: 158
Rep Power: 15
tH3f0rC3 is on a distinguished road
I still have tried to set up the neighbourFieldName T; to another variable, but the solver needs the T here.
It's also the same with K K;.

I still think that I have to use different entries here, but I'm not sure.

Best Ragards,
tH3f0rC3
tH3f0rC3 is offline   Reply With Quote

Old   April 18, 2011, 03:49
Default
  #6
Senior Member
 
Join Date: Mar 2011
Posts: 158
Rep Power: 15
tH3f0rC3 is on a distinguished road
I have now solved the problem.

By using

value uniform 573.15;
//value $internalField;
in
*
{
type compressible::turbulentTemperatureCoupledBaffleMix ed;
value uniform 573.15;
//value $internalField;
neighbourFieldName T;
K K;
}

the solver is running.
It's very strange.

The solver runs good with only one solid and one fluid with the value $internalField.
But with two solids the solver only runs with value uniform 573,15.

Best Regards,
tH3f0rC3
vs1 likes this.
tH3f0rC3 is offline   Reply With Quote

Old   June 29, 2012, 03:48
Default Attempt to cast type zeroGradient to type compressible::turbulentTemperatureCoupledBa
  #7
New Member
 
yossi
Join Date: Nov 2010
Posts: 8
Rep Power: 15
yossi is on a distinguished road
Quote:
Originally Posted by tH3f0rC3 View Post

But than I recieve the following error message:
--> FOAM FATAL ERROR:
Attempt to cast type zeroGradient to type compressible::turbulentTemperatureCoupledBaffleMix ed
From function refCast<To>(From&)
in file /local/OpenFOAM/src/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/typeInfo.H at line 114.
FOAM aborting

Does someone know where the mistake is?

Best Regards,
tH3f0rC3
Hi,

I've had the same problem.
It seemed that the b.c at the fluid was fine,
but the b.c. at the solid was "zeroGradient"
yossi is offline   Reply With Quote

Old   March 12, 2018, 08:31
Default
  #8
Senior Member
 
Alejandro
Join Date: Jan 2014
Location: Argentina
Posts: 128
Rep Power: 12
ancolli is on a distinguished road
Quote:
Originally Posted by tH3f0rC3 View Post
I have now solved the problem.

By using

value uniform 573.15;
//value $internalField;
in
*
{
type compressible::turbulentTemperatureCoupledBaffleMix ed;
value uniform 573.15;
//value $internalField;
neighbourFieldName T;
K K;
}

the solver is running.
It's very strange.

The solver runs good with only one solid and one fluid with the value $internalField.
But with two solids the solver only runs with value uniform 573,15.

Best Regards,
tH3f0rC3
I am facing the same problem, all was ok with 2 solids and 1 fluid, but I have the error with 3 solid and 1 fluid. I can not run even by replacing $internalField with uniform xx. Do u know what is happening?

Solved, I forgot to run changeDictionary for the new solid...

Last edited by ancolli; March 12, 2018 at 09:32.
ancolli is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45
Errno 24 linux ivanwhlau OpenFOAM Running, Solving & CFD 6 July 1, 2009 10:16
calculating mass flow rate from exported velocity values Sasha FLUENT 0 April 6, 2009 16:07
How to initialise values for two inlet boundary comndition 21kalee OpenFOAM Running, Solving & CFD 0 December 26, 2007 04:40
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 17:27


All times are GMT -4. The time now is 20:25.