How to modify source term

25 views
Skip to first unread message

Kadir Çar

unread,
Oct 18, 2024, 5:11:05 AM10/18/24
to claw-...@googlegroups.com
I have a special conservation law model which is of the form of balance law(it includes some nonlinear source terms)  in 1D. I would like to know where I can modify the source term by using finite volume method. (There are examples using ODE/ implicit euler method but thats not useful for us).

p.s. my source term doesn't include partial derivative terms, we have only nonlinear terms


David Ketcheson

unread,
Oct 18, 2024, 1:07:54 PM10/18/24
to claw-users
I'm not sure what you mean by "where I can modify the source term".  But for PyClaw source term implementation is discussed here, with a link to an example: https://www.clawpack.org/pyclaw/problem.html#adding-source-terms.

Kadir Çar

unread,
Oct 18, 2024, 6:50:44 PM10/18/24
to claw-...@googlegroups.com
Thanks for your reply, I have tried to edit the source terms in the src1.f file but the problem is, as I have said earlier I couldn't find any nonlinear source term in any examples or in any documentation. I am trying to handle that problem. 

David Ketcheson <dke...@gmail.com>, 18 Eki 2024 Cum, 20:07 tarihinde şunu yazdı:
--
You received this message because you are subscribed to the Google Groups "claw-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to claw-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/claw-users/6a2ce15a-c1b6-4c96-9384-d297af4d386en%40googlegroups.com.

David Ketcheson

unread,
Oct 19, 2024, 2:58:15 AM10/19/24
to claw-users
It's always helpful to specify which package you are using.  The documentation I linked is for PyClaw but it sounds like you are using one of the other packages.  There is an example for instance in 

clawpack/classic/examples/acoustics_2d_radial/1drad/

You say that "my source term doesn't include partial derivative terms", in which case your source term is an ODE.  So I don't understand why you say ODE source term examples aren't useful.  I think you'll need to provide more clear information to get more help.

Randall J LeVeque

unread,
Oct 19, 2024, 2:26:05 PM10/19/24
to claw-...@googlegroups.com
To clarify why it's an ODE being solved, the fractional step approach taken in Clawpack is to split
  q_t + f(q)_x = psi(q)
into a step with the homogeneous conservation law
   q_t + f(q)_x =0
followed by a step with the ODE
   q_t = psi(q)
and src1.f90 generally solves the second equation in each grid cell, updating Q by dt * f(Q), for example, if Forward Euler is being used.

For more details you might see Chapter 17 of the book FVMHP or the slides fvmhp23_splitting.pdf for Lecture 23 that can be found in

The example David pointed to implements the geometric source term given in equation (18.54) of the book, for solving the radially symmetric acoustics equations.

There's also a simple example at
for a traffice flow example from the book.

 - Randy


Reply all
Reply to author
Forward
0 new messages