postPostProcessor executes
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › postPostProcessor executes
- This topic has 1 reply, 2 voices, and was last updated 1 week, 5 days ago by Adrian.
-
AuthorPosts
-
October 23, 2024 at 4:15 pm #9422liuParticipant
Dear community, I would like to ask if the postPostProcessor executes updates at every time step. In my program, I implemented communication between two grid cells to retrieve taueff information, but tauAD only gets the taueff initialized in blocklattice and does not update iteratively with each time step. Below is the code I wrote, and I mainly added these three lines. Thank you! “auto tauEff = blockLattice.get(iX, iY, iZ) .template getFieldPointer<descriptors::TAU_EFF>();
auto tauAD = _partnerLattice->get(x0, y0, z0).template getFieldPointer<descriptors::TAU_EFF>();
tauAD[0] = tauEff[0];”
//=====================================================================================
//============== AdvectionDiffusionParticleCouplingPostProcessor3D ===========
//=====================================================================================template <typename T, typename DESCRIPTOR, typename ADLattice, typename FIELD_A,typename FIELD_B>
AdvectionDiffusionParticleCouplingPostProcessor3D< T, DESCRIPTOR, ADLattice, FIELD_A, FIELD_B>::
AdvectionDiffusionParticleCouplingPostProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int iC_,
std::vector<BlockStructureD<3>* > partners_,
std::vector<std::reference_wrapper<
AdvectionDiffusionForce3D<T, DESCRIPTOR, ADLattice>>> forces_ /*, T tauEff*/)
: _forces(forces_), /*tauEff(tauEff) ,*/
x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_), iC(iC_), _partnerLattice(static_cast<BlockLattice<T, ADLattice>*>(partners_[0])),
_cell(_partnerLattice->get(x0,y0,z0)),
_cellXp(_partnerLattice->get(x0+1,y0,z0)),
_cellXn(_partnerLattice->get(x0-1,y0,z0)),
_cellYp(_partnerLattice->get(x0,y0+1,z0)),
_cellYn(_partnerLattice->get(x0,y0-1,z0)),
_cellZp(_partnerLattice->get(x0,y0,z0+1)),
_cellZn(_partnerLattice->get(x0,y0,z0-1))
{
this->getName() = “AdvectionDiffusionParticleCouplingPostProcessor3D”;
}template <typename T, typename DESCRIPTOR, typename ADLattice, typename FIELD_A, typename FIELD_B>
void AdvectionDiffusionParticleCouplingPostProcessor3D<
T, DESCRIPTOR, ADLattice, FIELD_A, FIELD_B>::
processSubDomain(
BlockLattice<T, DESCRIPTOR>& blockLattice,
int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
{
//auto tauEff = _cell.template getField<FIELD_C>();
//std::cout << “omegatauEff=” << tauEff << std::endl;
auto vel = par ? _cell.template getField<FIELD_B>() : _cell.template getField<FIELD_A>();
//auto vel_new = par ? _cell.template getFieldPointer<FIELD_A>() : _cell.template getFieldPointer<FIELD_B>();auto velXp = par ? _cellXp.template getField<FIELD_B>() : _cellXp.template getField<FIELD_A>();
auto velXn = par ? _cellXn.template getField<FIELD_B>() : _cellXn.template getField<FIELD_A>();
auto velYp = par ? _cellYp.template getField<FIELD_B>() : _cellYp.template getField<FIELD_A>();
auto velYn = par ? _cellYn.template getField<FIELD_B>() : _cellYn.template getField<FIELD_A>();
auto velZp = par ? _cellZp.template getField<FIELD_B>() : _cellZp.template getField<FIELD_A>();
auto velZn = par ? _cellZn.template getField<FIELD_B>() : _cellZn.template getField<FIELD_A>();int newX0, newX1, newY0, newY1, newZ0, newZ1;
//AnalyticalConst3D<T, T> TauEff( blockLattice.template getField<descriptors::TAU_EFF>());
//_partnerLattice->template setField<descriptors::TAU_EFF>(TauEff);
//std::cout << “tauEff=” << TauEff << std::endl;
if ( util::intersect (
x0, x1, y0, y1, z0, z1,
x0_, x1_, y0_, y1_, z0_, z1_,
newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {for (int iX=newX0; iX<=newX1; ++iX) {
for (int iY=newY0; iY<=newY1; ++iY) {
for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
int latticeR[4] = {iC, iX, iY, iZ};
T velGrad[3] = {0.,0.,0.};
T forceValue[3] = {0.,0.,0.};
T velF[3] = {0.,0.,0.};auto nsCell = blockLattice.get(iX,iY,iZ);
auto tauEff = blockLattice.get(iX, iY, iZ) .template getFieldPointer<descriptors::TAU_EFF>();
auto tauAD = _partnerLattice->get(x0, y0, z0).template getFieldPointer<descriptors::TAU_EFF>();tauAD[0] = tauEff[0];
October 23, 2024 at 4:40 pm #9423AdrianKeymasterYou are working in a legacy coupling post processor. It will be executed every time you call
SuperLattice::executeCoupling
. -
AuthorPosts
- You must be logged in to reply to this topic.