Skip to content

Re: Open Top – Boundary Condition

#2456
ivan
Member

Okay, I have just noticed that is has to do with this part of the code

Code:
void setBoundaryValues(SuperLattice2D<T, DESCRIPTOR>& sLatticeOne,
SuperLattice2D<T, DESCRIPTOR>& sLatticeTwo,
T force, int iT, SuperGeometry2D<T>& superGeometry) {

if(iT==0) {

AnalyticalConst2D<T,T> noise(4.e-2);
std::vector<T> v(2,T());
AnalyticalConst2D<T,T> zeroV(v);
AnalyticalConst2D<T,T> zero(0.);
AnalyticalLinear2D<T,T> one(0.,-force*DESCRIPTOR<T>::invCs2,0.98+force*ny*DESCRIPTOR<T>::invCs2);
AnalyticalConst2D<T,T> onePlus(0.98+force*ny/2.*DESCRIPTOR<T>::invCs2);
AnalyticalRandom2D<T,T> random;
AnalyticalIdentity2D<T,T> randomOne(random*noise+one);
AnalyticalIdentity2D<T,T> randomPlus(random*noise+onePlus);
std::vector<T> F(2,T());
F[1] = -force;
AnalyticalConst2D<T,T> f(F);

/// for each material set the defineRhou and the Equilibrium

sLatticeOne.defineRhoU(superGeometry, 1, zero, zeroV);
sLatticeOne.iniEquilibrium(superGeometry, 1, zero, zeroV);
sLatticeOne.defineExternalField(superGeometry, 1,DESCRIPTOR<T>::ExternalField::externalForceBeginsAt,
DESCRIPTOR<T>::ExternalField::sizeOfExternalForce, f );

sLatticeOne.defineRhoU(superGeometry, 2, randomOne, zeroV);
sLatticeOne.iniEquilibrium(superGeometry, 2, randomOne, zeroV);
sLatticeOne.defineExternalField(superGeometry, 2, DESCRIPTOR<T>::ExternalField::externalForceBeginsAt,DESCRIPTOR<T>::ExternalField::sizeOfExternalForce, f );

sLatticeTwo.defineRhoU(superGeometry, 1, randomPlus, zeroV);
sLatticeTwo.iniEquilibrium(superGeometry, 1, randomPlus, zeroV);

sLatticeTwo.defineRhoU(superGeometry, 2, zero, zeroV);
sLatticeTwo.iniEquilibrium(superGeometry, 2, zero, zeroV);

Which is atributing the densities and equilibrium. So, what I tried to do is to copy the exact same code for material number 4, once I want it to behave exactly like number 1, so:

Code:
/// for each material set the defineRhou and the Equilibrium

sLatticeOne.defineRhoU(superGeometry, 1, zero, zeroV);
sLatticeOne.iniEquilibrium(superGeometry, 1, zero, zeroV);
sLatticeOne.defineExternalField(superGeometry, 1, DESCRIPTOR<T>::ExternalField::externalForceBeginsAt,DESCRIPTOR<T>::ExternalField::sizeOfExternalForce, f );

[b] sLatticeOne.defineRhoU(superGeometry, 4, zero, zeroV);
sLatticeOne.iniEquilibrium(superGeometry, 4, zero, zeroV);
sLatticeOne.defineExternalField(superGeometry, 4, DESCRIPTOR<T>::ExternalField::externalForceBeginsAt,DESCRIPTOR<T>::ExternalField::sizeOfExternalForce, f );[/b]

sLatticeOne.defineRhoU(superGeometry, 2, randomOne, zeroV);
sLatticeOne.iniEquilibrium(superGeometry, 2, randomOne, zeroV);
sLatticeOne.defineExternalField(superGeometry, 2, DESCRIPTOR<T>::ExternalField::externalForceBeginsAt,DESCRIPTOR<T>::ExternalField::sizeOfExternalForce, f );

sLatticeTwo.defineRhoU(superGeometry, 1, randomPlus, zeroV);
sLatticeTwo.iniEquilibrium(superGeometry, 1, randomPlus, zeroV);
[b]
sLatticeTwo.defineRhoU(superGeometry, 4, randomPlus, zeroV);
sLatticeTwo.iniEquilibrium(superGeometry, 4, randomPlus, zeroV);[/b]

sLatticeTwo.defineRhoU(superGeometry, 2, zero, zeroV);
sLatticeTwo.iniEquilibrium(superGeometry, 2, zero, zeroV);

And right now I do get the static fluid on material 4 BUT for some reason the droplet of the lighter immiscible fluid (material number 2) is unable to flow through it, as if it was a barrier, or a discontinuity. Any idea of how to make the cuboid with material number 4 a continuous part of the static fluid of the bigger cuboid of material number one?