# Plugin source term with rho, u,v

**URL:** <https://pyfr.discourse.group/t/plugin-source-term-with-rho-u-v/825>\
**Category:** Cases\
**Tags:** config\
**Created:** [8 June 2023 15:59 UTC](https://pyfr.discourse.group/t/plugin-source-term-with-rho-u-v/825 "2023-06-08T15:59:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)\
**Post date:** [8 June 2023 15:59 UTC](https://pyfr.discourse.group/t/plugin-source-term-with-rho-u-v/825/1 "2023-06-08T15:59:50Z")

</div>

Hello,  
I want to add rho, u, v, w in source term pluign, could someone give me some tips?

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [8 June 2023 17:11 UTC](https://pyfr.discourse.group/t/plugin-source-term-with-rho-u-v/825/2 "2023-06-08T17:11:34Z")

</div>

What do you mean?

Source terms can already be solution dependent.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)\
**Post date:** [9 June 2023 08:20 UTC](https://pyfr.discourse.group/t/plugin-source-term-with-rho-u-v/825/4 "2023-06-09T08:20:25Z")

</div>

I used this term in source term,

```auto
E = 0.03/(pi*0.17* 0.01)*exp(-(x-2.5)/0.17-y/0.01)* (-0.99984769)*u+0.03/(pi* 0.17*0.01)*exp(-(x-2.5)/0.17-y/0.01)* (0.017452406)*v

```

but the error comes:

```auto
tmp.c:49:544: error:"v' undeclared (first use in this function)

```

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [9 June 2023 11:35 UTC](https://pyfr.discourse.group/t/plugin-source-term-with-rho-u-v/825/5 "2023-06-09T11:35:59Z")

</div>

The source terms are specified in terms of the conserved variables. So, for the compressible solver the variable you want is `rhou/rho`.

Regards, Freddie.
