Page 3 of 3

Re: Zero gradient at certain faces

Posted: Mon Oct 02, 2017 12:17 pm
by Yvan Fournier
Hello,

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

Regards,

Yvan

Re: Zero gradient at certain faces

Posted: Tue Oct 03, 2017 1:50 pm
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

Re: Zero gradient at certain faces

Posted: Wed Oct 04, 2017 1:39 am
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

Re: Zero gradient at certain faces

Posted: Wed Oct 04, 2017 3:55 pm
by rodion
Thank you, Yvan.

Look forward to speaking with you.

Best regards,
Rodion

Re: Zero gradient at certain faces

Posted: Mon Oct 09, 2017 8:47 am
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

Re: Zero gradient at certain faces

Posted: Wed Mar 21, 2018 2:36 pm
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

Re: Zero gradient at certain faces

Posted: Thu Mar 22, 2018 5:42 pm
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