Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Cyclic Boundary Condition

Please login with a confirmed email address before reporting spam

Hi,

I have porous pipe flow with temp and velocity at inlet and pressure and heat outflow at exit.

I am doing a time dependent analysis and after say 30 min, I would like to reverse the boundary conditions.

This process needs to be done continuously until a quasi static state is reached. However I am only able to achieve this manually by changing the BC after every run.

Is is possible to automate this process? Any help is greatly appreciated.

Thanks.

Shriram R

2 Replies Last Post 24.08.2011, 15:10 GMT-4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 22.08.2011, 01:50 GMT-4
Hi

have you tried to combine a parametric sweep with a transient, and use your "Parameter" to switch the BC's, you might need to fiddle the equations of the BC's or make you own "switchable" but I believe that should work nicely

--
Good luck
Ivar
Hi have you tried to combine a parametric sweep with a transient, and use your "Parameter" to switch the BC's, you might need to fiddle the equations of the BC's or make you own "switchable" but I believe that should work nicely -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 24.08.2011, 15:10 GMT-4
Hi Ivar,

Thank you very much for your input.

However I couldn't get it to work using parametric study, but I have been able to modify the matlab code and set up a loop to continuously change the boundary condition back and forth.

Now I just have 1 question. As you can see I am doing a time dependent analysis upto 1800 s.

But I want to use the last time step of solver 1 (sol1) as initial condition for solver 2 (sol2). However I can't see how the last time step of solver 1 at 1800 s can be specified, as from the code I am unable to see this.

Thank you.

Shriram

.
.
.
.
.

model.sol('sol1').runAll;
model.sol('sol2').feature('st1').name('Compile Equations: Time Dependent 1');
model.sol('sol2').feature('st1').set('studystep', 'time1');
model.sol('sol2').feature('v1').set('control', 'time1');
model.sol('sol2').feature('v1').set('initmethod', 'sol');
model.sol('sol2').feature('v1').set('initsol', 'sol1');
model.sol('sol2').feature('t1').set('control', 'time1');
model.sol('sol2').feature('t1').set('tlist', '0 1 2 5 10 18 25 50 100 300 600 900 1200 1500 1800');
model.sol('sol2').feature('t1').set('maxorder', '2');
model.sol('sol2').feature('t1').feature('fc1').set('maxiter', '5');
model.sol('sol2').feature('t1').feature('fc1').set('jtech', 'once');
model.sol('sol2').runAll;
Hi Ivar, Thank you very much for your input. However I couldn't get it to work using parametric study, but I have been able to modify the matlab code and set up a loop to continuously change the boundary condition back and forth. Now I just have 1 question. As you can see I am doing a time dependent analysis upto 1800 s. But I want to use the last time step of solver 1 (sol1) as initial condition for solver 2 (sol2). However I can't see how the last time step of solver 1 at 1800 s can be specified, as from the code I am unable to see this. Thank you. Shriram . . . . . model.sol('sol1').runAll; model.sol('sol2').feature('st1').name('Compile Equations: Time Dependent 1'); model.sol('sol2').feature('st1').set('studystep', 'time1'); model.sol('sol2').feature('v1').set('control', 'time1'); model.sol('sol2').feature('v1').set('initmethod', 'sol'); model.sol('sol2').feature('v1').set('initsol', 'sol1'); model.sol('sol2').feature('t1').set('control', 'time1'); model.sol('sol2').feature('t1').set('tlist', '0 1 2 5 10 18 25 50 100 300 600 900 1200 1500 1800'); model.sol('sol2').feature('t1').set('maxorder', '2'); model.sol('sol2').feature('t1').feature('fc1').set('maxiter', '5'); model.sol('sol2').feature('t1').feature('fc1').set('jtech', 'once'); model.sol('sol2').runAll;

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.