Error in scalar transport

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Tsubasa
Posts: 175
Joined: Fri Nov 20, 2020 4:09 am

Error in scalar transport

Post by Tsubasa »

Hello,

I am using Ver6 and running simulations in Ubunts18.
Here you can get some files for computation (run solver log and compile ...)
https://filesender.renater.fr/?s=downlo ... 1e150ac278

Now I run simulations for scalar transport.
The procedure of my simulation is
1. URANS for flow until 3000step with dt=0.1s and calculate an average flow field
2. WIth a user subroutine, I replace an instantaneous flow field at the last time step with the average flow field.
3. Activate option: "calculate on frozen velocity field"
4. Based on 3 and 4, run a simulation for scalar transport.


But now, there is some kind of strange behavior.
Would you check this animation with each 500steps?
https://filesender.renater.fr/?s=downlo ... 8b6bb2e369
As you can see, after a few moments, some areas have no scalar sources and no values.

I put many scalar sources in the domain. Now it is 40 sources.
When I re-run a simulation again with 3 sources, it worked very well.

Do you think this error comes from mesh or my mistakes in the setting?
In the past, I faced the same problem. At that time, the error happened because I impose the Dirichlet scalar value at an inlet, and also scalar sources in the domain. So error came from the inlet domain.

Best regards,
Hamada
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in scalar transport

Post by Yvan Fournier »

Hello,

You did not add subdirectories in your posted archives, so the user-defined functions (cs_user_parameters.c for example) are missing from your archive. So it is difficult for me to check this. Can you add those ?

Best regards,

Yvan
Tsubasa
Posts: 175
Joined: Fri Nov 20, 2020 4:09 am

Re: Error in scalar transport

Post by Tsubasa »

Hello Yvan,

Sorry I just forgot to add them.
Here are user subroutines.
cs_user_initialization.c
(4.81 KiB) Downloaded 47 times
cs_user_parameters.c
(8.07 KiB) Downloaded 47 times
Or would you download this which includes more files?
all_files.zip
(375.06 KiB) Downloaded 52 times
In my case, at first flow simulation was done and next scalar simulation.
In flow simulation, I used just cs_user_parameters.c.
In scalar simulation, I used both cs_user_initialization.c and cs_user_parameters.c.

Best regards,
Hamada
Last edited by Tsubasa on Thu Sep 22, 2022 11:44 pm, edited 1 time in total.
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Error in scalar transport

Post by Yvan Fournier »

Hello,

I'm not sure it will make a difference, but in cs_user_initialization.c, I recommend synchronizing ghost cell values for the velocity. I'm not sure it is done automatically later in the case of a frozen carrier flow, so you may as well play it safe.

Otherwise, I see no obvious error. I'm not sure why things would work with fewer sources and not more sources.
It might be interesting to activate the "scalar balance by zone" postprocessing option for some (or all) of your sources to get more info in the logs (it you do it for all sources, it will make the computation more costly, but can help in debugging).

Regards,

Yvan
Tsubasa
Posts: 175
Joined: Fri Nov 20, 2020 4:09 am

Re: Error in scalar transport

Post by Tsubasa »

Hello Yvan,

OK I will run a new simulation with the postprocessing option you suggest.
Once it is done I will send it to you.

Best regards,
Hamada
Post Reply