I am continuing to have trouble with a variable flux condition based on the phase variable value. For example, the right boundary the depends the phase variable in such a way:
BCs = (FixedFlux(mesh.getFacesRight(), value=pow(var.getFaceValue[mesh.getFacesRight().getValue()],0.5)*pow(1-var.getFaceValue[mesh.getFacesRight().getValue()],0.5) However, I receive a shape mismatch error: ValueError: shape mismatch: objects cannot be broadcast to a single shape I thought that only those phase values on the right side should be used to determine a right handed fixed flux. Thanks for your reply, -- Michael Johnston 812-290-1578 Purdue University Materials Science Engineering [email protected] Quoting Jonathan Guyer <[email protected]>: > > > On Feb 3, 2010, at 5:29 PM, Michael Johnston wrote: > > > > > phaseField.getFaceValue() will return the value of all the values of > > the > > phasefield. I am trying to assign the value of each cell unit a > > flux that is > > dependent on the value of the phase variable at that particular cell. > > mesh.getFacesLeft() returns a mask which True on the leftmost faces > and False everywhere else, thus, although phaseField.getFaceValue() > returns all of the face values, only those filtered by the face mask > will be used. > > > phaseField.getFaceValue() will return the value of all the values of the phasefield. I am trying to assign the value of each cell unit a flux that is dependent on the value of the phase variable at that particular cell. For a square mesh, if the left side has a phasefield value = 0, the flux will be zero for that specific cell. Or if the right side has a phasefield value =1 the flux will be 1 for that specific cell. The flux for each cell unit is updated for each time step. -- Michael Johnston 812-290-1578 Purdue University Materials Science Engineering [email protected] Quoting Daniel Wheeler <[email protected]>: > > Hi Michael, > > I belive that if the "value" argument is a FaceVariable then it will > work. So try something like this: > > BCs = [FixedFlux(faces=mesh.getExteriorFace(), value=constant * > phaseField.getFaceValue()), ... ] > > Cheers > > On Mon, Feb 1, 2010 at 4:33 PM, Michael Johnston <[email protected]> > wrote: > > > > I am looking to make a variable flux on the exterior faces of a > Cahn-Hilliard 2D > > mesh. What is the proper way to update the FixedFlux as a function of the > > exterior phase field variables of an imported mesh? > > Var=phase field values > > N=constant*Var (at the exterior faces) > > BCs = (FixedFlux(mesh.getExteriorFace(), N) > > > > If you need more information please let me know, and I appreciate any help > you > > can give me. > > > > Thanks, > > -- > > Michael Johnston > > 812-290-1578 > > Purdue University > > Materials Science Engineering > > [email protected] > > > > > > > > > > > > > > -- > Daniel Wheeler > >
