CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
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

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


I am studying the inletOutlet boundary condition.


In the update coeffs there is:


Code:
template<class Type>
void Foam::inletOutletFvPatchField<Type>::updateCoeffs()
{
    if (this->updated())
    {
        return;
    }

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

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

    mixedFvPatchField<Type>::updateCoeffs();
}
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:
Code:
template<class Type>
void Foam::inletOutletFvPatchField<Type>::operator=
(
    const fvPatchField<Type>& ptf
)
{
    fvPatchField<Type>::operator=
    (
        this->valueFraction()*this->refValue()
        + (1 - this->valueFraction())*ptf
    );
}
Why is this needed?

Last edited by newGuyAtCFD; September 28, 2022 at 05:18.
newGuyAtCFD 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
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 22:00.