festim-dev / festim Goto Github PK
View Code? Open in Web Editor NEWCoupled hydrogen/tritium transport and heat transfer using FEniCS
Home Page: https://festim.readthedocs.io/en/latest/
License: Apache License 2.0
Coupled hydrogen/tritium transport and heat transfer using FEniCS
Home Page: https://festim.readthedocs.io/en/latest/
License: Apache License 2.0
MeshFunction
that contains the subdomainsD
coeffFor validation purposes, the user should be able to apply BCs and sources terms to every components of vector u.
I noticed that the time and expressions were updating after solving the system which will induce errors.
It would be nice to have a timer and to know how long did the calculation last.
Users should only give sympy expressions in parameters.
Currently BC aren't updating throughout the calculation.
apply_boundary_conditions()
should be modified and be called at each time step in order to reassign bcs
.
The user should be able to assign initial values for concentrations as parameters.
In case where nothing is set, the default value should be 0 for all the concentrations.
One way to do it would be to keep u_i
as concentrations (and not number of traps) and just put N_0 on its own. I think the fact that the boundary conditions are set to zero for the number of traps can complicate things.
Currently the beggining of TDS is hard coded. This has to be changed quick
2 traps + 1 extrinsic one
The user should be able to create sequences for temperature instead of Timp, Trest, TDS, etc...
Should be changed to updating D_0 and E_diff same as alpha and beta
This shouldn't be .sub(0)
but rather .sub(component)
The solution yields nan when non flux condition is put on one of the sides
See "Tritium absorption and desorption in ITER relevant materials comparative study of tungsten dust and massive samples" C. Grisolia et al JNM (2015)
As in 3-MOT, users should be able to compute fluxes at surfaces, integrate over subdomains, etc.
The result will then be exported to a csv format for later use.
In parameters
:
"exports": {
"post_processing": {
"heat_transfers": {
"surface_flux": [1],
"total_volume": [1],
"volume_average": [1],
"volume_minimum": [1],
"volume_maximum": [1],
"custom": [],
"output_file": "file1.csv",
},
"tritium_diffusion": {
"surface_flux": [1, 2],
"total_volume": [1],
"volume_minimum": [1],
"volume_maximum": [1],
"custom": ["assemble(res[0]*dx(1))"],
"output_file": "file2.csv"
},
}
}
The error is in FESTIM.initialising_solutions
as ini_u
is scalar whereas fenics.interpolate
expects vector of rank 1.
Fix is to make sure variable expression
is a tuple.
Being able to refine the mesh on the left hand side, so that we have roughly 5um/1500 = 0.003 um / cell in the first 5 um.
D must be defined as an Expression or a Function(W) (in this case at each time step iterate through the mesh) in order to be temperature dependent.
Currently it's fixed.
Current: The solver exports every time step in a xdmf file
Wished:
dt_export
Users should be able to set time dependent BCs as interpolation of a 2D table.
Something like:
table = [[0, 2],
[1, 2],
[4, 5]]
where 0, 1, 4 are times and 2, 2, 5 are values at these times.
This table would then be interpolated and ideally put in an Expression()
object that can be updated throughout the calculation.
They should be the same
Being able to plot :
Solution at specific times (before TDS, before implantation...)
TDS spectrum
When the initial number of cells is too small, it may happen that all the midpoints found aren't in the refinement zone, leading to an infinite loop.
It would be better to mesh first each material, then join the meshes and only then do the refinement
Users should be able to define non homogeneous trap distribution as FEniCS Expression()
.
The stepsize shouldn't go below a certain value.
Should be able to import xdmf meshes generated with gmsh
In apply_boundary_conditions
, it should be V.sub(component)
instead of V.sub(0)
Implement a loop that's wait for the file to be close or create a new one, thus avoiding the loss of data.
When solver doesn't converge, a NameError is raised solver is not defined
.
The user should be able to :
Expression()
Instead of just giving the first time step, the user should be able to give an array of times when he/she wants to do the calculation. This has the main advantages of :
Could be cool to export parameters in a json file.
At least :
Or allow the user to choose what parameters are to be exported.
This should be done with tot = project(_u_1 + _u_2 + _u_3 + _u_4, W)
.
Change from pvd files to xdmf files in order to save space
It would be great to have an adaptative time step in order to optimise computation time. We would need to have a separate script that plots the time step as function of steps.
Find a way to avoid hard coding the number of simulated traps.
Replace:
P1 = FiniteElement('P', interval, 1)
element = MixedElement([P1, P1, P1, P1])
V = FunctionSpace(mesh, element)
W = FunctionSpace(mesh, 'P', 1)
V0 = FunctionSpace(mesh, 'DG', 0)
v_1, v_2, v_3, v_4 = TestFunctions(V)
testfunctions = [v_1, v_2, v_3, v_4]
u_1, u_2, u_3, u_4 = split(u)
solutions = [u_1, u_2, u_3, u_4]
ini_u = Expression(("0", "0", "0", "0"), degree=1)
u_n = interpolate(ini_u, V)
u_n1, u_n2, u_n3, u_n4 = split(u_n)
previous_solutions = [u_n1, u_n2, u_n3, u_n4]
_u_1, _u_2, _u_3, _u_4 = u.split()
# Save solution to file (.xdmf)
_u_1.rename("solute", "label")
_u_2.rename("trap_1", "label")
_u_3.rename("trap_2", "label")
_u_4.rename("trap_3", "label")
xdmf_u_1.write(_u_1, t)
xdmf_u_2.write(_u_2, t)
xdmf_u_3.write(_u_3, t)
xdmf_u_4.write(_u_4, t)
total_trap1 = assemble(_u_2*dx)
total_trap2 = assemble(_u_3*dx)
total_trap3 = assemble(_u_4*dx)
total_trap = total_trap1 + total_trap2 + total_trap3
total_sol = assemble(_u_1*dx)
"traps": [
{
"energy": 0.87,
"density": 1.3e-3*6.3e28,
"materials": [1]
},
{
"energy": 1.0,
"density": 4e-4*6.3e28,
"materials": [1]
}],
"xdmf": {
"functions": ['solute', '1', '2', '3', '4', 'retention'],
"labels": ['solute', 'trap_1', 'trap_2',
'trap_3', 'trap_4', 'retention'],
"folder": 'Solution'
here len(solutions)
list will be 3+1 (retention) = 4 whereas len(["xdmf"]["functions"])
is 5. This should raise an error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.