how to decrease desired cell temperature constantly

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()')]

Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
 Revision history for this message Robert Caulk (rcaulk) said on 2021-07-15: #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 on 2021-07-15: #2

Line edit:

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

 Revision history for this message Robert Caulk (rcaulk) said on 2021-07-16: #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].

 Revision history for this message Robert Caulk (rcaulk) said on 2021-07-16: #4

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

 Revision history for this message ibraheem khan (ibraheem-22) said on 2021-07-16: #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 on 2021-07-16: #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 on 2021-07-16: #7

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