[Nek5000-users] perturbing interior variables
nek5000-users at lists.mcs.anl.gov
nek5000-users at lists.mcs.anl.gov
Tue May 11 17:14:28 CDT 2010
Hi Frank,
Yes - any function that is supposed to be continuous should be
so at timestep 0, else there will be problems.
For the Pn-Pn-2 formulation, pressure is discontinuous, so there
is no issue for pressure in this case.
However, one would call dsavg for vx, vy,vz and T ---
This is already done in ic.f following standard initialization
procedures.
It likely wouldn't need to be done if you range strictly over
the element interiors, i,j,k \in [2,...,nx1]^3 --- but it
wouldn't hurt in any case.
Paul
On Tue, 11 May 2010, nek5000-users at lists.mcs.anl.gov wrote:
> Hi Paul,
I'm not quite sure what you mean here, am assuming you have in mind
continuous across element boundaries. At present, some simulations are
running where at a certain time, the temperature field is perturbed as
in the code segment below. Would the absence of "dsavg" cause a problem
regardless of whether one loops from "k=2,nz1-1" or "k=1,nz1" etc.?
Also, is "dsavg" needed when dealing with velocity?
Cheers,
Frank
if(time>1. .and. time<= 1.+2.5*dt)then
write(*,*)'Symmetry breaking'
vmax=.01 ; tmax=.99 ; radius=1.5 ; radius_s=.25
nlocations_perturbed=3
do 100 iel=1,nelv
do 100 k=2,nz1-1
do 100 j=2,ny1-1
do 100 i=2,nx1-1
do n=1,nlocations_perturbed
angle = acos(-1.)*2.*(n-1.)/nlocations_perturbed
x1=radius*cos(angle) ; y1=radius*sin(angle)
if(((xm1(i,j,k,iel)-x1)**2
& + (ym1(i,j,k,iel)-y1)**2
& + (zm1(i,j,k,iel)-.45)**2)**.5.le.radius_s)then
t(i,j,k,iel,1)=tmax*t(i,j,k,iel,1)
endif
enddo !n
100 continue
endif !time>1. .and. time<= 1.+2.*dt
On Tue, 2010-05-11 at 07:38 -0500, nek5000-users at lists.mcs.anl.gov
wrote:
> Hi Frank,
>
> One additional note.
>
> It's important that your perturbed T() be continuous.
>
> This could be done, e.g., via the following code in userchk
>
> if (istep.eq.0) then
> n=nx1*ny1*nz1*nelt
> do i=1,n
> t(i,1,1,1,1) = t(i,1,1,1,1) + perturbation of choice
> enddo
> call dsavg(t)
> endif
>
> The dsavg() will ensure that T is continuous. If T is not
> continuous at the beginning, it will be discontinous forever
> since we only solve for delta T and then add this to T.
>
>
> Paul
>
>
> On Tue, 11 May 2010, nek5000-users at lists.mcs.anl.gov wrote:
>
> >
> >
> > Hi Frank,
> >
> > Boundary values will be set by userbc().
> >
> > There is no opportunity to intercede between userbc() being called
> > and the solver. (In effect, userbc() _is_ the opportunity to
> > intercede.)
> >
> > userchk is called at the end of each step and therefore effectively
> > at the beginning of the next. Perturbing there will work - you can
> > perturb all values and rest assured that values on Dirichlet surfaces
> > will be overwritten by userbc. Values on Neumann surfaces, however,
> > would not be reset by userbc.
> >
> > hth,
> >
> > Paul
> >
> > On Tue, 11 May 2010, nek5000-users at lists.mcs.anl.gov wrote:
> >
> >> Thanks for the replies, Aleks and Stefan. I am still not clear on one
> > point though. Are changes made to temperature or velocity on boundaries
> > in "userchk" at each time step irrelevant since they are overwritten by
> > calls to "userbc"?
> >
> > Cheers,
> > Frank
> >
> >
> > On Mon, 2010-05-10 at 18:15 +0200, nek5000-users at lists.mcs.anl.gov
> > wrote:
> >> The heat solver calls BCDIRSC which will apply Dirichlet bcs. All 't '
> >> boundary points call userbc so you have the full control over the values at
> >> the boundary.
> >>
> >> Stefan
> >>
> >>
> >>
> >>
> >> On May 10, 2010, at 6:00 PM, nek5000-users at lists.mcs.anl.gov wrote:
> >>
> >> > Hi Frank,
> >> > > > I assume that you refer to t(i,j,k,iel) as temperature -- to be safe
> >> it should be t(i,j,k,iel,1)...
> >> > > > In timestepping loop, subroutine userchk is called last by one --
> >> right before the last one -- prepost which dumps field files .f or .fld --
> >> see nek5_svn/trunk/nek/drive1.f:
> >> > > DO ISTEP=1,NSTEPS
> >> > call nek_advance
> >> > call userchk
> >> > call prepost (.false.,'his')
> >> > if (lastep .eq. 1) goto 1001B
> >> > ENDDO
> >> > > while, as I can see, userbc for a passive scalar is called from a chain
> >> of subroutines nek_advance > heat > cdscal > BCNEUSC/BCDIRSC
> >> > > This means that perturbation of temperature at the boundary won't be
> >> overwritten in userbc.
> >> > > > One way to apply perturbation everywhere including the element faces
> >> that are not on the boundary of your domain is simply to multiply your
> >> perturbation factor by a function that goes to zero on the boundaries,
> >> e.g.:
> >> > > t(i,j,k,iel,1)=.99*t(i,j,k,iel,1)*(xm1(i,j,k,iel)**2.-1.)
> >> > > in case the boundary surface plane is at x=1 & x=-1
> >> > > Best,
> >> > Aleks
> >> > > > > > > > On Mon, 10 May 2010, nek5000-users at lists.mcs.anl.gov wrote:
> >> > >> Hello all,
> >> > > I am trying to perturb the temperature in a small part of the flow.
> >> > However, I only wish to perturb in the interior and not on a boundary.
> >> > I have the following in "userchk". If I instead looped from "k=1,nz1"
> >> > instead of "k=2,nz1-1", would this change the BC's? The general
> >> > question would be, does changing uvw & T in "userchk" change BC's or
> >> > does "userbc" override what is done in "userchk"?
> >> > > Cheers,
> >> > Frank
> >> > > do 100 iel=1,nelv
> >> > do 100 k=2,nz1-1
> >> > do 100 j=2,ny1-1
> >> > do 100 i=2,nx1-1
> >> > if(((xm1(i,j,k,iel)-1.1)**2
> >> > & + (ym1(i,j,k,iel)-1.1)**2
> >> > & + (zm1(i,j,k,iel)-.45)**2)**.5.le..25)then
> >> > t(i,j,k,iel)=.99*t(i,j,k,iel)
> >> > endif
> >> > enddo !n
> >> > 100 continue
> >> > > > > > -- > Frank Herbert Muldoon, Ph.D. Mechanical Engineering
> >> > Technische Universität Wien (Technical University of Vienna)
> >> > Inst. f. Strömungsmechanik und Wärmeübertragung (Institute of Fluid
> >> > Mechanics and Heat Transfer)
> >> > Resselgasse 3
> >> > 1040 Wien
> >> > Tel: +4315880132232
> >> > Fax: +4315880132299 Cell:+436765203470
> >> > fmuldoo (skype)
> >> >
> >> http://tetra.fluid.tuwien.ac.at/fmuldoo/public_html/webpage/frank-muldoon.html
> >> > > _______________________________________________
> >> > Nek5000-users mailing list
> >> > Nek5000-users at lists.mcs.anl.gov
> >> >
> >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users_______________________________________________
> >> > Nek5000-users mailing list
> >> > Nek5000-users at lists.mcs.anl.gov
> >> > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
> >>
> >> _______________________________________________
> >> Nek5000-users mailing list
> >> Nek5000-users at lists.mcs.anl.gov
> >> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
> > --
> > Frank Herbert Muldoon, Ph.D. Mechanical Engineering
> > Technische Universität Wien (Technical University of Vienna)
> > Inst. f. Strömungsmechanik und Wärmeübertragung (Institute of Fluid
> > Mechanics and Heat Transfer)
> > Resselgasse 3
> > 1040 Wien
> > Tel: +4315880132232
> > Fax: +4315880132299 Cell:+436765203470
> > fmuldoo (skype)
> > http://tetra.fluid.tuwien.ac.at/fmuldoo/public_html/webpage/frank-muldoon.html
> >
> > _______________________________________________
> > Nek5000-users mailing list
> > Nek5000-users at lists.mcs.anl.gov
> > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
> _______________________________________________ Nek5000-users mailing list Nek5000-users at lists.mcs.anl.gov https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
--
Frank Herbert Muldoon, Ph.D. Mechanical Engineering
Technische Universität Wien (Technical University of Vienna)
Inst. f. Strömungsmechanik und Wärmeübertragung (Institute of Fluid
Mechanics and Heat Transfer)
Resselgasse 3
1040 Wien
Tel: +4315880132232
Fax: +4315880132299
Cell:+436765203470
fmuldoo (skype)
http://tetra.fluid.tuwien.ac.at/fmuldoo/public_html/webpage/frank-muldoon.html
_______________________________________________
Nek5000-users mailing list
Nek5000-users at lists.mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
More information about the Nek5000-users
mailing list