underworldcode / underworld3

https://underworldcode.github.io/underworld3/
Other
21 stars 10 forks source link

Help setting up a two-component coupled system #250

Closed bknight1 closed 1 month ago

bknight1 commented 1 month ago

Hi team,

I'm trying to set up a two-component system as follows:

$$ \frac{\partial C{\text{A}}}{\partial t} = \nabla \cdot \left( D{\text{AA}} \nabla C{\text{A}} + D{\text{AB}} \nabla C_{\text{B}} \right) $$

$$ \frac{\partial C{\text{B}}}{\partial t} = \nabla \cdot \left( D{\text{BB}} \nabla C{\text{B}} + D{\text{BA}} \nabla C_{\text{A}} \right) $$

Similar to what is outlined in eq 2 here.

I have a sympy matrix for the flux (F1) and dC/dt (F0) terms, which are (2,2) and (2, 1) in shape, respectively.

@julesghub suggested using the _VectorProjection solver, but I can't modify the F1 term to reflect my flux term due to how F1 is constructed.

Are there any other solvers I can use? I can't use the Poisson solver as it expects scalar F0 and F1 terms.

Cheers

lmoresi commented 1 month ago

I did not have problems with the advection-diffusion solver with zero velocity field, though it does have extra baggage in the solver that could be stripped out. Would it be OK to split the coupling terms that way ?

bknight1 commented 1 month ago

Closing this as I've managed to make a coupled system using two diffusion solvers that matches benchmark values (attached).

benchmark_comp