|
[Sponsors] |
December 10, 2010, 06:06 |
evaluate surface of the patchField
|
#1 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
hello!
I am facing a new problem : I do not know how to evaluate the surface of a patchField labeled patchID. I was thinking about Code:
p.boundaryField[patchID].magSf(); Thank you very much for your help, Cyp |
|
December 10, 2010, 06:25 |
|
#2 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
Hi Cyp,
try: Code:
p.boundaryField()[patchID].magSf(); |
|
December 10, 2010, 06:29 |
|
#3 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Hi Martin!
It doesn't work neither... (in fact it was what I tried... my first post was a typo) |
|
December 10, 2010, 06:49 |
|
#4 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
May be
Code:
mesh.magSf().boundaryField()[patchID]; Can you post some more code? Martin |
|
December 10, 2010, 08:14 |
|
#5 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
It still doesn't work...
This is the piece of code I consider: Code:
surfaceScalarField phiKsa = fvc::interpolate(kSa); surfaceScalarField phiKsb = fvc::interpolate(kSb); surfaceScalarField phiP ( IOobject ( "phiP", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("zero", dimensionSet(1, -2, -2, 0, 0), 0.0) ); phiP = ((-fvc::interpolate(Ub+Ua)&mesh.Sf())+((rhoa*phiKsa+rhob*phiKsb)*g&mesh.Sf())) / (phiKsa + phiKsb)/mesh.magSf().boundaryField()[patchID]; |
|
December 10, 2010, 08:36 |
|
#6 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
Code:
phiP.boundaryField() = ((-fvc::interpolate(Ub+Ua)&mesh.Sf())+((rhoa*phiKsa+rhob*phiKsb)*g&mesh.Sf()))/(phiKsa + phiKsb)/mesh.magSf().boundaryField(); What's the error message? Is it one of the standard solvers of OpenFOAM, so I can check it? May be you can loop over the patches like here: Code:
volVectorField tau ( IOobject ( "tau", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedVector ( "tau", Reff.dimensions(), vector::zero ) ); forAll(tau.boundaryField(), patchi) { tau.boundaryField()[patchi] = ( -mesh.Sf().boundaryField()[patchi] /mesh.magSf().boundaryField()[patchi] ) & Reff.boundaryField()[patchi]; } |
|
December 10, 2010, 10:46 |
|
#7 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
thank you very much for your help. It works now!
Code:
scalarField fluxP = -(phi.boundaryField()[patchID]) /(kSa.boundaryField()[patchID]+kSb.boundaryField()[patchID]) /mesh.magSf().boundaryField()[patchID]; |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible | velan | OpenFOAM Meshing & Mesh Conversion | 3 | October 22, 2015 12:05 |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 03:09 |
[Gmsh] boundaries with gmshToFoam | ouafa | OpenFOAM Meshing & Mesh Conversion | 7 | May 21, 2010 13:43 |
A stupid question | luckyluke | OpenFOAM Running, Solving & CFD | 14 | August 13, 2007 05:25 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 13, 2001 00:19 |