UltraScan III
Namespaces
Classes
Files
File List
File Members
utils
us_lamm_astfvm.h
Go to the documentation of this file.
1
#ifndef US_LAMMASTFVM_H
3
#define US_LAMMASTFVM_H
4
5
#include <QtCore>
6
#include "
us_extern.h
"
7
#include "
us_model.h
"
8
#include "
us_simparms.h
"
9
#include "
us_buffer.h
"
10
#include "
us_dataIO.h
"
11
#include "
us_astfem_math.h
"
12
#include "
us_astfem_rsa.h
"
13
14
#ifndef DbgLv
15
#define DbgLv(a) if(dbg_level>=a)qDebug()
16
#endif
17
19
class
US_UTIL_EXTERN
US_LammAstfvm
:
public
QObject
20
{
21
Q_OBJECT
22
23
public
:
24
26
class
Mesh
27
{
28
public
:
29
35
Mesh
(
double
,
double
,
int
,
int
);
36
38
~
Mesh
();
39
44
void
InitMesh(
double
,
double
,
double
);
45
50
void
RefineMesh(
double
*,
double
*,
double
);
51
52
int
Nv
;
53
int
Ne
;
54
double
*
x
;
55
56
private
:
57
int
dbg_level
;
// debug level
58
int
MaxRefLev
;
59
int
MonScale
;
60
double
MonCutoff
;
61
double
SmoothingWt
;
62
int
SmoothingCyl
;
63
64
int
*
Eid
;
// elem id
65
int
*
RefLev
;
// refinement level of an elem
66
double
*
MeshDen
;
// desired mesh density
67
int
*
Mark
;
// ref/unref marker
68
69
// private functions
70
void
ComputeMeshDen_D3(
double
*,
double
* );
71
void
Smoothing(
int
,
double
*,
double
,
int
);
72
void
Unrefine(
double
);
73
void
Refine(
double
);
74
};
75
77
class
SaltData
78
{
79
public
:
80
85
SaltData
(
US_Model
,
US_SimulationParameters
,
86
US_DataIO::RawData
* );
87
89
~
SaltData
();
90
92
void
initSalt();
93
99
void
InterpolateCSalt(
int
,
double
*,
double
,
double
* );
100
101
US_DataIO::RawData
sa_data
;
102
private
:
104
105
US_Model
model
;
// salt data co-sed model
106
US_SimulationParameters
simparms
;
// salt simulation parameters
107
108
int
Nx
;
// number of points in radial direction
109
int
Nt
;
// number of points in time direction
110
int
scn
;
// index to next available salt data scan
111
double
*
xs
;
// grids in radial direction
112
double
t0
;
// 1st time intervals in use.
113
double
t1
;
// 2nd time intervals in use.
114
double
*
Cs0
;
// salt concentration for the 1st time interval
115
double
*
Cs1
;
// salt concentration for the 2nd time interval
116
int
dbg_level
;
// debug level
117
QVector< double >
xsVec
;
// Vector for xs
118
QVector< double >
Cs0Vec
;
// Vector for Cs0
119
QVector< double >
Cs1Vec
;
// Vector for Cs1
120
};
121
126
US_LammAstfvm
(
US_Model
&,
US_SimulationParameters
&, QObject* = 0 );
127
129
~
US_LammAstfvm
();
130
134
int
calculate(
US_DataIO::RawData
& );
135
138
void
set_buffer(
US_Buffer
);
139
143
int
solve_component(
int
);
144
147
void
SetMeshSpeedFactor(
double
);
148
151
void
SetMeshRefineOpt(
int
);
152
155
void
setStopFlag (
bool
);
156
159
void
setMovieFlag(
bool
);
160
161
signals:
164
void
calc_start(
int
nsteps );
165
168
void
calc_progress(
int
istep );
169
171
void
calc_done(
void
);
172
175
void
comp_progress(
int
icomp );
176
180
void
new_scan ( QVector< double >*,
double
* );
181
184
void
new_time (
double
);
185
186
private
:
187
188
US_Model
&
model
;
// input model
189
US_SimulationParameters
&
simparams
;
// input simulation parameters
190
US_DataIO::RawData
*
auc_data
;
// input/output AUC data
191
192
US_AstfemMath::MfemData
af_data
;
// internal data
193
194
Mesh
*
msh
;
// radial grid
195
196
int
NonIdealCaseNo
;
// non-ideal case number
197
// = 0 : ideal, constant s, D
198
// = 1 : concentration dependent
199
// = 2 : co-sedimenting
200
// = 3 : compressibility
201
202
double
sigma
;
// constant for concentration dependence (s)
203
double
delta
;
// constant for concentration dependence (D)
204
// non-ideal case
205
// s = s_0/(1+sigma*C), D=D_0/(1+delta*C)
206
207
double
density
;
// buffer density
208
double
compressib
;
// factor for compressibility
209
double
vbar_salt
;
// vbar of the salt
210
211
SaltData
*
saltdata
;
// data handle for cosedimenting
212
213
double
MeshSpeedFactor
;
// = 1: mesh following sedimentation
214
// = 0: fixed mesh in each time step
215
216
int
MeshRefineOpt
;
// = 1: perform mesh local refinement
217
// = 0: no mesh refinement
218
219
int
comp_x
;
// current component index
220
int
dbg_level
;
// debug level
221
222
bool
stopFlag
;
// flag to stop processing
223
bool
movieFlag
;
// flag to operate in show-movie mode
224
225
double
param_m
;
// m of cell (meniscus)
226
double
param_b
;
// b of cell (bottom)
227
double
param_s
;
// base s value (sedimentation coefficient)
228
double
param_D
;
// base D value (diffusion coefficient)
229
double
param_w2
;
// rpm-based omega-sq-t, w2=(rpm*pi/30)^2
230
231
double
err_tol
;
// error tolerance for mesh refinement
232
233
double
d_coeff[ 6 ];
// SD Adjust buffer density coefficients
234
double
v_coeff[ 6 ];
// SD Adjust buffer viscosity coefficients
235
236
// private functions
237
240
int
nonIdealCaseNo(
void
);
241
245
void
SetNonIdealCase_1(
double
,
double
);
246
248
void
SetNonIdealCase_2(
void
);
249
253
void
SetNonIdealCase_3(
int
&,
double
& );
254
255
// Lamm equation step for sedimentation difference - predict
256
void
LammStepSedDiff_P(
double
,
double
,
int
,
double
*,
double
*,
double
* );
257
258
// Lamm equation step for sedimentation difference - calculate
259
void
LammStepSedDiff_C(
double
,
double
,
int
,
double
*,
double
*,
260
int
,
double
*,
double
*,
double
* );
261
262
// Project piecewise quadratic solution onto mesh
263
void
ProjectQ(
int
,
double
*,
double
*,
int
,
double
*,
double
* );
264
265
// Integrate piecewise quadratic function defined on mesh
266
double
IntQs(
double
*,
double
*,
int
,
double
,
int
,
double
);
267
268
// Perform quadratic interpolation to fill out radius,conc. vectors
269
void
quadInterpolate(
double
*,
double
*,
int
,
270
QVector< double >&, QVector< double >& );
271
272
void
LocateStar(
int
,
double
*,
int
,
double
*,
int
*,
double
* );
273
274
// Adjust s and D arrays
275
void
AdjustSD(
double
,
int
,
double
*,
double
*,
double
*,
double
* );
276
277
void
fun_phi(
double
,
double
* );
278
279
void
fun_dphi(
double
,
double
* );
280
281
void
fun_Iphi(
double
,
double
* );
282
283
double
IntQ(
double
*,
double
*,
double
,
double
);
284
285
286
void
LsSolver53(
int
,
double
**,
double
*,
double
* );
287
288
// load internal data from caller's raw data
289
void
load_mfem_data(
US_DataIO::RawData
&,
US_AstfemMath::MfemData
&,
290
bool
=
true
);
291
292
// store internal data to caller's raw data
293
void
store_mfem_data(
US_DataIO::RawData
&,
US_AstfemMath::MfemData
& );
294
};
295
#endif
Generated on Sun Jun 21 2015 11:40:42 for UltraScan III by
1.8.3.1-20130324