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

evaluate surface of the patchField

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 10, 2010, 06:06
Default evaluate surface of the patchField
  #1
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
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();
but it doesn't work.


Thank you very much for your help,
Cyp
Cyp is offline   Reply With Quote

Old   December 10, 2010, 06:25
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Cyp,

try:
Code:
p.boundaryField()[patchID].magSf();
Martin
MartinB is offline   Reply With Quote

Old   December 10, 2010, 06:29
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Hi Martin!

It doesn't work neither...

(in fact it was what I tried... my first post was a typo)
Cyp is offline   Reply With Quote

Old   December 10, 2010, 06:49
Default
  #4
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
May be
Code:
mesh.magSf().boundaryField()[patchID];
?

Can you post some more code?

Martin
MartinB is offline   Reply With Quote

Old   December 10, 2010, 08:14
Default
  #5
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
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];
Cyp is offline   Reply With Quote

Old   December 10, 2010, 08:36
Default
  #6
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
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];
        }
MartinB is offline   Reply With Quote

Old   December 10, 2010, 10:46
Default
  #7
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
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];
Cyp 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
[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


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