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

Help with codedMixed boundary condition. Overloading the = operator

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2021, 15:44
Default Help with codedMixed boundary condition. Overloading the = operator
  #1
Member
 
Join Date: Feb 2020
Posts: 90
Rep Power: 6
Shibi is on a distinguished road
Hello to all,

I am writing a codedMixed boundary condition to emulate the behavior of a boundary implemented into OpenFOAM.

As an example let us consider the following:

Code:
rightWall
     {
        type            codedMixed;

        refValue       uniform (0 0 0);
        refGradient      uniform (0 0 0);
        valueFraction   uniform 1;

        name            velocityMixed;   

        code
        #{

               refValue() = some expression
               refGrad() = some expression
               valueFraction() = some expression
         #};
}
Afterwards the code in the boundary of OpenFOAM overloads the = operator as:



Code:
void Foam::boundaryFvPatchVectorField
::operator=
(
    const fvPatchField<vector>& pvf
)
{
    tmp<vectorField> n = patch().nf();
 
    fvPatchField<vector>::operator=
    (
        valueFraction()*(n()*(n() & pvf))
      + (1 - valueFraction())*pvf
    );
}
How can I input this into the codedMixed boundary condition? What is the value of pvf? Is it the value of the mixedBoundary? Is overleading the operator even possible?



Something like: [?]
Code:
(
                     valueFraction()*refValue()
                      +
                       (1.0 - valueFraction())*
                       (
                        this->patchInternalField()
                        + refGrad()/this->patch().deltaCoeffs()
                        )
                        );
Would really appreciate some help with this.

Best Regards

Last edited by Shibi; July 8, 2021 at 05:42.
Shibi is offline   Reply With Quote

Reply


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
Accessing multiple boundary patches from a custom boundary condition file ripudaman OpenFOAM Programming & Development 0 October 22, 2014 19:34
Radiation interface hinca CFX 15 January 26, 2014 18:11
CFX fails to calculate a diffuser pipe flow shenying0710 CFX 7 March 26, 2013 05:13


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