tkeskita
09/28/2025, 10:23 AMotaolafr
09/29/2025, 10:22 AMtkeskita
10/03/2025, 6:56 AMfvMesh? Feels like this should be a trivial thing, but I haven't found a way.. CFD-online says mesh.cellFaces() but there is no such function. Looks like OF does not need this information, so it is not available. Have to build it yourself.tkeskita
10/03/2025, 7:08 AMslopezcastano
10/03/2025, 11:17 AMslopezcastano
10/03/2025, 11:17 AMtkeskita
10/03/2025, 12:07 PMslopezcastano
10/03/2025, 12:12 PMconst labelList& faceOwner = mesh.faceOwner();tkeskita
10/04/2025, 11:06 AMWM_COMPILE_OPTION=Debug. And sometimes run through valgrind, also.
template<class T>
inline T& Foam::UList<T>::operator[](const label i)
{
#ifdef FULLDEBUG
checkIndex(i);
#endif
return v_[i];
}slopezcastano
10/05/2025, 8:42 AMtkeskita
10/06/2025, 3:53 PMfinn
10/22/2025, 7:13 AM// Read solver for V
word solverV
(
mesh.solutionDict().solver(V.name()).lookup("solver")
);
if(solverV != "deflatedPCG")
{
// TODO: Read reference values
// VEqn.setReference(VRefCell, VRefValue);
VEqn.setReference(0, 0.0);
}`
Which doesnt make physical sense, I do get it when you have p_rgh but there is not real reference for it. So I commented it out ran the biconjugate gradient again and no convergence... But some interesting insightsfinn
10/22/2025, 7:14 AMtkeskita
10/22/2025, 2:50 PMfinn
10/22/2025, 3:24 PMfinn
10/23/2025, 1:30 PMtkeskita
11/03/2025, 1:28 PMvinicius00
11/10/2025, 7:38 PMkid with polio
11/12/2025, 7:11 PMfinn
11/21/2025, 8:35 AMsurfaceScalarField Ef
(
IOobject
(
"Ef",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::interpolate(j0Re) & mesh.Sf() / (fvc::interpolate(sigma))
);
Info<< nl << "Calculate applied current distribution" << endl;
// TODO read 'correctNonOrthogonal' from the coil subDict
while (control.correctNonOrthogonal())
{
V0Re.storePrevIter();
fvScalarMatrix V0ReEqn
(
fvm::laplacian // check sign
(
dimensionedScalar("1", dimless, 1),
V0Re
)
==
fvc::div(Ef)
);
// TODO ADD REFERENCE LOOKUP
V0ReEqn.setReference(0, 0.0);
V0ReEqn.solve(control.subDict(Region::COIL, V0Re.name()));
if (control.finalNonOrthogonalIter())
{
Ef -= V0ReEqn.flux();
}
else
{
V0Re.relax();
}
}
I have been solving the potentialFlow equation with little bit different variables, However what happends in the solver is that when I run it once it goes 1 times through the loop after which it tries to solve and it gets a floatingPoint error, when I run it again everything works and it goes through the loops and converges.
- I have looked at removing fv::div(Ef) from the loop interely which still results in the issues, which I think narrows it down to V0Re, I check the initilization and nothing changed.
So I am bit clueless on what is going wrong.finn
11/21/2025, 9:01 AMRun 1:
GAMG: Solving for V0Re, Initial residual = 1, Final residual = 6.1893306e-09, No Iterations 30
Floating point exception (core dumped)
Run 2:
Calculate applied current distribution
GAMG: Solving for V0Re, Initial residual = 1, Final residual = 6.1893306e-09, No Iterations 30
GAMG: Solving for V0Re, Initial residual = 0.040833635, Final residual = 8.8566906e-07, No Iterations 10
GAMG: Solving for V0Re, Initial residual = 0.00341274, Final residual = 6.1402001e-08, No Iterations 10
GAMG: Solving for V0Re, Initial residual = 0.000444691, Final residual = 8.3338828e-09, No Iterations 10
GAMG: Solving for V0Re, Initial residual = 6.9578259e-05, Final residual = 1.1143398e-09, No Iterations 10
^Cfinn
11/21/2025, 9:02 AMfvScalarMatrixtkeskita
11/23/2025, 3:17 PMmuehhlllerr
11/23/2025, 5:10 PMmuehhlllerr
11/23/2025, 5:11 PMtkeskita
11/23/2025, 6:15 PMmuehhlllerr
11/23/2025, 6:32 PMfinn
11/24/2025, 9:47 AMvolScalarField tempV0Re
(
IOobject
(
V0Re.name() + "_dbgTemp",
V0Re.time().timeName(),
V0Re.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
V0Re // copy contents + BCs
);
globalMesh[COIL].schemesDict().setFluxRequired(V0Re.name() + "_dbgTemp");
which is a bit nasty, and not user friendly but o well.