CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   Question: Clever way to calculate a varying MFR to make a plot (http://www.cfd-online.com/Forums/cfx/94835-question-clever-way-calculate-varying-mfr-make-plot.html)

 Omerta November 28, 2011 02:13

Question: Clever way to calculate a varying MFR to make a plot

New to the forum and searched but didn't find what I was looking for.

I'm making a Head vs Volumetric Flow rate plot for a radial pump, but I don't want to manually run and solve CFX for a range of output values... there must be a smarter way to go about it.

The variable to change between runs is my outlet mass flow rate.

I have Ansys V13 and I am using Workbench...

Anyhelp is much appreciated.

 Omerta November 28, 2011 02:53

Could I make it a transient problem and vary the MFR? Would that work? I've only indulged in SS so far.

Edit: nope doesnt seem to

 singer1812 November 28, 2011 11:08

The BC conditions can be a CEL function. For example, if you are running that in SS, use some like the following:

MF=1 [kg s^-1]*1[kg s^-1]*(step(citern-100.5)+step(citern-200.5)+step(citern-300.5))

This will set MF to 1 for 100 iterations, then add 1 (so a total of 2) for iteration 101-200, and then add 1 more (so total of 3) for the rest of the iterations that you are running for.

Just adjust the step fucntions mass flows and such to meet your needs. You can get pretty fancy with the BCs, just make sure you aren't making too drastic of a change or the run might diverge depending on your model.

 Omerta November 28, 2011 14:23

How would I save the results for each set of iterations? Or could I make that plot within the solver itself using monitors? I feel like that would be inaccurate until it converges

 singer1812 November 28, 2011 14:27

You can monitor the values you are interested in, plus you can setup a backup file at each of the increase points so that you will have a result file for each condition.

You have to make the judge as to when your SS run is converged. In cases that I run, I typically know about how many iterations it takes to reach SS values for the variables I am interested in and set the update to something somewhat larger than that.

If you use full backup files, you can restart a simulation for the case you want with the right backup and run it out a bit longer should it need more iterations.

 Omerta November 28, 2011 14:31

hmm, I'll give that a shot.

For a transient solution... is there anyway I could set the initial boundary condition to be 1 kg/s then have it increase to 20 kg/s over 10 seconds? Is it possible to do that in CFX?

Seems like it should be a capability?

 singer1812 November 28, 2011 14:34

All of that is possible.

Look up the variable citern in the CFX help. You will find many other varibles that you can use that relate to SS and transient runs, restarted and fresh started.

CITERN is just the current run iteration. Total iterations can be access, time can be access, etc...

 Omerta November 28, 2011 15:25

1 Attachment(s)
Looking into that.

Side note:

Under initialization, I cannot input initial values for anything transient for BC's? Am I looking in the wrong place?

 singer1812 November 28, 2011 15:28

Double click it?

 Omerta November 28, 2011 15:31

1 Attachment(s)
Nothing specific to transient IC's here

 singer1812 November 28, 2011 15:32

You have your simulation set to SS?

 Omerta November 28, 2011 15:35

1 Attachment(s)
No, its transient

 singer1812 November 28, 2011 15:38

Ohh, I see it now. Change the Automatic to something else in those drop downs under the previous image you showed me.

 Omerta November 28, 2011 16:16

oh, figured it would be more detailed than that.

I can run it fine in SS but when I shifted it to transient I'm getting these errors now.

----------------------------------------------------------------------
COEFFICIENT LOOP ITERATION = 7 CPU SECONDS = 1.334E+01
----------------------------------------------------------------------
| Equation | Rate | RMS Res | Max Res | Linear Solution |
+----------------------+------+---------+---------+------------------+
| U-Mom | 9.24 | 1.5E-03 | 2.9E-02 | 1.1E-03 OK|
| V-Mom | 7.51 | 1.5E-03 | 4.1E-02 | 1.0E-03 OK|
| W-Mom |35.19 | 4.9E-03 | 8.2E-02 | 2.9E-04 OK|
| P-Mass |99.99 | 7.5E-05 | 1.8E-03 | 15.2 6.2E-02 OK|
+----------------------+------+---------+---------+------------------+
+--------------------------------------------------------------------+
| ****** Notice ****** |
| A wall has been placed at portion(s) of an INLET |
| boundary condition (at 57.1% of the faces, 78.8% of the area) |
| to prevent fluid from flowing out of the domain. |
| The boundary condition name is: R1 Inlet. |
| The fluid name is: Water. |
| If this situation persists, consider switching |
| to an Opening type boundary condition instead. |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| ****** Notice ****** |
| A wall has been placed at portion(s) of an OUTLET |
| boundary condition (at 59.8% of the faces, 30.9% of the area) |
| to prevent fluid from flowing into the domain. |
| The boundary condition name is: R1 Outlet. |
| The fluid name is: Water. |
| If this situation persists, consider switching |
| to an Opening type boundary condition instead. |
+--------------------------------------------------------------------+
| K-TurbKE |43.25 | 6.0E-01 | 2.3E+00 | 6.4 2.6E-08 OK|
| E-Diss.K |50.77 | 5.5E-01 | 2.4E+00 |100.8 2.6E-08 OK|
+----------------------+------+---------+---------+------------------+
----------------------------------------------------------------------
COEFFICIENT LOOP ITERATION = 8 CPU SECONDS = 1.555E+01
----------------------------------------------------------------------
| Equation | Rate | RMS Res | Max Res | Linear Solution |
+----------------------+------+---------+---------+------------------+
| U-Mom |10.21 | 1.6E-02 | 3.4E-01 | 1.6E-02 OK|
| V-Mom |10.99 | 1.7E-02 | 2.8E-01 | 2.6E-02 OK|
| W-Mom | 4.89 | 2.4E-02 | 4.9E-01 | 2.2E-02 OK|
| P-Mass |99.99 | 1.4E-02 | 6.0E-01 | 10.5 8.6E-02 OK|
+----------------------+------+---------+---------+------------------+
+--------------------------------------------------------------------+
| ****** Notice ****** |
| A wall has been placed at portion(s) of an INLET |
| boundary condition (at 57.1% of the faces, 78.8% of the area) |
| to prevent fluid from flowing out of the domain. |
| The boundary condition name is: R1 Inlet. |
| The fluid name is: Water. |
| If this situation persists, consider switching |
| to an Opening type boundary condition instead. |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| ****** Notice ****** |
| A wall has been placed at portion(s) of an OUTLET |
| boundary condition (at 58.7% of the faces, 27.7% of the area) |
| to prevent fluid from flowing into the domain. |
| The boundary condition name is: R1 Outlet. |
| The fluid name is: Water. |
| If this situation persists, consider switching |
| to an Opening type boundary condition instead. |
+--------------------------------------------------------------------+

+--------------------------------------------------------------------+
| ERROR #001100279 has occurred in subroutine ErrAction. |
| Message: |
| Floating point exception: Overflow |
| |
| |
| |
| |
| |
+--------------------------------------------------------------------+

+--------------------------------------------------------------------+
| ERROR #001100279 has occurred in subroutine ErrAction. |
| Message: |
| Stopped in routine FPX: C_FPX_HANDLER |
| |
| |
| |
| |
| |
+--------------------------------------------------------------------+

+--------------------------------------------------------------------+
| An error has occurred in cfx5solve: |
| |
| The ANSYS CFX solver exited with return code 1. No results file |
| has been created. |
+--------------------------------------------------------------------+

 Omerta November 28, 2011 17:10

Fixed it by boosting my initial MFR in my expression. I just did a simple step function.

 Omerta November 28, 2011 18:29

How do I access the other timesteps that are calculated? Its only showing my final in POST

 ghorrocks November 29, 2011 07:22

You have to include other time steps in the results file when you set the simulation up for them to be available.

 Omerta November 29, 2011 13:40

Got it, thanks.

I have 21 results now with varying MFR... Do I need to make a script or something to extract the head / MFR from each timestep to create a plot?

Giving sequence chart a try now...

 ghorrocks November 29, 2011 17:20

If you set them up as monitor points you would get the graphs as the run proceeds. If not then you need to extract them in post-processing and you will probably need a CFD-Post session file to do this.

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