i have a molten metal bath with cilindrical shape and induction heating, from electromagnetic simulation i know the Lorentz forces field.
I would like to simulate the metal movement, is it possible to import the force field into the simulation?
This sounds like a quite difficult simulation, and if you need to account for moving boundaries, possible melting and solidification then FEATool is not really a suitable software.
That said, if you have measured data (such as your forces) you can create user defined coeffcient functions (Fx, Fy, Fz) where you would interpolate your data to the computational mesh used in the simulation. A 2D example is available in the documentation
This would be correct, however your coefficients might not be physically meaningful to generate flow via body forces (compared to other variables). The heat exchanger and natural convection tutorials show how to use the body/volume forces for a flow physics mode
You need to ensure that the output has the same expected array size as the input (in your case x and y). So here I guess you would need to use elementwise .dot notation, that is "x.^2" instead of "x^2" (which computes a matrix instead of vector).
So, my function must work with array and not with scalar, are x and y rows or column?
In general my problem is that i can't check x and y variables on workspace.
Is there a way to check FEATool variables on workspace?
Variables you call custom functions "res = myfun(x,y,T,...)" are evaluated in the quadrature points in grid cells and are ordered as a column vector (note that myfun can be called several times in each solver step with different size inputs depending on how the evaluation is split over a number of cells). The result "res" is assumed to have the same size as the input. If you want to check in your function, you can put a breakpoint
This seems to be a particular issue to using first order approximations (FEM Discretization) and pressure stabilization. Turning off Artificial Stabilization > Pressure Stabilization should resolve this issue, however can result in "checkerboard" pressure in the solutions. So better is probably to switch to a higher order P2P1 FEM Discretization (2nd order for velocities, 1st order for pressure, which does not need pressure stabilization).