|
[Sponsors] |
October 4, 2022, 18:33 |
Inadvertent Dirichlet discontinuity
|
#1 |
Member
Join Date: Mar 2019
Posts: 86
Rep Power: 7 |
Hi
Let's say that in foam-extend we have coupledFvScalarMatrix TEqns(2); TEqns.set ( fvm::ddt(T) + fvm::div(phi, T) - fvm::laplacian(DT, T) ); TEqns.set ( fvm::ddt(T2) - fvm::laplacian(DT2, T2) ); TEqns.solve(); where T is on a mesh conformal to that where T2 is defined. If in the dictionaries, we defined a FixedValue for T on the patch common to both meshes, that is different from a FixedValue for T2 on that same patch, then, which of these two values apply in the above solve() ? Regards |
|
October 20, 2022, 21:43 |
|
#2 |
Member
Join Date: Mar 2019
Posts: 86
Rep Power: 7 |
The answer is obvious: Both values and the program will bomb out because it is solving an inconsistent set of equations Ax=b : we have row i = row k of matrix A and bi not equal to bk (b = [b1,...bi,....,bk,....]
Anyhow both meshes contribute the same boundary condition to the combined matrix A. Simply do not add the duplicate one. The meshes do not need to be conformal (same points for the patch interface in common) but it makes the problem easier to solve (no interpolation required) I still have to find a way to add a boundary condition that involves variables on both meshes to matrix A. I will keep you posted unless somebody can tell me how it's done. Thank you for viewing |
|
November 14, 2022, 21:02 |
Use Elmer instead
|
#3 |
Member
Join Date: Mar 2019
Posts: 86
Rep Power: 7 |
After an exhaustive, exhausting and fruitless search of foam-extend, I am sure there is no way to store values a, b, c, and d for the following boundary condition between two domains for a scalar field X:
a * Xp + b * X1 + c * X2 = d where X1(2) is the value of X at the center of a cell on the domain 1 (2) and both cells have exactly the same patch points. Xp is of course the value of X on a patch point. Therefore, I recommend anybody who wants to solve a Poisson equation with a discontinuity in the electric field between two domains, to get familiar with Fortran FEM code Elmer from Finland and in addition, with Eof from Latvia if you are interested in coupling Elmer to other equations you may want to solve in OpenFOAM over a single domain. This is because Elmer has a solver StatElecSolver that automatically handles that discontinuity. All you need to do is add in a dictionary, the electrical permittivities of the two domains and the surface charge on the common boundary. You could use it to solve for temperature in a steady state diffusion equation by specifying the heat conductivities on both sides. I realize it is going to be a steep learning curve for most people, but I do not see another way out. Thanks for viewing Marc |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
JOB ABORT invoked by rank 17 | ltl | CONVERGE | 3 | January 25, 2021 15:05 |
Discontinuity at the blunt trailing edge of an airfoil | klkl | OpenFOAM Running, Solving & CFD | 0 | October 28, 2020 04:42 |
Applying the Dirichlet boundary condition on moving free surface | HuihuangXia | OpenFOAM Running, Solving & CFD | 0 | October 4, 2020 16:16 |
div(grad) not equal to laplacian close to a discontinuity | gtg258f | OpenFOAM | 10 | December 6, 2012 05:58 |
Stepwise Discontinuity problem | Alan Kang | Main CFD Forum | 1 | February 22, 2000 23:46 |