Can't you have a conditional in the loop that changes the given boundary
condition tuple that is passed based on the elapsed time?

On Thu, Jul 5, 2012 at 10:43 AM, Kendall Boniface <
[email protected]> wrote:

> Hello again,
>
> I am wondering if anyone knows of a way to change boundary conditions
> midway through the transient solving process?
>
> I would like to go from something like this:
>
> outerFlux = 0
> innerTempUpper = 650.
> innerTempLower = 550.
> BCs = (FixedFlux(faces = mesh.getFacesRight(), value = outerFlux),\
>        FixedValue(faces = mesh.getFacesLeft(), value = innerTempLower),)
>
> To something like this. But I only want this to happen once a steady state
> has been reached with the first set of BCs
>
> x, y = mesh.getFaceCenters()
> facesUpper = (mesh.getFacesLeft() & (y > L/2))
> facesLower = (mesh.getFacesLeft() & (y < L/2))
> BCs = (FixedValue(faces = facesUpper, value = innerTempUpper), \
>        FixedValue(faces = facesLower, value = innerTempLower), \
>        FixedFlux(faces = mesh.getFacesRight(), value = outerFlux),)
>
> eq = TransientTerm() == DiffusionTerm(coeff = therm_cond) + heat_gen
>
> elapsedTime = 0
> totalElapsedTime = 50
> timeStep = 0.01
> desiredResidual = 0.01
>
> if __name__ == '__main__':
>     temp_viewer = Viewer(vars = temp, ymin = 0.1, ymax = 0.101,
> colorbar='horizontal')
>
> while elapsedTime < totalElapsedTime:
>     temp.updateOld()
>     residual = 1e100
>     while residual > desiredResidual:
>         residual = eq.sweep(var = temp, boundaryConditions = BCs, dt =
> timeStep)
>     elapsedTime += timeStep
>
>     if __name__ == '__main__':
>         temp_viewer.plot()
>
>
> I just can't seem to figure out how to implement that within my solver.
> Can anyone suggest a way to do this?
>
> Thank you in advance :)
> Kendall
>
>
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>
>


-- 
Daniel Wheeler
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to