JasonS
09/23/2025, 11:43 PMpinkfloydrain
09/24/2025, 12:12 AMJasonS
09/24/2025, 12:13 AMJasonS
09/24/2025, 12:13 AMJasonS
09/24/2025, 12:15 AMJasonS
09/24/2025, 12:16 AMJasonS
09/24/2025, 12:16 AMJasonS
09/24/2025, 12:16 AMJasonS
09/24/2025, 12:16 AMfinn
09/25/2025, 10:50 AMfinn
09/25/2025, 10:50 AMvoid Foam::chtPimpleApp::Manager::write() const
{
Region_FLUID::Storage& storage = regions().region_FLUID().storage();
const volScalarField& T = storage.thermo().T();
const volScalarField& kappa = storage.Kappa();
forAll(T.boundaryField(), patchI)
{
const fvPatchScalarField& Tpatch = T.boundaryField()[patchI];
if (isType<solidWallMixedTemperatureCoupledFvPatchScalarField>(Tpatch))
{
const fvPatchScalarField& Tpatch = T.boundaryField()[patchI];
// Thermal conductivity at this patch
const scalarField& kappaPatch = kappa.boundaryField()[patchI];
// Compute per-face heat flux: q = kappa * (gradT · n) * faceArea
scalarField heatFluxPatch = kappaPatch * Tpatch.snGrad() * Tpatch.patch().magSf();
surfaceScalarField heatFlux
(
IOobject
(
"heatFlux",
this->time().timeName(),
T.mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
T.mesh(),
dimensionedScalar("zero", dimensionSet(1,0,-3,0,0,0,0), 0.0) // initialize all faces to 0
);
heatFlux.boundaryField()[patchI] = heatFluxPatch;
heatFlux.write();
}
}
}
tkeskita
09/28/2025, 6:29 AMWM_COMPILE_OPTION=Opt
) allows access beyond end of UList
, but the debug version (WM_COMPILE_OPTION=Debug
) does not and raises error like the one below. Does anyone know why the optimized UList behaves differently than the debug version? This means that one should always try to compile and and run on both Opt and Debug versions to reveal hidden bugs.
--> FOAM FATAL ERROR:
index 78000 out of range 0 ... 76799
From function void Foam::UList<T>::checkIndex(Foam::label) const [with T = Foam::Vector<double>; Foam::label = int]
slopezcastano
09/28/2025, 8:35 AMtkeskita
09/28/2025, 9:22 AMslopezcastano
09/28/2025, 9:42 AMslopezcastano
09/28/2025, 9:43 AMslopezcastano
09/28/2025, 9:43 AMslopezcastano
09/28/2025, 9:43 AMtkeskita
09/28/2025, 10:17 AMFoam::fvMesh::Cf()
and many more of base fvMesh functions when I try to access the values on patch faces..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 PM