CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

How to code Strang splitting ?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2020, 14:41
Default How to code Strang splitting ?
  #1
Member
 
Join Date: Mar 2019
Posts: 37
Rep Power: 2
celestial is on a distinguished road
Best wishes to all in this new year


I couldn't find how to do this in openFoam and all of its variants.

Strang splitting means

df/dt = T + S

becomes

df/dt = S
df/dt = T
df/dt = S

T stands for convective and diffusive terms whereas S stands for a source term. Also the original dt for the derivative numerical scheme is halved for both df/dt = S in the above



I think what should be done for two fields f1 and f2 is as follows. (S1 and S2 may depend non linearly on both f1 and f2)


....


delT = runTime.deltaT().value();


runTime.deltaT().value() = delT/2.;


solve
(
fvm::ddt(f1) == T1
) ;


solve
(
fvm::ddt(f2) == T2
) ;


runTime.deltaT().value() = delT;


solve
(
fvm::ddt(f1) == S1
) ;


solve
(
fvm::ddt(f2) == S2
) ;



runTime.deltaT().value() = delT/2;


solve
(
fvm::ddt(f1) == T1
) ;


solve
(
fvm::ddt(f2) == T2
) ;


runTime.deltaT().value() = delT;

....

Is anything wrong with my approach ? Any reply welcome
celestial is offline   Reply With Quote

Old   January 13, 2020, 15:28
Default
  #2
Member
 
Join Date: Mar 2019
Posts: 37
Rep Power: 2
celestial is on a distinguished road
Well, Im going to give you a first clue


you cannot set it this way

doubleScalar delT = runTime.deltaT().value();

runTime.deltaT().value() = delt/2;

I checked using Info that the original value isnt changed.

Instead, you have to write

runTime.setDeltaT
(
delT/2.
);


I will keep you posted after I study more about these time objects
celestial is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFD code layout plasmaCode Main CFD Forum 3 December 12, 2015 23:10
The FOAM Documentation Project - SHUT-DOWN holger_marschall OpenFOAM 242 March 7, 2013 13:30
How to make code run in parallel? cwang5 OpenFOAM Programming & Development 1 May 30, 2011 05:47
Open Source Vs Commercial Software MechE OpenFOAM 28 May 16, 2011 12:02
Small 3-D code Zdravko Stojanovic Main CFD Forum 2 July 19, 2010 11:11


All times are GMT -4. The time now is 01:48.