CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

operator= in inletOutlet boundary condition

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

LinkBack Thread Tools Search this Thread Display Modes
Old   September 27, 2022, 14:14
Default operator= in inletOutlet boundary condition
New Member
Join Date: Sep 2022
Posts: 18
Rep Power: 3
newGuyAtCFD is on a distinguished road
Hello to all,

I am studying the inletOutlet boundary condition.

In the update coeffs there is:

template<class Type>
void Foam::inletOutletFvPatchField<Type>::updateCoeffs()
    if (this->updated())

    const Field<scalar>& phip =
        this->patch().template lookupPatchField<surfaceScalarField, scalar>

    this->valueFraction() = 1.0 - pos0(phip);

The assignment of the value fraction is given by the pos0 function which will return 1 if phi>=0 else it will be 0.

The mixed boundary condition is given by:
\phi_f = w\phi_{ref} + (1-w)(\phi_C + \Delta\nabla \phi_{ref})

This means that, when I have positive flux I will get fixedGradient and when I get negative flux I will get fixed value.

However, there is the existance of a operator= in the function which will be called e.g, in the PEqn.H when the velocity is reconstructed.

And it is defined as:
template<class Type>
void Foam::inletOutletFvPatchField<Type>::operator=
    const fvPatchField<Type>& ptf
        + (1 - this->valueFraction())*ptf
Why is this needed?

Last edited by newGuyAtCFD; September 28, 2022 at 05:18.
newGuyAtCFD is offline   Reply With Quote


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
Fatal overflow in linear solver. iamnotfajar CFX 9 October 28, 2020 05:47
Table bounds warnings at: END OF TIME STEP CFXer CFX 4 July 17, 2020 00:44
My radial inflow turbine Abo Anas CFX 27 May 11, 2018 02:44
inletOutlet boundary condition problem siddharameshwara OpenFOAM Running, Solving & CFD 2 February 16, 2011 12:01
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05

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