Pressure-driven flow for pipe

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Tsubasa
Posts: 175
Joined: Fri Nov 20, 2020 4:09 am

Pressure-driven flow for pipe

Post by Tsubasa »

Hello,

Now, I am trying pressure-driven flow for a pipe.
Pipe has L=2m, R=0.2m, so it is very simple case as following
Untitled.jpg
(16.12 KiB) Not downloaded yet
As a boundary condition, I want to impose pressure-value directly at inlet and outlet face because I already knew static pressure-value at inlet and outlet face.

What I am wondering comes here.
-Is it OK to give "Imposed P Outlet ", (which is given in GUI) to inlet and outlet face?
-Is "Imposed P Outlet " available to outlet face only? If so, what condition should I give to inlet face? "Free inlet/oulet" (which is given in GUI)? Although I read theory and user guide, I am not sure how to give proper "external head losses definition" (which is option for "Free inlet/oulet") for the known pressure-value.
-When impoeing "Imposed P Outlet", should I set static pressure-value, not total prressure and not gauge pressure?

Also, as far as understand, there is no tutorial for pressure-driven flow, right? If someone know, I hope you let me know.

I would be grateful if you could help me.

Sincerely,
Tsubasa
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Pressure-driven flow for pipe

Post by Yvan Fournier »

Hello,

You can only use a pressure outlet for n actual outlet, because if flow becomes incoming, the associated other variables are not defined.

For a free inlet/outlet, I am not sure, but I guess you can try 0 head loss.

As for the type of pressure, that is a good question. I think it is the total pressure, but it is safe to confirm this by checking on an actual case (there was a question/test case regarding multiple pressure outlets on this forum a few months agor, so you may search that).

There are example setups for pressure-driven flow (using a source term) for periodic pipe flows (including one posted every few years here), but not toturial that I know of.

Best regards,

Yvan
Tsubasa
Posts: 175
Joined: Fri Nov 20, 2020 4:09 am

Re: Pressure-driven flow for pipe

Post by Tsubasa »

Hello Yvan,

Thank you for your repy.
I'm grad to know that "imposed P outlet" is not available to both inlet and outlet condition.

At fisrt, I tried a simulation without head ross in "Free inlet/outle", and it worked. However, I'm not sure how I should set head loass in "Free inlet/outlet" equivalent to known inlet-pressure value 100050Pa. (100000Ps is set to outlet.)

As far as I understand, it is impossible to set purely "pressure-driven" flow in GUI, right?
Although I searched previous case of pressure-driven flowin in this forum, I cannot find it well. Could you let me know some keyword to serach it?

Best regards,
Tsubasa
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Pressure-driven flow for pipe

Post by Yvan Fournier »

Hello,

Yes, it is quite possible that you need user-defined functions for purely pressure-driven flow. Or at least the examples I remember required such functions. Though you can define almost everything with the GUI, and only override the minimum settings with user-defined functions.

So It seems you could defined everything as if you have inlets (including values for transported scalars and turbulence in case the flow is incoming), and switch the boundary type ("itypfb") to "isolib", and prescribe the pressure using "icodcl(ifac,ipr, value)"

I don't have the time to check today, so if other people on this forum want to help you, they are welcome (as always).

Best regards,

Yvan
Tsubasa
Posts: 175
Joined: Fri Nov 20, 2020 4:09 am

Re: Pressure-driven flow for pipe

Post by Tsubasa »

Hello,

Now, I am studying how to use subroutine, but it is a little bit difficult for me.
Is it better to understand how to use Forttan and C before using subroutine?
(So far, I've never used these programing language.)
Is there some documents | can study detail and example of subroutine?

For example,

Code: Select all

call getfbr('2 and x < 0.01', nlelt, lstelt)
do ilelt = 1, nlelt
  ifac = lstelt(ilelt)
  iel = ifabor(ifac)
  itypfb(ifac) = ientre
  rcodcl(ifac,iu,1) = 1.1d0
  rcodcl(ifac,iv,1) = 1.1d0
  rcodcl(ifac,iw,1) = 1.1d0
  uref2 = rcodcl(ifac,iu,1)**2  &
        + rcodcl(ifac,iv,1)**2  &
        + rcodcl(ifac,iw,1)**2
  uref2 = max(uref2,1.d-12)
  .
  .
  .
  
  if (nscal.gt.0) then
    do ii = 1, nscal
      rcodcl(ifac,isca(ii),1) = 1.d0
    enddo
  endif
enddo
I' m not sure what "call getfbr('2 and x < 0.01', nlelt, lstelt)" means.
Probably, "2" is just a coler number, but what is "x < 0.01"? I read the user's guide, but I am not sure.
Where should I study those knowledge?
Luciano Garelli
Posts: 282
Joined: Fri Dec 04, 2015 1:42 pm

Re: Pressure-driven flow for pipe

Post by Luciano Garelli »

Hello,

The line "call getfbr('2 and x < 0.01', nlelt, lstelt)" is used for the selection of boundary faces satisfying a specific criteria. The criteria is that belongs to a group of face number/color "2" and the coordinates of the face centers x-coordinate "x<0.01". In nlelt you will have the number of faces selected and lstelt is the list of faces.

You can check section 3.10 of the CS 6.0 user guide for face and cell selection.

Regards,
Luciano
Ruonan
Posts: 136
Joined: Mon Dec 14, 2020 11:38 am

Re: Pressure-driven flow for pipe

Post by Ruonan »

Hello everyone,

Please could you tell me what does the sentence "iel=ifabor(ifac)" in the codes mean? I searched in the user guide with no results.

Thank you very much! :)

Best regards,
Ruonan
Tsubasa wrote: Wed Dec 23, 2020 3:07 am Hello,

Now, I am studying how to use subroutine, but it is a little bit difficult for me.
Is it better to understand how to use Forttan and C before using subroutine?
(So far, I've never used these programing language.)
Is there some documents | can study detail and example of subroutine?

For example,

Code: Select all

call getfbr('2 and x < 0.01', nlelt, lstelt)
do ilelt = 1, nlelt
  ifac = lstelt(ilelt)
  iel = ifabor(ifac)
  itypfb(ifac) = ientre
  rcodcl(ifac,iu,1) = 1.1d0
  rcodcl(ifac,iv,1) = 1.1d0
  rcodcl(ifac,iw,1) = 1.1d0
  uref2 = rcodcl(ifac,iu,1)**2  &
        + rcodcl(ifac,iv,1)**2  &
        + rcodcl(ifac,iw,1)**2
  uref2 = max(uref2,1.d-12)
  .
  .
  .
  
  if (nscal.gt.0) then
    do ii = 1, nscal
      rcodcl(ifac,isca(ii),1) = 1.d0
    enddo
  endif
enddo
I' m not sure what "call getfbr('2 and x < 0.01', nlelt, lstelt)" means.
Probably, "2" is just a coler number, but what is "x < 0.01"? I read the user's guide, but I am not sure.
Where should I study those knowledge?
Luciano Garelli
Posts: 282
Joined: Fri Dec 04, 2015 1:42 pm

Re: Pressure-driven flow for pipe

Post by Luciano Garelli »

Hello,

Another reference is the Doxygen web page https://www.code-saturne.org/cms/documentation/v60.

Here is the definition of ifabor().

https://www.code-saturne.org/cms/sites/ ... 502615956f

Regards,
Luciano
Post Reply