|
[Sponsors] |
July 9, 2009, 05:17 |
Reading values of internal faces
|
#1 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
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!" |
|
July 10, 2009, 03:17 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Check how large your surfaceScalarField is (ie, how many faces it has).
Access the ones you want. |
|
July 10, 2009, 03:22 |
|
#3 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
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!" |
|
July 10, 2009, 03:46 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
The command "git grep HashSet" is a quick way to find them all. |
||
July 19, 2009, 09:16 |
|
#5 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
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; } 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 Any ideas?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
|
July 19, 2009, 11:24 |
|
#6 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
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!" |
|
August 29, 2017, 22:09 |
|
#7 |
Member
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14 |
Hi all,
I am trying to access and modify a field value on a face using this code Code:
//Create face values from field values surfaceScalarField ps = fvc::interpolate(p); Code:
error: assignment of read-only location Thanks, Sugajen |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] Problem converting fluent mesh | vinz | OpenFOAM Meshing & Mesh Conversion | 28 | October 12, 2015 07:37 |
[Commercial meshers] Converting a mesh with splitted cells using fluentMeshToFoam | jlpelerin | OpenFOAM Meshing & Mesh Conversion | 4 | April 25, 2011 17:56 |
DecomposePar unequal number of shared faces | maka | OpenFOAM Pre-Processing | 6 | August 12, 2010 10:01 |
[Commercial meshers] TGridFluent mesh with internal by prism layer and internal face for diagnostic | sponiar | OpenFOAM Meshing & Mesh Conversion | 2 | March 30, 2009 16:02 |
Unaligned accesses on IA64 | andre | OpenFOAM | 5 | June 23, 2008 11:37 |