C user function for scaling parameters definition for electric model.
else
}
double econs = 1.5e5;
double coepot = 0.;
double coepoa = 1.;
double amex = 1.e30;
double aiex = -1.e30;
double emax = 0.;
double *w1;
for (
int iel = 0; iel <
ncel; iel++) {
w1[iel] = pow(xelec * xelec + yelec * yelec + zelec * zelec, 0.5);
}
bft_printf(
"min and max for E : %14.5E %15.4E\n", amex, aiex);
if (aiex > econs) {
double diff = 0.;
double xyzmax[3] = {-1.e10, -1.e10, -1.e10};
for (
int iel = 0; iel <
ncel; iel++) {
diff = aiex - w1[iel];
if (diff < 1.e-6) {
emax = w1[iel];
xyzmax[1] =
xyzcen[3 * iel + 1];
xyzmax[2] =
xyzcen[3 * iel + 2];
}
}
bft_printf(
"restrike point : %14.5E %14.5E %14.5E\n",
}
if (z1 < 0.)
z1 = 0.;
if (z2 > 2.e-2)
z2 = 2.e-2;
for (
int iel = 0; iel <
ncel; iel++) {
rayo /= denom;
rayo = pow(rayo, 0.5);
if (rayo < 5.e-4 && posi <= 0.)
}
}
}
else {
}
double somje = 0.;
for (
int iel = 0; iel <
ncel; iel++) {
}
if (fabs(somje) > 1.-20)
bft_printf(
"imposed current %14.5E, Dpot %14.5E, Somje %14.5E\n",
somje);
for (
int ifac = 0; ifac <
nfac; ifac++) {
if (fabs(
surfac[ifac][0]) < 1.e-8 && fabs(
surfac[ifac][1]) < 1.e-8 &&
int iel =
mesh->i_face_cells[ifac][0];
}
}
else
coepot = coepoa;
double dtj = 1.e15;
double dtjm = dtj;
double delhsh = 0.;
double cdtj = 20.;
for (
int iel = 0; iel <
ncel; iel++) {
if (fabs(
CS_F_(
rho)->val[iel]) > 1.e-20)
if (fabs(delhsh) > 1.e-20)
dtjm =
CS_F_(
h)->val[iel] / delhsh;
else
dtjm = dtj;
dtjm = fabs(dtjm);
}
double cpmx = pow(cdtj * dtj, 0.5);
coepot = cpmx;
if (coepoa > 1.05)
coepot = cpmx;
else
coepot = coepoa;
}
for (
int iel = 0; iel <
ncel; iel++)
for (int i = 0; i < 3 ; i++)
for (int iel = 0; iel < 3 ; iel++)
for (int iel = 0; iel < 3 ; iel++)
}
#define BFT_MALLOC(_ptr, _ni, _type)
Allocate memory for _ni elements of type _type.
Definition: bft_mem.h:62
#define BFT_FREE(_ptr)
Free allocated memory.
Definition: bft_mem.h:101
int bft_printf(const char *const format,...)
Replacement for printf() with modifiable behavior.
Definition: bft_printf.c:140
@ CS_DOUBLE
Definition: cs_defs.h:277
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define CS_MIN(a, b)
Definition: cs_defs.h:477
#define CS_MAX(a, b)
Definition: cs_defs.h:478
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:334
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
cs_elec_option_t * cs_get_glob_elec_option(void)
Definition: cs_elec_model.c:746
const cs_elec_option_t * cs_glob_elec_option
cs_field_t * cs_field_by_id(int id)
Return a pointer to a field based on its id.
Definition: cs_field.c:2320
int cs_field_get_key_int(const cs_field_t *f, int key_id)
Return a integer value for a given key associated with a field.
Definition: cs_field.c:3068
int cs_field_key_id(const char *name)
Return an id associated with a given key name.
Definition: cs_field.c:2574
@ curre
Definition: cs_field_pointer.h:165
@ joulp
Definition: cs_field_pointer.h:162
@ h
Definition: cs_field_pointer.h:91
@ rho
Definition: cs_field_pointer.h:97
@ potr
Definition: cs_field_pointer.h:158
@ dt
Definition: cs_field_pointer.h:65
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:51
#define CS_FI_(e, i)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:53
const cs_real_t cs_math_epzero
void cs_parall_max_loc_vals(int n, cs_real_t *max, cs_real_t max_loc_vals[])
Maximum value of a real and the value of related array on all default communicator processes.
Definition: cs_parall.c:764
static void cs_parall_max(int n, cs_datatype_t datatype, void *val)
Maximum values of a given datatype on all default communicator processes.
Definition: cs_parall.h:191
static void cs_parall_sum(int n, cs_datatype_t datatype, void *val)
Sum values of a given datatype on all default communicator processes.
Definition: cs_parall.h:154
static void cs_parall_min(int n, cs_datatype_t datatype, void *val)
Minimum values of a given datatype on all default communicator processes.
Definition: cs_parall.h:228
int cs_glob_physical_model_flag[CS_N_PHYSICAL_MODEL_TYPES]
Definition: cs_physical_model.c:108
@ CS_ELECTRIC_ARCS
Definition: cs_physical_model.h:64
const cs_time_step_t * cs_glob_time_step
integer ielarc
pointer to specify Electric arcs module (Joule effect and Laplace forces) with indicator ippmod(ielar...
Definition: ppincl.f90:191
real(c_double), pointer, save elcou
elcou : current
Definition: optcal.f90:975
double precision, dimension(:,:), pointer surfac
surface vector of the internal faces. Its norm is the surface of the face and it is oriented from ifa...
Definition: mesh.f90:75
double precision, dimension(:,:), pointer cdgfac
coordinates of the centers of the internal faces
Definition: mesh.f90:100
double precision, dimension(:), pointer volume
volume of each cell
Definition: mesh.f90:108
integer, save ncelet
number of extended (real + ghost of the 'halo') cells. See Note 1: ghost cells - (halos)
Definition: mesh.f90:48
integer, save nfac
number of internal faces (see Note 2: internal faces)
Definition: mesh.f90:56
double precision, dimension(:,:), pointer xyzcen
coordinate of the cell centers
Definition: mesh.f90:70
integer, save ncel
number of real cells in the mesh
Definition: mesh.f90:52
integer, save kivisl
variable diffusivity field id key for scalars
Definition: numvar.f90:190
option for electric model
Definition: cs_elec_model.h:98
cs_real_t pot_diff
Definition: cs_elec_model.h:110
int irestrike
Definition: cs_elec_model.h:102
cs_real_t restrike_point[3]
Definition: cs_elec_model.h:103
cs_real_t couimp
Definition: cs_elec_model.h:109
int ntdcla
Definition: cs_elec_model.h:101
Field descriptor.
Definition: cs_field.h:131
cs_real_t * val
Definition: cs_field.h:152
int nt_prev
Definition: cs_time_step.h:72
int nt_cur
Definition: cs_time_step.h:74