Error arising from Energy Equation
Dear FOAMers,
I have posted this in the section dedicated to Running, Solving and CFD, however as I am not getting any answer I imagine maybe this was the wrong forum to address. I am actually working on a compressible solver (density based) that I created using the pre-existing chtMultiRegionFoam solver. As stated in the title, I get (see hereunder) an error when solving for the following energy equation: fvScalarMatrix EEqn ( fvm::ddt(rho, he) + fvm::div(phi, he) + fvc::ddt(rho, K) + fvc::div(phi, K) == fvm::laplacian(kEff, T) + HS ); HS is just a volumetric source term, and kEff is the effective conductivity. he is the internal energy (I compute it using an external Fortran code) while K is set as being: const volScalarField& K = 0.5 * (U & U); #0 Foam::error: rintStack(Foam::Ostream&) at ??:? #1 Foam::sigSegv::sigHandler(int) at ??:? #2 at sigaction.c:? #3 memcpy at interp.c:? #4 std::string::append(std::string const&) in "/home/faabid/OpenFOAM/ThirdParty-2.3.0/platforms/linux64/gcc-4.8.1/lib64/libstdc++.so.6" #5 std::basic_string<char, std::char_traits<char>, std::allocator<char> > std: perator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at ~/OpenFOAM/ThirdParty-2.3.0/platforms/linux64/gcc-4.8.1/include/c++/4.8.1/bits/basic_string.h:2370 #6 at ~/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/fvcDiv.C:240 (discriminator 2) #7 at ~/OpenFOAM/OpenFOAM-2.3.0/applications/solvers/heatTransfer/CompressibleHeSolver/./fluid/EEqn.H:24 (discriminator 1) #8 __libc_start_main at ??:? #9 at ??:? Segmentation fault (core dumped) Where fluid/EEqn.H:24 corresponds to: + fvc::ddt(rho, K) + fvc::div(phi, K) I also remind that K is set to: const volScalarField& K = 0.5*magSqr(U); Could anyone please help me ?? Thank you !! |
Hi,
Why K is const reference (why not create just a copy of 0.5*(U & U) using constructor from tmp as volScalarField K(0.5*(U & U))? Are you sure, object it is referencing is not destroyed before construction of energy equation? |
Hi Alexey,
First of all, thank you very much for your attention and help! I did modified the way I construct and call K and you were right to point this out because the error seems now corrected. However, I am getting an error from the energy term "he" and it is the following: Code:
FOAM FATAL ERROR: Code:
volScalarField& he = heFluids[i]; Code:
divSchemes Code:
dimensions [1 2 -2 0 0 0 0]; Once again thank you for your time and support, it's much appreciated! |
Hi,
Default constructor of volScalarField (which is just typedef over GeometricField, http://cpp.openfoam.org/v4/a00931.ht...0d8f8a5fec0dc8) sets calculated type for all boundary conditions, hence the error. The easies ways if to add to your constructor "zeroGradient", so he field has zero gradient BCs everywhere. Code:
heFluids.set( |
Hi Alexey,
I understand, I did not know about that, thanks a lot for the tip. I will try that as soon as I get my hands back on the code and will keep you posted. Thanks again for your valuable help ! |
Hi again,
The solution you provided did the job, now I've got to figure out why the solution for "he" diverges and makes the solver crash after a few time steps. But you were of great help, thanks a lot for everything Alexey ! Faab |
All times are GMT -4. The time now is 07:01. |