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

Reading values of internal faces

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 9, 2009, 04:17
Default Reading values of internal faces
  #1
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 10
sega is on a distinguished road
Hello World.

I need to read the values on some internal faces.
I thought of interpolating the volume field to the surfaces with e.g.
surfaceScalarField s = fvc::interpolate(p)

After this step I want to read the center value of the surface field for a set of specific faces I declared in faceSet.

How can I access this information?

Thanks.
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   July 10, 2009, 02:17
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 774
Rep Power: 17
olesen will become famous soon enough
Check how large your surfaceScalarField is (ie, how many faces it has).
Access the ones you want.
olesen is offline   Reply With Quote

Old   July 10, 2009, 02:22
Default
  #3
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 10
sega is on a distinguished road
Quote:
Originally Posted by olesen View Post
Access the ones you want.
How can I do that?
I don't know the code!

Furthermore: how can I loop through I set of faces I selected with faceSet prior?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   July 10, 2009, 02:46
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 774
Rep Power: 17
olesen will become famous soon enough
Quote:
Originally Posted by sega View Post
How can I do that?
I don't know the code!

Furthermore: how can I loop through I set of faces I selected with faceSet prior?
A faceSet is essentially a labelHashSet, you thus have all the usual methods as per HashSet. There are plently of places in the code that use some form of HashSet.
The command "git grep HashSet" is a quick way to find them all.
olesen is offline   Reply With Quote

Old   July 19, 2009, 08:16
Default
  #5
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 10
sega is on a distinguished road
Hello World.

No that it comes to the implementation of this internal field reading stuff I'm experiencing strange errors with a very simple tryout.

This is the code:
Code:
    for (label i=startTime; i<endTime; i++)
    {

    runTime.setTime(Times[i], i);
        Info<< "Time = " << runTime.timeName() << endl;

    // Reading field  p
    volScalarField p
    (
        IOobject
        (
        "p",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ,
        IOobject::AUTO_WRITE
        ),
        mesh
    );

    //Create face values from field values
    surfaceScalarField ps = fvc::interpolate(p);
   
    Info<< "face value on face 61103"<< ps[61103]<< endl;
    }
which compiles smoothly. But when hitting the case this is the message:

Code:
Attempt to cast type patch to type lduInterface#0  Foam::error::printStack(Foam::Ostream&) in "/home/sega/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1  Foam::error::abort() in "/home/sega/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2  Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) in "/home/sega/OpenFOAM/sega-1.5/applications/bin/linux64GccDPOpt/listFaceSet"
#3  Foam::lduInterface const& Foam::refCast<Foam::lduInterface const, Foam::fvPatch const>(Foam::fvPatch const&) in "/home/sega/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfiniteVolume.so"
#4  Foam::cyclicFvPatchField<double>::cyclicFvPatchField(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/sega/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfiniteVolume.so"
#5  Foam::fvPatchField<double>::adddictionaryConstructorToTable<Foam::cyclicFvPatchField<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&,Foam::dictionary const&) in "/home/sega/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfiniteVolume.so"
#6  Foam::fvPatchField<double>::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/sega/OpenFOAM/sega-1.5/applications/bin/linux64GccDPOpt/listFaceSet"
#7  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricBoundaryField(Foam::fvBoundaryMesh const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/sega/OpenFOAM/sega-1.5/applications/bin/linux64GccDPOpt/listFaceSet"
#8  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readField(Foam::Istream&) in "/home/sega/OpenFOAM/sega-1.5/applications/bin/linux64GccDPOpt/listFaceSet"
#9  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/home/sega/OpenFOAM/sega-1.5/applications/bin/linux64GccDPOpt/listFaceSet"
#10  main in "/home/sega/OpenFOAM/sega-1.5/applications/bin/linux64GccDPOpt/listFaceSet"
#11  __libc_start_main in "/lib/libc.so.6"
#12  _start at /build/buildd/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116


    From function refCast<To>(From&)
    in file /home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude/typeInfo.H at line 106.

FOAM aborting
Which looks very strange to me, as there is something about cyclic patches, which are not involved in this case...

Any ideas?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   July 19, 2009, 10:24
Default
  #6
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 10
sega is on a distinguished road
Stupid. There were cyclics involved. Who put them there?
Must have been me...
Sorry.

So far it's working, but I bet I'm coming back ...
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem converting fluent mesh vinz OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 20 November 17, 2012 10:54
Converting a mesh with splitted cells using fluentMeshToFoam jlpelerin OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 4 April 25, 2011 16:56
DecomposePar unequal number of shared faces maka OpenFOAM Pre-Processing 6 August 12, 2010 09:01
TGridFluent mesh with internal by prism layer and internal face for diagnostic sponiar OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 March 30, 2009 15:02
Unaligned accesses on IA64 andre OpenFOAM 5 June 23, 2008 10:37


All times are GMT -4. The time now is 12:34.