|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Jin Seok Lee
Join Date: Aug 2021
Posts: 52
Rep Power: 5 ![]() |
Dear experts
I am korean CFD user I am going to simulate about VAC(Ventilation Air Conditioning) using CFX program. I made mixture's material which was consist of N2, O2, Ar, CO2, H2O because I need to know mass fraction about CO2, H2O for result. Now, there is one domain for fluid zone and I need to set several initial condition because they are different according to coordinate. I want to divide 4 pats using CEL expression to set initial condition For example IF ( 0 [mm] < x < 2000[mm], 0 [mm] < z < 2000[mm], co2 mass fraction = 0.0018 IF ( 0 [mm] < x < 2000[mm], 0 [mm] < z < 2000[mm], H2O mass fraction = 0.0018 Could you give some ideas for me? Thank you for reading my question |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,173
Rep Power: 23 ![]() |
you could try:
if((abs(1[m]-x))<1[m],if((abs(1[m]-z))<1[m],0.0018,0),0) |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Jin Seok Lee
Join Date: Aug 2021
Posts: 52
Rep Power: 5 ![]() |
Thank you for replying my question
that's good to me But I am not sure that your advise is adequate. I need to set 4 initial condition 1. o[mm] < x < 2705[mm], 0[mm] < z < 3460[mm] --> H2O: 0.018, CO2:0.02, T: 30[C] 2. 2705[mm] < x < 6940[mm], 0[mm] < z < 3460 [mm] --> H2O:0.017, CO2:0.019, T: 29[C] 3. 0[mm] < x < 2580[mm], 3460[mm] < z < 6440 [mm] --> H2O:0.016, CO2:0.018, T: 28[C] 4. 2705 [mm] < x < 4340 [mm], 3460[mm] < z < 5962[mm] --> H2O:0.015, CO2:0.017, T:27[C] I think it is difficult to set 4 initial condition by using IF Is is possible to set initial conditions by using IF? Also I am not sure about considering coordinate X, Z only because fluid zone is 3d geometry But I only considered coordinate of X, Z is it make matter? Thank you for reading my question and I hope to answer Last edited by jins9158; August 18, 2021 at 01:04. |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,816
Rep Power: 144 ![]() ![]() ![]() ![]() |
Can't you just have 4 statement's like Erik's suggestion to cover your 4 zones? It does not look that hard.
Alternately, you can use 1D or 3D interpolation functions or write a user fortran routine to do it. You can also fit a curve to the function and put the fitting function in as a CEL expression. So you have lots of alternative ways of doing it. Yes, you can set initial conditions with if statements. I do not understand your comments about considering X and Z. I do not know what you are trying to model so I cannot say if that is appropriate.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
![]() |
![]() |
![]() |
![]() |
#5 | |
Member
Jin Seok Lee
Join Date: Aug 2021
Posts: 52
Rep Power: 5 ![]() |
Quote:
-------- I had mistake I need to set initial condition each about co2, h2o, T They need to change according to coordinates same as below. 1. o[mm] < x < 2705[mm], 0[mm] < z < 3460[mm] --> H2O: 0.018, CO2:0.02, T: 30[C] 2. 2705[mm] < x < 6940[mm], 0[mm] < z < 3460 [mm] --> H2O:0.017, CO2:0.019, T: 29[C] 3. 0[mm] < x < 2580[mm], 3460[mm] < z < 6440 [mm] --> H2O:0.016, CO2:0.018, T: 28[C] 4. 2705 [mm] < x < 4340 [mm], 3460[mm] < z < 5962[mm] --> H2O:0.015, CO2:0.017, T:27[C] And you gave me that "you couldn't understand about considering X and Z" So, I answer your opinion. My Fluid Zone is 3D model. So, I think that I need to consider x, y, z coordinates to set initial condition But, I just considered about X, Z coordinate. It is right? I am not sure I hope to give some ideas for me Thank you |
||
![]() |
![]() |
![]() |
![]() |
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,816
Rep Power: 144 ![]() ![]() ![]() ![]() |
If you are saying that your initial condition has 3D regions with difference mass fractions - then, yes, the if() statement approach can become a problem.
In that case a 3D interpolation function will work much better. Have a look at the 3D interpolation functions.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
![]() |
![]() |
![]() |
![]() |
#7 | |
Member
Jin Seok Lee
Join Date: Aug 2021
Posts: 52
Rep Power: 5 ![]() |
Quote:
Thank you. I will try using 3d interpolation function. |
||
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compressible flows with larger Courant numbers | Tobi | OpenFOAM Running, Solving & CFD | 5 | February 26, 2021 15:20 |
Maximum number of iterations exceeded chtmultiregionsimpleFoam | Moncef | OpenFOAM Running, Solving & CFD | 28 | July 13, 2020 14:26 |
decompose dependent solution | arionfard | OpenFOAM | 3 | December 10, 2018 09:36 |
Cannot run the code properly: very large time step continuity error | crst15 | OpenFOAM Running, Solving & CFD | 9 | December 14, 2014 18:17 |
Unstabil Simulation with chtMultiRegionFoam | mbay101 | OpenFOAM Running, Solving & CFD | 13 | December 28, 2013 13:12 |