Skip to content

Reply To: Segmentation fault for OpenLB 1.5

#6761
Fany
Participant

Hi Adrian,

The examples “aorta3d” and “rayleighBenard3d” worked in our cluster.
I was wanting to added the heat transfer into the case “aorta3d” (forced convective heat transfer). The new code can run in the OpenLB 1.4 but not 1.5.
The Segmentation fault always occurred in the step “preparelattice” as following:
”’
[prepareLattice] Prepare Lattice …
————————————————————————–
Primary job terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
————————————————————————–
————————————————————————–
mpiexec noticed that process rank 1 with PID 43519 on node fluid028 exited on signal 11 (Segmentation fault).
————————————————————————–
2 total processes killed (some possibly by mpiexec during cleanup)
”’

Here is my preparelattice code:
void prepareLattice( ThermalUnitConverter<T, NSDESCRIPTOR, TDESCRIPTOR> const& converter,
SuperLattice<T, NSDESCRIPTOR>& NSlattice,
SuperLattice<T, TDESCRIPTOR>& ADlattice,
STLreader<T>& stlReader,
SuperGeometry<T,3>& superGeometry )
{
OstreamManager clout( std::cout,”prepareLattice” );
clout << “Prepare Lattice …” << std::endl;

T omega = converter.getLatticeRelaxationFrequency();
T Tomega = converter.getLatticeThermalRelaxationFrequency();

// material=0 –> do nothing
ADlattice.defineDynamics<NoDynamics>(superGeometry, 0);
NSlattice.defineDynamics<NoDynamics>(superGeometry, 0);

// material=1 –> bulk dynamics
//lattice.defineDynamics( superGeometry,1,&bulkDynamics );
ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 1);
NSlattice.defineDynamics<ForcedBGKdynamics>(superGeometry, 1);

// material=2 –> bounceBack dynamics
ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 2);
setAdvectionDiffusionTemperatureBoundary<T,TDESCRIPTOR>(ADlattice, Tomega, superGeometry, 2);
NSlattice.defineDynamics<BounceBack>(superGeometry, 2);
// setLocalVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry, 2);

// material=3 –> bulk dynamics + velocity (inflow)
ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>( superGeometry, 3);
NSlattice.defineDynamics<ForcedBGKdynamics>( superGeometry, 3);
setLocalVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry, 3);

// material=4,5 –> bulk dynamics + pressure (outflow)
ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>( superGeometry.getMaterialIndicator({4, 5}));
NSlattice.defineDynamics<ForcedBGKdynamics>( superGeometry.getMaterialIndicator({4, 5}));

setInterpolatedPressureBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry.getMaterialIndicator({4, 5}));

// AnalyticalConst3D<T,T> rhoF( 1 );
// std::vector<T> velocity( 3,T() );
// AnalyticalConst3D<T,T> uF( velocity );

AnalyticalConst3D<T,T> rhoF(1.);
AnalyticalConst3D<T,T> uF( 0.0, converter.getLatticeVelocity(Re * converter.getPhysViscosity() / converter.getCharPhysLength()), 0.0);
AnalyticalConst3D<T,T> u0(0.0, 0.0, 0.0);
AnalyticalConst3D<T,T> T_cold(converter.getLatticeTemperature(Tcold));
AnalyticalConst3D<T,T> T_hot(converter.getLatticeTemperature(Thot));

// Initialize all values of distribution functions to their local equilibrium
NSlattice.defineRhoU(superGeometry, 3, rhoF, uF);
NSlattice.iniEquilibrium(superGeometry, 3, rhoF, uF);
NSlattice.defineRhoU( superGeometry.getMaterialIndicator({1, 4, 5}),rhoF, u0 );
NSlattice.iniEquilibrium( superGeometry.getMaterialIndicator({1, 4, 5}),rhoF, u0 );

ADlattice.defineRho(superGeometry, 1, T_cold);
ADlattice.iniEquilibrium(superGeometry, 1, T_cold, u0);
ADlattice.defineRho(superGeometry, 2, T_hot);
ADlattice.iniEquilibrium(superGeometry, 2, T_hot, u0);
ADlattice.defineRho(superGeometry.getMaterialIndicator({ 4, 5}), T_cold);
ADlattice.iniEquilibrium(superGeometry.getMaterialIndicator({ 4, 5}), T_cold, u0);
ADlattice.defineRho(superGeometry, 3, T_cold);
ADlattice.iniEquilibrium(superGeometry, 3, T_cold, u0);

NSlattice.defineU( superGeometry, 3, uF );

ADlattice.setParameter<descriptors::OMEGA>(converter.getLatticeThermalRelaxationFrequency());
NSlattice.setParameter<descriptors::OMEGA>(converter.getLatticeRelaxationFrequency());

// Lattice initialize
NSlattice.initialize();
ADlattice.initialize();

clout << “Prepare Lattice … OK” << std::endl;
}

I would like to know if the new version transfer the “BulkDynamics” in NSDESCRIPTOR to DESCRIPTOR. In last version, I can use this function from NSDESCRIPTOR. but in version 1.5, there is just ForcedBGKdynamics in NSDESCRIPTOR.

Best regards,
Fany