how can i do to define the coordinates in code?

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Yvonne
Posts: 23
Joined: Sat Oct 02, 2021 7:53 am

how can i do to define the coordinates in code?

Post by Yvonne »

hello

thank you for your help early~ recently I study the tidal flows. I want to simulate twice cycle period. it means I should change the inlet boundary condition to the outlet boundary condition. in the before post, I have asked the step what I can do. i use the restart to get the velocity of the last timestep as the restart case's initialization. when i use the restart, i change the BC in the GUI : inlet=> outlet . and then i use my code cs_boundary conditions.f90 to get the velocity.

for example, in the first case 1, I set the inlet(criteria INLET) and outlet (criteria OUTLET). in GUI, i first set the normal direction and the norm=0, and then the velocity =0.5,0,0 is set by code [screenshot 2 and 22], and then I change the boundary conditions as the case 2. the inlet's criteria are the OUTLET( these criteria just the define during mesh generation, , and this change has done in GUI,norm=0, the direction is the normal ). in the code, I set the velocity = -1,0,0. [screenshot 3 and 33]

the same set I have only done in the GUI(screenshot 4 and 5) without using the bc.f90. when I check the result in ParaView(stream lines), I find that the directions in the restart stage are different. the direction is flowing right is the restart stage by GUI. but in my code set, the restart stage flow direction is turned left.

I check my code and GUI set, I find that I use the GUI to set the boundary conditions, when the inlet is changed to the outlet, (also use the 0.5, not use the negative), the direction is changed to the left. but the same setup I use in my code, I find that the direction is still right. so I guess this setup is set by the GUI and then when I use the bc.90 are covered. maybe the boundary conditions are not changed in my case 2?

so I think there is something incorrect in my code, or maybe I can define the coordinates in my code? I read the document, it mentions the itrifb, but I also don't know how to use it, or will have any other methods?

can you help me? i don't know if I say clearly :( , please forgive me~~

best wish,
Yvonne
Attachments
3.png
22.png
2.png
Yvonne
Posts: 23
Joined: Sat Oct 02, 2021 7:53 am

Re: how can i do to define the coordinates in code?

Post by Yvonne »

sorry
Because the up post seems isn't attached the rest screenshot. so I reply my post
it is so sorry for that
Attachments
5.png
4.png
33.png
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: how can i do to define the coordinates in code?

Post by Yvan Fournier »

Hello,

IT is not very clear to me, which case is wrong ? The second case (with inverted direction) using the user-defined functions ?

With only a few screenshots and not the full user subroutine, we may miss a part of the problem.

Regards,

Yvan
Yvonne
Posts: 23
Joined: Sat Oct 02, 2021 7:53 am

Re: how can i do to define the coordinates in code?

Post by Yvonne »

hello~

I am so sorry for my poor English. avoid I can't describe my question, I draw some pictures.
maybe it is will spend your some times, I am so sorry~

in picture 1, I described the set by code (some setup set in GUI), I have case1 and case2, the case 2 is run based on case1 (restart-checkpoint).

in picture 2, I draw the set only by GUI (not use the cs_boundary conditions.f90). I have case 3 and case 4 , the case 4 is run based on case 3.

compare picture 1 and picture 2, the set has the same? just set by different methods.

in picture3, I show the result of four cases. in my opinion, the result of case 2 should same as case4. but the direction of the stream lines isn't the same.

in order to check the reason, I set case 5 and case 6 in picture 4( compare to picture 2). case 5 is the same as case 1. and in case 6, the u=1 (in case 2 is -1). I find that I have to change the boundary conditions, but it does not change the direction
(turn left)...

I don't know I have described it clearly? can you help me?
thank you so much~~

best wish,
Yvonne
Attachments
3.jpg
2.jpg
1.jpg
Yvonne
Posts: 23
Joined: Sat Oct 02, 2021 7:53 am

Re: how can i do to define the coordinates in code?

Post by Yvonne »

here is the picture 4
Attachments
4.jpg
Yvonne
Posts: 23
Joined: Sat Oct 02, 2021 7:53 am

Re: how can i do to define the coordinates in code?

Post by Yvonne »

hello~~
is there anybody who can help me?? I am so confused. :( :( :(
I don't know what can I do know.
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: how can i do to define the coordinates in code?

Post by Yvan Fournier »

Hello,

If you do not follow the forum recommendations of posting more complete information (at least the run_solver.log, setup.log, and user subroutines), it is difficult to help you, as we may miss important details.

Regards,

Yvan
Post Reply