CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

How to add a nonuniform jump to the jumpCyclic boundary condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 7, 2018, 07:55
Default How to add a nonuniform jump to the jumpCyclic boundary condition
  #1
KTG
Senior Member
 
Abe
Join Date: May 2016
Posts: 119
Rep Power: 10
KTG is on a distinguished road
Hey all,


I am trying to come up with a way to have jump cyclic boundary condition with a linear change in the jump. I have a box with periodic sides, and I want to impose linear changes in the jump pressure at the bounday on two of the sides so that the (average or approximate) pressure gradient in the domain is at some angle to faces.



First question: Is there no way to do this with #codestream? I can't seem to modify just the
Code:
jump uniform 1;

Second question: Can anyone explain to me how this is calculated? I ran a test case for a uniform jump, and can see that I am getting the desired result, but am not sure how it actually works in terms of the FVM.



Third question: Given that I will probably have to write a new boundary condition from scratch and don't really konw C++ very well at all, can someone tell me what line to modify in jumpCyclicFvPatchField.C? I think it is the first half of the if statement here:


Code:
template<class Type>
void Foam::jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
(
    Field<Type>& result,
    const bool add,
    const Field<Type>& psiInternal,
    const scalarField& coeffs,
    const Pstream::commsTypes
) const
{
    Field<Type> pnf(this->size());

    const labelUList& nbrFaceCells =
        this->cyclicPatch().neighbFvPatch().faceCells();

    // only apply jump to original field
    if (&psiInternal == &this->primitiveField())
    {
        Field<Type> jf(this->jump());

        if (!this->cyclicPatch().owner())
        {
            jf *= -1.0;
        }

        forAll(*this, facei)
        {
            pnf[facei] = psiInternal[nbrFaceCells[facei]] - jf[facei];
        }
    }
    else
    {
        forAll(*this, facei)
        {
            pnf[facei] = psiInternal[nbrFaceCells[facei]];
        }
    }

but I am not sure what psiInternal is? It would suffice for me to just be able to make a simple hard-coded calculation based on the coordinates of facei (baby steps)....


Thanks
KTG 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
Velocity jump boundary condition ASofia OpenFOAM Programming & Development 0 July 14, 2016 10:01
[PyFoam] and paraview eelcovv OpenFOAM Community Contributions 28 May 30, 2016 10:23
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
Porous jump boundary condition GregorAlan OpenFOAM Running, Solving & CFD 0 March 4, 2016 06:31
How can I implement temperature jump boundary condition in microchannel walls? sima FLUENT 1 December 8, 2010 09:20


All times are GMT -4. The time now is 20:31.