Zero gradient at certain faces

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Yvan Fournier
Posts: 4074
Joined: Mon Feb 20, 2012 3:25 pm

Re: Zero gradient at certain faces

Post by Yvan Fournier »

Hello,

Do you have a small test case you could post to analyze this crash ?

Regards,

Yvan
rodion
Posts: 98
Joined: Wed Jan 11, 2017 4:13 pm

Re: Zero gradient at certain faces

Post by rodion »

Hello, Yvan.

Please, find my case by the following link:
https://drive.google.com/open?id=0BzeG5 ... 1o1dWZkalE

I am not sure if it is small, but it is the smallest what I have.

Best regards,
Rodion
Yvan Fournier
Posts: 4074
Joined: Mon Feb 20, 2012 3:25 pm

Re: Zero gradient at certain faces

Post by Yvan Fournier »

Hello,

Yes, I can reproduce the bug both in v5.0 or trunk (in cs_convection_diffusion_vector.c, line 4367 due to vec_potential's bc_coeffs->hint and hext vectors at least being NULL).

You are probably the first person to try to use internal coupling for a vector, and the extension from scalars to vectors has not been tested yet, so the crash is not surprising. I'll check with colleagues who worked on internal coupling to see how we can fix this, and keep you updated.

Regards,

Yvan
rodion
Posts: 98
Joined: Wed Jan 11, 2017 4:13 pm

Re: Zero gradient at certain faces

Post by rodion »

Thank you, Yvan.

Look forward to speaking with you.

Best regards,
Rodion
Martin FERRAND
Posts: 47
Joined: Wed Mar 14, 2012 10:06 am

Re: Zero gradient at certain faces

Post by Martin FERRAND »

Dear Odion,

a call function was missing for the vector coupling. I added that to the trunk version. The computation is not crashing anymore but the solvers are not converging properly.

I look at it in the coming days.

Best Regards

Martin
rodion
Posts: 98
Joined: Wed Jan 11, 2017 4:13 pm

Re: Zero gradient at certain faces

Post by rodion »

Hello everyone,

Since Code_Saturne 5.1 is still not available for Windows I decided to develop my own coupling algorithm for enthalpy, electric potential and magnetic vector potential to sew solid part of the domain with fluid. (please find the description attached)

I separated the electrodes from the rest of the domain using automatically defined thin walls by cs_user_internal_coupling_add_volumes. Then using my algorithm I sewed electric potential with respect to electric conductivity, because in metal the conductivity is much higher. But I found significant discontinuity in electric current at the interface of metal and fluid (please take a look at the picture attached). Hence, I decided that my sewing algorithm is not good enough, so I tried to sew electric potential by

Code: Select all

void
cs_user_internal_coupling(void) {
  int f_id = cs_field_id_by_name("elec_pot_r");
  cs_internal_coupling_add_entity(f_id);  /* Field to be coupled */
}
At the same time I kept my algorithm for enthalpy and magnetic vector potential coupling.

But it just did not work, the electric potential field in the electrodes was not adequate to the electric field in the fluid.

Does someone know what is the problem here? What am I doing wrong?

Best regards,
Rodion
Attachments
Sewing of temperature and electric potential at the fluid-electrodes interface.pdf
(67.91 KiB) Downloaded 192 times
Electric current discontinuity.PNG
Last edited by rodion on Sun Jun 10, 2018 4:59 pm, edited 3 times in total.
Yvan Fournier
Posts: 4074
Joined: Mon Feb 20, 2012 3:25 pm

Re: Zero gradient at certain faces

Post by Yvan Fournier »

Hello,

Don't expect a Windows build of 5.1 soon: viewtopic.php?f=4&t=2034

For the values you obtain, I do not have enough details to guess of check. In any case, internal coupling results should be dependent on wall exchanges. I seem to remember your case is laminar, which at least avoids additional complexity.

Also, I am not 100% sure that the internal coupling as of version 5.0 or even 5.1 works well with multiple scalars (at some point it was not usable at all, and there have been succeeding improvements, but might still be limitations; the simplest way to check this would be with a simple (no-specific physics) test case with 2 scalars, coupling only the first, then both, then only the second, and comparing). There should be a few improvements to internal coupling in upcoming 5.2, but I still need to check that part.

Regards,

Yvan
Post Reply