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

ptot

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

Like Tree1Likes
  • 1 Post By immortality

Reply
 
LinkBack Thread Tools Display Modes
Old   August 17, 2012, 05:41
Default ptot
  #1
New Member
 
Join Date: Jul 2012
Posts: 3
Rep Power: 5
pepe87 is on a distinguished road
Hello,

i would like to calculate ptot with the help of function objects.
after that i would like to use the function patchmassflowaverage on ptot.
how can i calculate ptot so that the function massflowaverage knows the variable??

Greetz
pepe87 is offline   Reply With Quote

Old   August 17, 2012, 09:24
Default
  #2
New Member
 
Join Date: Jul 2012
Posts: 3
Rep Power: 5
pepe87 is on a distinguished road
i've found something similar in an earlier post here.
i added in my conrtoldict:

functions
(
compute_ptot
{
type expressionField;
outputControl timeStep;
outputInterval 1;
fieldName ptot;
expression "p + 0.5*magSqr(U)";
autowrite false;
}

massFlow
{
type patchMassFlowAverage;
functionObjectLibs
( "libsimpleFunctionObjects.so");
verbose true;
readFields(ptot);
fields
(U
p
T
ptot
);
patches
(
Fluid_Inlet
Fluid_Outlet
);
factor 1.0;
}

);

but i get an error, that the function type expressionField is unknown.
pepe87 is offline   Reply With Quote

Old   June 20, 2013, 17:10
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
I hope you could resolve it.probably too late.but maybe help someone in future,
you can use Swak for mass averaging on total p:
Code:
n2_totalPressure
    {
        type swakExpression;
        valueType surface;
        verbose false;
        surfaceName normal_Plane_p0_2;
        surface {
            type plane;
            basePoint       (0.0345 0.002 0);
            normalVector    (1 0 0);
            interpolate true;
        }
       expression "sum((p+.5*rho*magSqr(U))*rho*area())/sum(rho*area())";
        accumulations (
            average
        ); 
        outputControlMode outputTime;//outputTime is added in 0.2.4 Swak4Foam version
        outputInterval 1;
    }
or OF function objects,like:
Code:
totalP    // user-defined name of function object entry
    {
        type            pressureTools;
        libs            ("libutilityFunctionObjects.so");
        //region          defaultRegion;
        enabled         yes;
        //timeStart       0;
        //timeEnd         10;
        outputControl timeStep;//outputTime;//
        outputInterval 1; // 5000;
        calcTotal   yes;
        calcCoeff   no;
        pRef 0;
    }
    readFields
    {
    type        readFields;
    functionObjectLibs ("libfieldFunctionObjects.so");
    fields
    (
        "total(p)"
    );
    }
and:
Code:
totalPressure_left
      {
        $Average_left;
        operation       weightedAverage;
        weightField     rho;
        
        fields
        (
          "total(p)"
        );
      }
that:
Code:
Average_left
    {
        type           faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled on;
        log             no;
        valueOutput     true;
        surfaceFormat   vtk;
        source          patch;
        sourceName      left;
        operation       areaAverage;
        fields
        (
            p
            //phi // surface fields not supported for sampledSurface
            T
            rho
            h
            U
        );
        outputControl timeStep;//outputTime;//
        outputInterval 1; // 5000;
      }
I've added from my case.hope be useful for someone.
namsivag likes this.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality 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
Ptot as default field Gearb0x OpenFOAM Running, Solving & CFD 1 January 26, 2011 22:36
Modifying rhoSimpleFoam to calculate ptot every iteration RalphS OpenFOAM 4 October 13, 2010 05:00
How to sample ptot at runtime pad OpenFOAM Post-Processing 0 August 26, 2010 07:45
Difference between ptot and volPointInterpolateptot debris OpenFOAM Paraview & paraFoam 0 May 24, 2006 11:27
Difference between Pabs & Ptot David CFX 5 December 3, 2002 22:42


All times are GMT -4. The time now is 06:22.