Zero gradient at certain faces

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
rodion
Posts: 98
Joined: Wed Jan 11, 2017 4:13 pm

Zero gradient at certain faces

Post by rodion »

Hello everyone!

I'm using Code_Saturne 4.2 on Windows 7 for electric arc simulation with involved electrodes. I want to impose zero gradient for enthalpy between electrodes and fluid to thermally isolate them and to calculate thermal flux between metal and fluid by myself.
Does anybody know how I can implement this idea?
Or maybe somebody knows how to impose specific heat at certain interior faces?

Thanks in advance.
Best regards,
Rodion
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Zero gradient at certain faces

Post by Yvan Fournier »

Hello,

A diagram or sketch could help me understand this better.

Best regards,

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

Re: Zero gradient at certain faces

Post by rodion »

Thank you for your answer, Yvan.

Please find the scheme of the mesh near the cathode below. Grey cells are Tungsten, white cells are Argon. I need to isolate thermally one from another and calculate my custom thermal flux through the interface.

These two media have different Enthalpy(temperature) dependencies, that's why thermal flux between Tungsten and Argon has to be calculated through temperature. But Code_Saturne calculates thermal flux through Enthalpy, hense I have continuity of Enthalpy, which is not correct. There should be continuity of Temperature.

Best regards,
Rodion
Attachments
Cathode tip.png
Geometry not to scale.png
u5zvojvbYw0.jpg
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Zero gradient at certain faces

Post by Yvan Fournier »

Hello,

I assume the tungsten cathode is a solid, and Argon the fluid domain.

How do you model the solid ? Do you use Syrthes coupling ? In Code_Saturne version 5.0, you could try to use the internal coupling option, though it has not been tested using Enthalpy is is not very mature (still in development). Still, it would seem the best option, if you are ready to test development features.

For this, the Windows build is not ideal, though running on Windows, you could use Cygwin or the Ubuntu for Windows subsets to install a development version (or 5.0 with possible patches) if following detailed (but not so complex) installation instructions/recommendations is OK for you.

Best regards,

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

Re: Zero gradient at certain faces

Post by rodion »

Thank you for your answer, Yvan.

I recalculate and impose Tungsten and Copper properties like T(H), Cp(T), Sigma(T), Lambda(T), density in cs_user_physical_properties.f90. I don't use Syrthes.

Sorry, I don't really understand, how the subroutine cs_user_fluid_structure_interaction.f90 is related to thermal isolation of neighboring cells.

Could you please explain, is it possible to impose zero gradient for enthalpy between neighboring cells to thermally isolate them and then calculate thermal flux between these cells manually?
Or maybe I can impose thermal isolation of the cells group in some different way?

Thanks in advance.
Best regards,
Rodion
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Zero gradient at certain faces

Post by Yvan Fournier »

Hello,

cs_user_fluid_structure_interaction.f90 is for "displacment" type coupling, so not what you need. I was mentioning another internal coupling in Code_Saturne 5.0.

It is still not clear to me how you model the electrodes. The Tungsten one seems to be part of the mesh, but if it is not fluid, how do you manage it ? That is where a coupling with Syrthes (not available on Windows unless you recompile both codes) or an internal coupling may help, as it allows for regions with just diffusion and no convection.

Otherwise, there is no easy way of imposing a gradient inside the domain (such as is possible using boundary conditions). This would require modifying the code so as to add a user section after each gradient call (not too difficult, but untested, and I'm not sure about possible effects on model/equation consistency).

The internal coupling from v5.0 allows for thermal wall laws, so even if its postprocessing aspects are not mature yet, it would seem the best option here.

Otherwise, you would need to insert a boundary between the fluid and electrodes, and then manage a coupling on that boundary to handle heat exchange. Some low-level functions I coud point you to may help.

Best regards,

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

Re: Zero gradient at certain faces

Post by rodion »

Thank you for your answer Yvan.

For electrodes I impose momentum source like this:
crvimp(1, 1, iel) = -1.0d30
crvimp(2, 2, iel) = -1.0d30
crvimp(3, 3, iel) = -1.0d30
crvexp(1, iel) = 0.0
crvexp(2, iel) = 0.0
crvexp(3, iel) = 0.0
which results in very low velocity (1e-10 ÷ 1e-5 m/s) in the cells dedicated to the electrodes.
Also I impose density, temperature(enthalpy), Cp(temperature), Sigma(temperature), Lambda(temperature) corresponding to the calculated electrode enthalpy.
Do you think it is inappropriate approach?
Another technique was mentioned in the thesis written by Laurent Chemartin: imposed custom specific heat at the interface faces between metal and fluid.
What do you think about it?

In User Guide I have found only "Fluid - Structure internal coupling" which is relaterd to the subroutine cs_user_fluid_structure_interaction.
In SRC directory I have found only this:
void cs_user_internal_coupling(void)
{
/* Example: Internal coupling */
/*! [param_internal_coupling] */
int f_id = cs_field_id_by_name("scalar1");
cs_internal_coupling_add_entity(f_id); /* Field to be coupled */
/*! [param_internal_coupling] */
}

Could you please give me more detailed description of what you mean by "internal coupling"?
And where can I find its description?


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

Re: Zero gradient at certain faces

Post by Yvan Fournier »

Hello,

For version 4.2, I guess you do not have that much better options. The "internal coupling" I speak of, available in version 5.0, allows you to really cut convection in part of the domain, which should be similar but more precise. Also, it allows for wall boundary conditions on the fluid side, which seem a better option for thermal exchange (assuming the wall l was are good enough), at least in turbulent and non wall-resolved cases (having a wall-resolved mesh being the safer option).
Documentation is limited to a few examples in src/user_examples/cs_user_parameters-base.c (the functions whose names include "internal_coupling"). I ould also find an example setup (ie. verification test case).

The custom specific heat option also seems interesting, assuming you can define a "reverse" computation to assign a specific heat which will lead to the correct heat exchange. It is probably also easier on the code numerics (thus convergence), though I am not to sure of the precision (due to interpolation aspects) with strong local variations in specific heat.

Best regards,

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

Re: Zero gradient at certain faces

Post by rodion »

Thank you for your answer, Yvan.

Okay, I will try to implement my case with CS 5.0 on virtual machine with Linux. I hope on Linux electric arc simulation doesn't give errors like

Code: Select all

use entsor
    1
Error: 'cs_user_boundary_conditions' of module 'entsor', imported at (1), is also the name of the current program unit
As far as I see, I can separate electrodes cells with cs_user_internal_coupling_add_volumes indicating the cells group name and then couple electric potential with cs_user_internal_coupling. Right?
Also I found the function cs_user_internal_coupling_from_disjoint_meshes. Could you please explain, what for can I use this function and what is the difference between this function and cs_user_internal_coupling_add_volumes?

Do you know how I can impose custom specific heat at the interior faces?


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

Re: Zero gradient at certain faces

Post by Yvan Fournier »

Hello,

I am not sure about the error you have on "entsor". Does that happen with version 4.2 ? in which file ?

The difference between "cs_user_internal_coupling_from_disjoint_meshes" and "cs_user_internal_coupling_add_volumes" is that the first variant requires concatenating a fluid and solid mesh, with conforming boundary faces at the interface, while the second variant starts from a joined mesh with fluid and solid volume sections, and inserts a boundary at the interface of the selected (solid) and non-selected parts (ensuring that boundaries are conforming, and possibly allowing a simpler selection). All other operations are identical.

You cannot impose custom specific heat at interior faces, but only on cells (so you can select cells adjacent to your interior face selection).

Regards,

Yvan
Post Reply