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

evaluate surface of the patchField

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 10, 2010, 05:06
Default evaluate surface of the patchField
  #1
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: France, Toulouse
Posts: 210
Rep Power: 8
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, 05:25
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 10
MartinB is on a distinguished road
Hi Cyp,

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

Old   December 10, 2010, 05:29
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: France, Toulouse
Posts: 210
Rep Power: 8
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, 05:49
Default
  #4
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 10
MartinB is on a distinguished road
May be
Code:
mesh.magSf().boundaryField()[patchID];
?

Can you post some more code?

Martin
MartinB is offline   Reply With Quote

Old   December 10, 2010, 07:14
Default
  #5
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: France, Toulouse
Posts: 210
Rep Power: 8
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, 07:36
Default
  #6
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 10
MartinB is on a distinguished road
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, 09:46
Default
  #7
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: France, Toulouse
Posts: 210
Rep Power: 8
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
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
boundaries with gmshToFoam‏ ouafa Open Source Meshers: Gmsh, Netgen, CGNS, ... 7 May 21, 2010 12:43
Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 June 29, 2009 00:48
Problem with Gmsh nishant_hull Open Source Meshers: Gmsh, Netgen, CGNS, ... 17 December 7, 2007 01:33
A stupid question luckyluke OpenFOAM Running, Solving & CFD 14 August 13, 2007 04:25
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


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