Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The expression of Heat2D_VaryingCoef #11

Open
DUCH714 opened this issue Dec 14, 2024 · 3 comments
Open

The expression of Heat2D_VaryingCoef #11

DUCH714 opened this issue Dec 14, 2024 · 3 comments

Comments

@DUCH714
Copy link

DUCH714 commented Dec 14, 2024

May I ask the expression of the class Heat2D_VaryingCoef, is it orresponded to B.1.7 2D Heat with Varying Coefficients (Heat2d-VC)?

However, in your code, the expression should be

$$ u_t-a(x,y)(\nabla \cdot \nabla u)=f(x), $$

but in B.1.7, the expression is

$$ u_t-\nabla (a(x,y) \nabla u)=f(x). $$

Which one is correct?

@i207M
Copy link
Owner

i207M commented Dec 18, 2024

Thank you for bringing up this problem. This indeed needs some clarification.

In the case we provided, a piecewise constant $a$ is used. Hence the order of $a$ and $\nabla$ doesn't matter (ignoring the boundary points). We moved $a$ outside to accelerate computing. However, if one wants to update the settings of the problem, one needs to update the implementation.

I hope this answers your question.

@DUCH714
Copy link
Author

DUCH714 commented Dec 19, 2024

Thanks for answering the question.

In my opinion, piecewise constant is not constant. If $a$ is piecewise constant on the computational domain, you can't move it outside because the derivative at the discontinous points is not 0.

Especially in numerical methods, the discontinous points may cause oscillations if you calculate the derivative near them. So may I ask when you generated the numerical solution $u$, did you move $a$ outside?

@i207M
Copy link
Owner

i207M commented Jan 14, 2025

Thanks for your comment. It is debatable whether that will cause much of a difference.
For your second question, we apply the nearest interpolation of $a$ when using the COMSOL solver, with $a$ inside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants