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

Fail to identify symmetryFvPatchScalarField

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By cheng1988sjtu

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 8, 2014, 00:24
Default Fail to identify symmetryFvPatchScalarField
  #1
Member
 
Charlie
Join Date: Dec 2010
Location: USA
Posts: 85
Rep Power: 15
cheng1988sjtu is on a distinguished road
Hi Foamers,

I recently compiled OpenFOAM-2.1.0 with gcc version 4.8.2, I can compile OpenFOAM without error messages, except that I keep getting the warning:
Quote:
In file included from lnInclude/Field.H:360:0,
from lnInclude/labelField.H:39,
from lnInclude/primitiveFields.H:37,
from lnInclude/pointField.H:36,
from lnInclude/edge.H:40,
from lnInclude/edgeList.H:32,
from lnInclude/primitiveMesh.H:57,
from lnInclude/polyMesh.H:44,
from lnInclude/regIOobject.C:28,
from Make/linux64GccDPOpt/global.C:71:
lnInclude/Field.C: In member function 'void Foam::Field<Type>:perator=(const Foam::VectorSpace<Form, Cmpt, nCmpt>&)':
lnInclude/Field.C:680:42: warning: typedef 'VSType' locally defined but not used [-Wunused-local-typedefs]
typedef VectorSpace<Form,Cmpt,nCmpt> VSType;
^
I've never encountered this warning message when I compile OpenFOAM-2.1.0 with gcc-4.6.1, but this time I have to use gcc-4.8.2, because it's the only available version. Anyway, I compiled OpenFOAM-2.1.0 with gcc-4.8.2 by ignoring the warning message.

However, When I want to identify certain boundary type such as symmetryFvPatchScalarField, I try the following lines, which used to work on the OF2.1.0 compiled with gcc4.6.1:
Quote:
forAll(p.boundaryField(), patchi)
{
if (isA<symmetryFvPatchScalarField>(p.boundaryField()[patchi]))
{
Info<<"symmetry correct"<<endl;
phiDraga.boundaryField()[patchi] = 0.0;
phiDragb.boundaryField()[patchi] = 0.0;
}
}
This time, it doesn't do anything ( don't print out "symmetry correct") even if I define p boundary as "symmetryPlane", and in blockMesh I've defined corresponding "symmetryPlane" boundary.

Do you have any ideas about how to solve this problem without changing gcc version? Because I don't have the permission to compile my own gcc on that cluster.

Any hints will be highly appreciated, Thanks!
cheng1988sjtu is offline   Reply With Quote

Old   April 8, 2014, 02:13
Default
  #2
Member
 
Christian Butcher
Join Date: Jul 2013
Location: Japan
Posts: 85
Rep Power: 12
chrisb2244 is on a distinguished road
Does

Code:
forAll(p.boundaryField(), patchI)
{
    if (p.boundaryField().types()[patchI] == symmetryPolyPatch)
    {
        // Do stuff
    }
}
work?
chrisb2244 is offline   Reply With Quote

Old   April 8, 2014, 11:26
Default
  #3
Member
 
Charlie
Join Date: Dec 2010
Location: USA
Posts: 85
Rep Power: 15
cheng1988sjtu is on a distinguished road
Thanks, Christian, your method works, and you saved my life!!!

Code:
    forAll(p.boundaryField(), patchi)
    {
//        if (isA<symmetryFvPatchScalarField>(p.boundaryField()[patchi]))
        if (p.boundaryField().types()[patchi] == "symmetryPlane")
        {
//            Info<<p.boundaryField().types()[patchi]<<endl;
            phiDraga.boundaryField()[patchi] = 0.0;
            phiDragb.boundaryField()[patchi] = 0.0;
        }
    }
chrisb2244 likes this.
cheng1988sjtu is offline   Reply With Quote

Reply

Tags
gcc 4.8.2, symmetryfvpatch


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
Eclipse for OpenFOAM AMahrla OpenFOAM Programming & Development 109 October 8, 2017 16:20
How to identify the cells near the interface? legendyxg Fluent UDF and Scheme Programming 2 July 11, 2016 11:32
identify interface boundary nodes in parallel emdoran Fluent UDF and Scheme Programming 0 September 29, 2010 23:11
how to identify profile file source? Ralf Schmidt FLUENT 0 November 8, 2006 09:45
How to identify a correct value .?? kevin FLUENT 1 June 5, 2002 14:48


All times are GMT -4. The time now is 17:01.