how to decrease desired cell temperature constantly

Asked by ibraheem khan

Hi all
 I am working on a script using Thermo-hydro -mechanical coupling (1) with modified boundary conditions for hydraulic fracture process in EGS using JCFpm BPM.
 I want to apply a lower temperature in the center cell of sample . I have done it using PyRunner (as shown below) which act as a thermal shocking.I want to bring down center cell Temperature constantly to desired temperature. How I can achieve it?

def centerCellTemp():

        centerCellId=flow.getCell(.5,.5,.5)
        bcenterCellTemperature=flow.setCellTemperature(centerCellId, 303.15)
O.engines=O.engines+[PyRunner(iterPeriod=20,command ='centerCellTemp()')]

1.https://gitlab.com/yade-dev/trunk/-/blob/990dda83e2558b7d244f52476f07742ce6b44176/examples/ThermalEngine/thermoHydroMechanical_coupling.py
Thanks in advance

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

Hey Ibraheem,

You can make centerCellTemp() a function of O.iter:

def centerCellTemp():
        centerCellId=flow.getCell(.5,.5,.5)
        bcenterCellTemperature=flow.setCellTemperature(centerCellId, linearFunction(O.ter))

def linearFunction(x):
        m = slope # change of degrees/iteration
        b = yIntercept # degrees @ iteration 0
        return m*x+b

O.engines=O.engines+[PyRunner(iterPeriod=20,command ='centerCellTemp()')]

The PyRunner is executed once per iteration, which means the function centerCellTemp() will execute once per iteration too. Your values for slope and yIntercept depend on the shape of the linear function you want to set.

Cheers,

Robert

Revision history for this message
Robert Caulk (rcaulk) said :
#2

Line edit:

** bcenterCellTemperature=flow.setCellTemperature(centerCellId, linearFunction(O.iter))

Revision history for this message
Robert Caulk (rcaulk) said :
#3

Don't forget that at some point in your script, at least once, you need to set that same sell to have a Tcondition [1].

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.State.Tcondition

Revision history for this message
Robert Caulk (rcaulk) said :
#4

Sorry that is for particles, to make a cell boundary condition you need to use [1].

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine.setCellTImposed

Revision history for this message
ibraheem khan (ibraheem-22) said :
#5

Thanks Robert
it works now

def centerCellTemp():
        centerCellId=flow.getCell(.5,.5,.5)
        cellBoundaryCondition=flow.setCellTImposed(centerCellId, 303.15)
        centerCellTemperature=flow.setCellTemperature(centerCellId, linearFunction(O.iter))

def linearFunction(x):
    m = -.01 # change of degrees/iteration
    b = 523.15 # degrees @ iteration 0
    y=m*x+b
    return (y)
O.engines=O.engines+[PyRunner(iterPeriod=20,command ='centerCellTemp()')]
\
 but i have an issue , my cell temperature decrease below my desired vale i imposed .
i want cell temperature to be 303.15 but it goes up to -860.15
how can i control it?

Revision history for this message
Robert Caulk (rcaulk) said :
#6

Hey Ibraheem,

>flow.setCellTImposed(centerCellId, 303.15)

The second argument should be a boolean (true or false), not a float. If using True for that argument does not work, there may be a bug in the code.

>i want cell temperature to be 303.15 but it goes up to -860.15

Well I guess this depends on the shape of your linearFunction() and how many iterations you are running. How many iterations are you running to see -860.15 degrees?

Revision history for this message
ibraheem khan (ibraheem-22) said :
#7

bundle of thanks Robert
I adjust Number of Iteration and shape function values , Now i am getting correct result.

Can you help with this problem?

Provide an answer of your own, or ask ibraheem khan for more information if necessary.

To post a message you must log in.