Hello,
What cells are used in the calculation process by the "cs_wall_functions.h" function?
I am assuming that it is applied on the cells adjacent to a wall boundary.
I am trying to implement a wall function that considers, in predicting the velocity distribution, the pressure gradient.
I calculated the pressure gradient in "cs_user_boundary_conditions.f90" subroutine for the cells adjacent to the wall boundary, and then I transfer the pressure gradient variable to the "cs_wall_functions.h" function.
To be sure that I pass correctly the data from the FORTRAN subroutine to "cs_wall_functions.h" function, I write the pressure gradient variable in 2 text files, from FORTRAN subroutine and from "cs_wall_functions.h" function.
When I compare the text files, I see that I have a smaller number of entries in the FORTRAN subroutine than the "cs_wall_functions.h" function.
Shouldn't I have the same number of entries in both text files?
For calculating the pressure gradient on the cell adjacent to the wall, I used the "getfbr" subroutine and then "ifabor" function.
Best regards,
Ionut
cs_wall_functions.h
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 4207
- Joined: Mon Feb 20, 2012 3:25 pm
Re: cs_wall_functions.h
Hello,
Sorry, without at least some parts of the code, I can't really guess.
Regards,
Yvan
Sorry, without at least some parts of the code, I can't really guess.
Regards,
Yvan
Re: cs_wall_functions.h
Hello,
I attached the files that I use in Code_Saturne, as an archive.
In "cs_user_boundary_conditions.f90", I calculate the pressure gradient.
In the file "cs_wall_functions.h", I modified the "cs_wall_functions_1scale_log", starting at line number 198.
Here I will use the variable for pressure gradient for further calculations.
I do not understand what I am missing that I do not have the same number of entries in the text files, saved from FORTRAN and C (result_fortran90.txt and result.txt).
Thank you for your help.
Best Regards,
Ionut
I attached the files that I use in Code_Saturne, as an archive.
In "cs_user_boundary_conditions.f90", I calculate the pressure gradient.
In the file "cs_wall_functions.h", I modified the "cs_wall_functions_1scale_log", starting at line number 198.
Here I will use the variable for pressure gradient for further calculations.
I do not understand what I am missing that I do not have the same number of entries in the text files, saved from FORTRAN and C (result_fortran90.txt and result.txt).
Thank you for your help.
Best Regards,
Ionut
- Attachments
-
- Pres.Gradient test.rar
- (16.5 KiB) Downloaded 383 times
-
- Posts: 4207
- Joined: Mon Feb 20, 2012 3:25 pm
Re: cs_wall_functions.h
Hello,
Are you running in parallel or serial ? If running in parallel, opening the same files and buffering issues could explain this.
Regards,
Yvan
Are you running in parallel or serial ? If running in parallel, opening the same files and buffering issues could explain this.
Regards,
Yvan
Re: cs_wall_functions.h
Hello,
I am running in parallel, 28 processes.
Is there a solution to overcome this issue?
Best Regards,
Ionut
I am running in parallel, 28 processes.
Is there a solution to overcome this issue?
Best Regards,
Ionut
-
- Posts: 4207
- Joined: Mon Feb 20, 2012 3:25 pm
Re: cs_wall_functions.h
Hello,
Yes, avoid opening and writing to the same file from multiple processors, or use MPI-IO.
Files are really not the simplest way to pass data, and are inefficient here. Why don't you use allocated arrays ? Possibly in a user module.
Regards,
Yvan
Yes, avoid opening and writing to the same file from multiple processors, or use MPI-IO.
Files are really not the simplest way to pass data, and are inefficient here. Why don't you use allocated arrays ? Possibly in a user module.
Regards,
Yvan
Re: cs_wall_functions.h
Hello,
Thank you Yvan, your recommendations helped me to solve the issue.
I have written to files for testing purposes, to be sure that the variable I pass from FORTRAN to C is correct.
I have a variable allocated to pass the data from FORTRAN to C.
Best Regards,
Ionut
Thank you Yvan, your recommendations helped me to solve the issue.
I have written to files for testing purposes, to be sure that the variable I pass from FORTRAN to C is correct.
I have a variable allocated to pass the data from FORTRAN to C.
Best Regards,
Ionut
Re: cs_wall_functions.h
Hello,
I think I have another issue transferring the data from "cs_user_boundary_conditions.f90" to "cs_wall_functions.h".
In "cs_user_boundary_conditions.f90" I compute the pressure gradient for all the cells adjacent to the wall boundary, then I used these values to calculate the friction velocity in the "cs_wall_functions.h".
The issue appears when I look at the data transferred from "cs_user_boundary_conditions.f90" to "cs_wall_functions.h".
The values are not the same.
I verified the values of the pressure gradient in both "cs_user_boundary_conditions.f90" and "cs_wall_functions.h", by writing text files from both "cs_user_boundary_conditions.f90"and "cs_wall_functions.h".
I attached the files here.
I run the simulation for 10 iterations.
At line 68485 the third iteration starts, and in both text files the values of the pressure gradient are written for 34242 cells.
In both text files at line 68485 the values are the same, but from line 68486 to 102726 the values from "cs_user_boundary_conditions.f90" are different than in "cs_wall_functions.h".
Why I do not have the same values in both files, written from "cs_user_boundary_conditions.f90" and "cs_wall_functions.h"?
Did I miss something?
The functions that I use in Code_Saturne are the the ones from the previous messages.
Best Regards,
Ionut
I think I have another issue transferring the data from "cs_user_boundary_conditions.f90" to "cs_wall_functions.h".
In "cs_user_boundary_conditions.f90" I compute the pressure gradient for all the cells adjacent to the wall boundary, then I used these values to calculate the friction velocity in the "cs_wall_functions.h".
The issue appears when I look at the data transferred from "cs_user_boundary_conditions.f90" to "cs_wall_functions.h".
The values are not the same.
I verified the values of the pressure gradient in both "cs_user_boundary_conditions.f90" and "cs_wall_functions.h", by writing text files from both "cs_user_boundary_conditions.f90"and "cs_wall_functions.h".
I attached the files here.
I run the simulation for 10 iterations.
At line 68485 the third iteration starts, and in both text files the values of the pressure gradient are written for 34242 cells.
In both text files at line 68485 the values are the same, but from line 68486 to 102726 the values from "cs_user_boundary_conditions.f90" are different than in "cs_wall_functions.h".
Why I do not have the same values in both files, written from "cs_user_boundary_conditions.f90" and "cs_wall_functions.h"?
Did I miss something?
The functions that I use in Code_Saturne are the the ones from the previous messages.
Best Regards,
Ionut
- Attachments
-
- result_cs_wall_functions.txt
- (5.68 MiB) Downloaded 412 times
-
- result_cs_user_boundary_conditions.txt
- (9.14 MiB) Downloaded 426 times