How to create a pressure differential in a tube ?

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Fabien852

How to create a pressure differential in a tube ?

Post by Fabien852 »

Hello,

My problematic is as follows:

Take for example a tube,
I wish to apply a vacuum at the output, we will have so a pressure differential between the inlet and the outlet producing thus a flow.

With what I found on the internet, I could apply a flow in entry and one exit pressure but this is not what I search to do.

Do you know how to do that?

Best regards,

Fabien
Jacques Fontaine
Posts: 118
Joined: Mon Feb 20, 2012 2:07 pm

Re: How to create a pressure differential in a tube ?

Post by Jacques Fontaine »

Hello,
You can specify custom boundary conditions in usclim.f90 or cs_user_boundary_conditions.f90 (depending on version).

You can also add (in momentum eq.) a source term which can be added in ustsns.f90 or cs_user_source_terms.f90 and add periodicity in order to simulate infinite channel.

JF
Fabien852

Re: How to create a pressure differential in a tube ?

Post by Fabien852 »

Hello,

thank you for the answer.

I made what I read here :
https://code-saturne.info/products/code ... /754965936
but it doesn't work.

To summarise, I want for each boundary :
Inlet : 101325 Pa
Outlet : 90000 Pa

So, I put in usclim file, this code :
  • For the inlet:

Code: Select all

    ITYPFB(IFAC,IPHAS)=IENTRE

    ICODCL(IFAC,IPR(IPHAS))=1

    RCDOCL(IFAC,IPR(IPHAS),1)=101325

    ICODCL(IFAC,IU(IPHAS))=0

    ICODCL(IFAC,IV(IPHAS))=0

    ICODCL(IFAC,IW(IPHAS))=0
  • For the outlet:

Code: Select all

    ITYPFB(IFAC,IPHAS)=ISOLIB

    ICODCL(IFAC,IPR(IPHAS))=1 

    RCODCL(IFAC,IPR(IPHAS),1)=90000
And when i start the runcase, i have this error :

Code: Select all

COMPILE OR LINK ERROR
The error file say that come from to this code :

Code: Select all

RCDOCL(IFAC,IPR(IPHAS),1)=101325
I don't know why !

Could you help me ?

I attached the usclim.f90
My code saturne version is 2.0.2

Best regards,

Fabien
Attachments
usclim.txt
(30 KiB) Downloaded 402 times
Fabien852

Re: How to create a pressure differential in a tube ?

Post by Fabien852 »

Anyone ?
Jacques Fontaine
Posts: 118
Joined: Mon Feb 20, 2012 2:07 pm

Re: How to create a pressure differential in a tube ?

Post by Jacques Fontaine »

Hello,

RCDOCL(IFAC,IPR(IPHAS),1)=101325
rcodcl(...... ) = ...

Best regards,
JF
Fabien852

Re: How to create a pressure differential in a tube ?

Post by Fabien852 »

Hello,

Thank you very much, it works really well !!!

Fabien
fif

Re: How to create a pressure differential in a tube ?

Post by fif »

Hi,

I'm trying for 2 days to create a pressure differential setting the inlet and outlet pressure in the usclim script without a success (I wrote the same script for inlet and outlet than above). In facts, I set a velocity equal to 0. But a differential pressure should impose the velocity...
So I think my script is not good :

error file : SIGSEGV signal (forbidden memory area access) intercepted !

listing : All variables(mass flow, pressure, velocity) are equal to zero at every step...

Tank you a lot if anyone can help me to solve this problem :mrgreen:

Regards

fif
Jacques Fontaine
Posts: 118
Joined: Mon Feb 20, 2012 2:07 pm

Re: How to create a pressure differential in a tube ?

Post by Jacques Fontaine »

Hello,

Which version of Code_Saturne are you using?
It will be very difficult to help you without any listing/user sources/xml ! :mrgreen:

By the way, as I said previously, the easiest way to create a pressure differential is to impose a source term in the momentum equation (see the subroutine ustsns).

Regards,
JF
fif

Re: How to create a pressure differential in a tube ?

Post by fif »

Hello,

Thank you JF for you answer ! ;)
My code saturne version is 2.0.2 too.

The simulation is running actually only if I set a velocity which is not equal to zero for the inlet condition (in the "step by step" preprocessing of saturne).
The problem is that it seems that's the velocity which impose the pressure and I would like to do the contrary (indeed, the velocity stays the same during all the differents iterations whereas I don't manage to do the correlation between the pressure I set and the pressure visualized with postpro).

Here is attached my script :
usclim.f90
(36.32 KiB) Downloaded 409 times
and for the listing I have to search because it says to me : L’extension 07111211 n’est pas autorisée.

Otherwise, is it possible that you send me how impose this source term in ustsns? I confess being really bad with scripts...

Best Regards,
fif
fif

Re: How to create a pressure differential in a tube ?

Post by fif »

et voici le listing :
listing.doc
(2.55 MiB) Downloaded 438 times
et le .xml :
case2(xml).doc
(26.5 KiB) Downloaded 451 times
cordialement :)
Post Reply