You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running a simulation with the Soret effect, I realised that setting a SurfaceFlux derived quantity would result in the wrong values. This is because the soret flag in compute seems to be ignored.
To Reproduce
Simple 1D steady state simulation, checking the flux balance with soret activated.
importnumpyasnpimportfestimasFmy_model=F.Simulation()
my_model.mesh=F.MeshFromVertices(vertices=np.linspace(0, 1, num=100))
my_model.materials=F.Material(id=1, D_0=1, E_D=0, Q=2)
my_model.T=F.Temperature(value=700+1000*F.x)
my_model.boundary_conditions= [
F.DirichletBC(surfaces=[1], value=10, field=0),
F.DirichletBC(surfaces=[2], value=1, field=0),
]
my_model.settings=F.Settings(
absolute_tolerance=1e-10, relative_tolerance=1e-10, transient=False, soret=True
)
flux_left=F.SurfaceFlux(field=0, surface=1)
flux_right=F.SurfaceFlux(field=0, surface=2)
my_model.exports= [F.DerivedQuantities([flux_left, flux_right])]
my_model.initialise()
my_model.run()
# these two should be equal in steady stateprint(flux_left.data)
print(flux_right.data)
Produces:
[370.7625458744958]
[1.1058666646404112]
Expected behavior
The two fluxes should have the same absolute value.
To convince us even further, try and add assert False in the compute method with soret:
Describe the bug
When running a simulation with the Soret effect, I realised that setting a
SurfaceFlux
derived quantity would result in the wrong values. This is because thesoret
flag incompute
seems to be ignored.To Reproduce
Simple 1D steady state simulation, checking the flux balance with soret activated.
Produces:
Expected behavior
The two fluxes should have the same absolute value.
To convince us even further, try and add
assert False
in the compute method with soret:And you will see everything runs fine.
Moreover, I found this TODO comment:
FESTIM/festim/exports/derived_quantities/derived_quantities.py
Line 157 in 40cdd22
The text was updated successfully, but these errors were encountered: