Search found 30 matches

by Mohammad
Mon Oct 28, 2019 5:56 pm
Forum: Code_Saturne usage
Topic: How to get the mesh elements on a specific boundary or plane?
Replies: 3
Views: 104

How to get the mesh elements on a specific boundary or plane?

Hello, I want to do a calculation only on a specific boundary (using a loop). How can I set the loop that it only does the calculation for example on right boundary? For example the following loop works on all mesh elements: for (cs_lnum_t i = 0; i < n_cells_ext; i++) { ... } I want it to only work ...
by Mohammad
Sun Oct 27, 2019 2:54 pm
Forum: Code_Saturne usage
Topic: How to define a new vector field and its values?
Replies: 6
Views: 185

Re: How to define a new vector field and its values?

Sorry,
My version is 5.0.9.
by Mohammad
Sat Oct 26, 2019 8:28 am
Forum: Code_Saturne usage
Topic: How to define a new vector field and its values?
Replies: 6
Views: 185

Re: How to define a new vector field and its values?

Thanks a lot.
When I use this code:

Code: Select all

cs_parameters_add_variable("vector_name", 3);
The compiler ends with the following error:
Only user variables of dimension 1 are currently handled,
but vector_name is defined with dimension 3.
Where's the problem?

I appreciate your helps.
by Mohammad
Fri Oct 25, 2019 8:00 am
Forum: Code_Saturne usage
Topic: How to define a new vector field and its values?
Replies: 6
Views: 185

How to define a new vector field and its values?

Hi,
I want to create a new vector field like velocity field.
How can I do that? in which file? Is there an example?
Also, I want to know that if I define a field in a C file, can I call and use that field values in a Fortran file?
Thank you
by Mohammad
Fri Oct 18, 2019 11:07 pm
Forum: Code_Saturne usage
Topic: How can I get the derivatives of velocity field?
Replies: 10
Views: 501

Re: How can I get the derivatives of velocity field?

Hello, Thanks for your helps, I'm using Ubuntu 18.04. It seems that the problem solved by using cs_field_gradient_scalar instead of cs_field_gradient_vector ! But I have a new problem: When the calculation ends, the CS says: **************************** Saving calculation results *******************...
by Mohammad
Fri Oct 18, 2019 5:09 pm
Forum: Code_Saturne usage
Topic: How can I get the derivatives of velocity field?
Replies: 10
Views: 501

Re: How can I get the derivatives of velocity field?

Thank you! I used those codes to sum the three components of gradient of velocity field at each point. So I wrote the following C code in cs_user_postprocess.c file. But it does not give me any output at all! My CS version is 5.0.9. void cs_user_postprocess_values(const char *mesh_name, int mesh_id,...
by Mohammad
Wed Oct 16, 2019 5:20 am
Forum: Code_Saturne usage
Topic: Export the data calculated by extra operations
Replies: 5
Views: 199

Re: Export the data calculated by extra operations

Thank you.
If I want to use cs_user_postprocess.c and write the code in C language, can I use and call the variables which I defined in Fortran files like cs_user_modules.f90 and cs_user_initilization.f90 or I have to use the C file type of them?
by Mohammad
Tue Oct 15, 2019 2:16 pm
Forum: Code_Saturne usage
Topic: Export the data calculated by extra operations
Replies: 5
Views: 199

Re: Export the data calculated by extra operations

So, I should convert my fortran code to C language?
by Mohammad
Tue Oct 15, 2019 1:04 pm
Forum: Code_Saturne usage
Topic: Export the data calculated by extra operations
Replies: 5
Views: 199

Export the data calculated by extra operations

Hi, I wrote some codes in cs_user_extra_operations.f90 file which calculates strain rate tensor and also shear stress tensor at each point and each time step. Now, I want to export this data in the template and format of the exported data files in RESU/... folder (for example: results.velocity.0001 ...