Skip to content

Re: Geometry – Example “MultiComponentXd”

#2394
ivan
Member

Hello, everybody,rnrnInitially, I just wanted to change its length, for which I thought of editing the number of horizontal nodes nx.rnrn

Code:
[quote]// Parameters for the simulation setuprnconst int nx = 400;rnconst int ny = 200;rnconst int maxIter = 20000;[/quote]

rnrnOnce nx was changed from 400 to 30 I got a simulation in which the fluids don’t move, so I decided to analyse the material numbers to understand the reason of it. Above there is the original code and a few pictures for showing what I understood from it so far (which I assume is wrong).rnrn

Code:
[quote]rn // Sets material number for fluid and boundaryrn superGeometry.rename(0,1);rnrn std::vector<T> origin1(2,T());rn origin1[0] = -2.;rn origin1[1] = -2.;rn std::vector<T> origin2(2,T());rn origin2[0] = -2.;rn origin2[1] = ny/2.;rn std::vector<T> origin3(2,T());rn origin3[0] = -2.;rn origin3[1] = ny-1.;rnrn std::vector<T> extend1(2,T());rn extend1[0] = nx+3.;rn extend1[1] = 2.;rn std::vector<T> extend2(2,T());rn extend2[0] = nx+3.;rn extend2[1] = ny/2.+2.;rnrn IndicatorCuboid2D<T> bottom(extend1, origin1);rn IndicatorCuboid2D<T> upper(extend2, origin2);rn IndicatorCuboid2D<T> top(extend1, origin3);rnrn superGeometry.rename(1,2,upper);rn superGeometry.rename(1,3,bottom);rn superGeometry.rename(2,4,top);[/quote]

rnrnObservation: Instead of 400×200, I used 40×20 cells for the representation just to make it simpler, but I am still talking about the original dimensions. rnrnInitially, we have 40×20 nodes, represented by the yellow cells, which material numbers were renamed from 0 to 1rnrn[img]https://postimg.org/image/hlzuqgiip/[/img]rnrnIt was inserted a Cuboid called Bottom, represented by the orange cellsrnrn[img]https://postimg.org/image/lweim1nlt/[/img]rnrnThe Upper Cuboid was inserted and its represented by the green cellsrnrn[img]https://postimg.org/image/so4xowcld/[/img]rnrnThe Top Cuboid was inserted and its represented by the blue cellsrnrn[img]https://postimg.org/image/60poiqx1d/[/img]rnrnThe material numbers were changed according to the following imagesrnrn[img]https://postimg.org/image/md4bm80qp/[/img]rnrn[img]https://postimg.org/image/sfbycpp6p/[/img]rnrn[img]https://postimg.org/image/5rwp6k9mp/[/img]rnrnrnIf I understood correctly, changing nx from 400 to 30 would not change the interactions between the fluids/the simulation itself, since the horizontal dimension of the the cuboids are given in function of it (nx). Then why doesn’t it work?rnrnExtra questionsrnrnWhen a 400×200 nodes Lattice is set, what does it mean to have something like “”origin1[0]=-2″”? Does it mean this node is two nodes left distant the first one (which I assume is on the left bottom of the lattice)?rnrnIf so, why was used -2 instead of -1 or 0? And why nx+3 instead of nx-origin (in this example, nx+2)?Why do we need those extra nodes before and after the lattice which don not seem to be part of it?rnrnI hope I have made myself clear enough ( I assume there must be a couple mistakes with the vocabulary ) for you guys to understand my point.rnrnBest regards,rnrnIvanrnrnrn