STYLE: Fixing code style requirements for more files - those not

picked up by a copyright change.
This commit is contained in:
graham
2010-07-29 11:28:44 +01:00
parent f26b8c1cc7
commit 28345247a7
78 changed files with 13805 additions and 13566 deletions

View File

@ -1,6 +1,8 @@
Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl; Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl;
Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl; Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl;
Info<< "Mean u':" << (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value() << endl; Info<< "Mean u':"
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
<< endl;
logSummaryFile logSummaryFile
<< runTime.theta() << tab << runTime.theta() << tab

View File

@ -1,6 +1,8 @@
Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl; Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl;
Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl; Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl;
Info<< "Mean u':" << (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value() << endl; Info<< "Mean u':"
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
<< endl;
logSummaryFile logSummaryFile
<< runTime.theta() << tab << runTime.theta() << tab

View File

@ -1,6 +1,8 @@
Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl; Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl;
Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl; Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl;
Info<< "Mean u':" << (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value() << endl; Info<< "Mean u':"
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
<< endl;
logSummaryFile logSummaryFile
<< runTime.theta() << tab << runTime.theta() << tab

View File

@ -1,6 +1,11 @@
surfaceScalarField::GeometricBoundaryField& phiPatches = phi.boundaryField(); surfaceScalarField::GeometricBoundaryField& phiPatches =
const volVectorField::GeometricBoundaryField& rhoUpatches = rhoU.boundaryField(); phi.boundaryField();
const surfaceVectorField::GeometricBoundaryField& SfPatches = mesh.Sf().boundaryField();
const volVectorField::GeometricBoundaryField& rhoUpatches =
rhoU.boundaryField();
const surfaceVectorField::GeometricBoundaryField& SfPatches =
mesh.Sf().boundaryField();
forAll(phiPatches, patchI) forAll(phiPatches, patchI)
{ {

View File

@ -25,9 +25,9 @@ Global
setMultiRegionDeltaT setMultiRegionDeltaT
Description Description
Reset the timestep to maintain a constant maximum courant and diffusion Reset the timestep to maintain a constant maximum courant and
Numbers. Reduction of time-step is immediate, but increase is damped to avoid diffusion Numbers. Reduction of time-step is immediate, but
unstable oscillations. increase is damped to avoid unstable oscillations.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -67,7 +67,13 @@
label paRefCell = 0; label paRefCell = 0;
scalar paRefValue = 0.0; scalar paRefValue = 0.0;
setRefCell(pa, mesh.solutionDict().subDict("SIMPLE"), paRefCell, paRefValue); setRefCell
(
pa,
mesh.solutionDict().subDict("SIMPLE"),
paRefCell,
paRefValue
);
singlePhaseTransportModel laminarTransport(U, phi); singlePhaseTransportModel laminarTransport(U, phi);

View File

@ -59,7 +59,8 @@ if (nWallFaces == 0)
} }
else else
{ {
Info<< "Generating wall data for patch: " << patches[patchId].name() << endl; Info<< "Generating wall data for patch: " << patches[patchId].name()
<< endl;
} }
// store local id of near-walll cell to process // store local id of near-walll cell to process
@ -71,4 +72,3 @@ scalarField y =
& (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId]); & (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId]);
Info<< " Height to first cell centre y0 = " << y[cellId] << endl; Info<< " Height to first cell centre y0 = " << y[cellId] << endl;

View File

@ -34,7 +34,13 @@
betaEqn.relax(); betaEqn.relax();
betaEqn.solve(); betaEqn.solve();
alpha = 0.5*(scalar(1) + sqr(scalar(1) - beta) - sqr(scalar(1) - alpha)); alpha =
0.5
*(
scalar(1)
+ sqr(scalar(1) - beta)
- sqr(scalar(1) - alpha)
);
*/ */
beta = scalar(1) - alpha; beta = scalar(1) - alpha;

View File

@ -32,7 +32,11 @@
phi = alphaf*phia + betaf*phib; phi = alphaf*phia + betaf*phib;
surfaceScalarField Dp("(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob); surfaceScalarField Dp
(
"(rho*(1|A(U)))",
alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {

View File

@ -1,6 +1,11 @@
surfaceScalarField::GeometricBoundaryField& phivPatches = phiv.boundaryField(); surfaceScalarField::GeometricBoundaryField& phivPatches =
const volVectorField::GeometricBoundaryField& Upatches = U.boundaryField(); phiv.boundaryField();
const surfaceVectorField::GeometricBoundaryField& SfPatches = mesh.Sf().boundaryField();
const volVectorField::GeometricBoundaryField& Upatches =
U.boundaryField();
const surfaceVectorField::GeometricBoundaryField& SfPatches =
mesh.Sf().boundaryField();
forAll(phivPatches, patchI) forAll(phivPatches, patchI)
{ {

View File

@ -26,7 +26,8 @@
phi = phiU + phi = phiU +
( (
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() fvc::interpolate(interface.sigmaK())
*fvc::snGrad(alpha1)*mesh.magSf()
+ fvc::interpolate(rho)*(g & mesh.Sf()) + fvc::interpolate(rho)*(g & mesh.Sf())
)*rUAf; )*rUAf;

View File

@ -59,7 +59,17 @@
alpharScheme alpharScheme
); );
MULES::explicitSolve(geometricOneField(), alpha1, phi, phiAlpha1, Sp, Su, 1, 0); MULES::explicitSolve
(
geometricOneField(),
alpha1,
phi,
phiAlpha1,
Sp,
Su,
1,
0
);
surfaceScalarField rho1f = fvc::interpolate(rho1); surfaceScalarField rho1f = fvc::interpolate(rho1);
surfaceScalarField rho2f = fvc::interpolate(rho2); surfaceScalarField rho2f = fvc::interpolate(rho2);

View File

@ -26,7 +26,8 @@
phi = phiU + phi = phiU +
( (
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() fvc::interpolate(interface.sigmaK())
*fvc::snGrad(alpha1)*mesh.magSf()
+ fvc::interpolate(rho)*(g & mesh.Sf()) + fvc::interpolate(rho)*(g & mesh.Sf())
)*rUAf; )*rUAf;

View File

@ -15,7 +15,8 @@
phi = phiU + phi = phiU +
( (
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() fvc::interpolate(interface.sigmaK())
*fvc::snGrad(alpha1)*mesh.magSf()
+ fvc::interpolate(rho)*(g & mesh.Sf()) + fvc::interpolate(rho)*(g & mesh.Sf())
)*rUAf; )*rUAf;

View File

@ -51,8 +51,28 @@
); );
// MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); // MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
//MULES::explicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0); // MULES::explicitSolve
MULES::implicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0); // (
// geometricOneField(),
// alpha1,
// phi,
// phiAlpha,
// Sp,
// Su,
// 1,
// 0
// );
MULES::implicitSolve
(
geometricOneField(),
alpha1,
phi,
phiAlpha,
Sp,
Su,
1,
0
);
rhoPhi += rhoPhi +=
(runTime.deltaT()/totalDeltaT) (runTime.deltaT()/totalDeltaT)

View File

@ -15,7 +15,8 @@
phi = phiU + phi = phiU +
( (
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() fvc::interpolate(interface.sigmaK())
*fvc::snGrad(alpha1)*mesh.magSf()
+ fvc::interpolate(rho)*(g & mesh.Sf()) + fvc::interpolate(rho)*(g & mesh.Sf())
)*rUAf; )*rUAf;

View File

@ -45,7 +45,11 @@
phi = alphaf*phia + betaf*phib; phi = alphaf*phia + betaf*phib;
surfaceScalarField Dp("(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob); surfaceScalarField Dp
(
"(rho*(1|A(U)))",
alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {

View File

@ -715,7 +715,12 @@ static uint32_t crc_16_table[16] = {
* Unfortunately, DOCSIS uses x^16+x^12+x^5+1. D'oh! * Unfortunately, DOCSIS uses x^16+x^12+x^5+1. D'oh!
*/ */
static uint32_t GetCRC16Update (uint32_t start_crc, const char * data_stream, int length) { static uint32_t GetCRC16Update
(
uint32_t start_crc,
const char * data_stream,
int length
) {
uint32_t crc = start_crc; uint32_t crc = start_crc;
uint32_t r; uint32_t r;
@ -810,7 +815,12 @@ register uint32_t crc_accum;
/* update the CRC on the data block one byte at a time */ /* update the CRC on the data block one byte at a time */
static uint32_t UpdateCRC32 (uint32_t crc_accum, const char *data_blk_ptr, int data_blk_size) { static uint32_t UpdateCRC32
(
uint32_t crc_accum,
const char *data_blk_ptr,
int data_blk_size
) {
register int j; register int j;
register uint8_t i; register uint8_t i;

View File

@ -53,12 +53,15 @@ inline void reportInfo()
<< " utilization: " << (nBits * offset) << nl; << " utilization: " << (nBits * offset) << nl;
Info<< " Masking:" << nl Info<< " Masking:" << nl
<< " shift << " << unsigned(nBits * offset) << nl << " shift << "
<< " shift >> " << unsigned((sizeof(unsigned)*CHAR_BIT) - nBits * offset) << unsigned(nBits * offset) << nl
<< " shift >> "
<< unsigned((sizeof(unsigned)*CHAR_BIT) - nBits * offset)
<< nl; << nl;
hex(Info); hex(Info);
Info<< " maskLower: " << PackedList<nBits>::maskLower(PackedList<nBits>::packing()) Info<< " maskLower: "
<< PackedList<nBits>::maskLower(PackedList<nBits>::packing())
<< nl << nl
<< " useSHL: " << useSHL << nl << " useSHL: " << useSHL << nl
<< " useSHR: " << useSHR << nl; << " useSHR: " << useSHR << nl;

View File

@ -62,11 +62,13 @@ int main(int argc, char *argv[])
dictionary dict2(dict1.xfer()); dictionary dict2(dict1.xfer());
Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() << nl Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() << nl
<< "dict2.toc(): " << dict2.name() << " " << dict2.toc() << endl; << "dict2.toc(): " << dict2.name() << " " << dict2.toc()
<< endl;
// copy back // copy back
dict1 = dict2; dict1 = dict2;
Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() << endl; Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc()
<< endl;
dictionary dict3(dict2.subDictPtr("boundaryField")); dictionary dict3(dict2.subDictPtr("boundaryField"));
dictionary dict4(dict2.subDictPtr("NONEXISTENT")); dictionary dict4(dict2.subDictPtr("NONEXISTENT"));

View File

@ -29,8 +29,11 @@ int main()
Info<< "tr.transform(v) " << tr.transform(v) << endl; Info<< "tr.transform(v) " << tr.transform(v) << endl;
Info<< "(septernion(vector(0, -1, 0))*q*septernion(vector(0, 1, 0))).transform(v) " Info<< "(septernion(vector(0, -1, 0))*q*septernion(vector(0, 1, 0)))"
<< (septernion(vector(0, -1, 0))*q*septernion(vector(0, 1, 0))).transform(v) << ".transform(v) "
<< (septernion(vector(0, -1, 0))
*q
*septernion(vector(0, 1, 0))).transform(v)
<< endl; << endl;
return 0; return 0;

View File

@ -452,7 +452,8 @@ int main(int argc, char *argv[])
<< "(there is a points file in " << pointsInstance << "(there is a points file in " << pointsInstance
<< ")" << endl << ")" << endl
<< "Please rerun with the correct time specified" << "Please rerun with the correct time specified"
<< " (through the -constant, -time or -latestTime (at your option)." << " (through the -constant, -time or -latestTime "
<< "(at your option)."
<< endl << exit(FatalError); << endl << exit(FatalError);
} }

View File

@ -1272,7 +1272,10 @@ int main(int argc, char *argv[])
//Info<< " symm tensors :"; //Info<< " symm tensors :";
//print(Info, symmNames); //print(Info, symmNames);
// //
//wordList tensorNames(sprayObjs.names(tensorIOField::typeName)); //wordList tensorNames
//(
// sprayObjs.names(tensorIOField::typeName)
//);
//Info<< " tensors :"; //Info<< " tensors :";
//print(Info, tensorNames); //print(Info, tensorNames);

View File

@ -112,7 +112,10 @@ Note
@verbatim @verbatim
<?xml version="1.0"?> <?xml version="1.0"?>
<VTKFile type="Collection" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor"> <VTKFile type="Collection"
version="0.1"
byte_order="LittleEndian"
compressor="vtkZLibDataCompressor">
<Collection> <Collection>
<DataSet timestep="50" file="pitzDaily_2.vtu"/> <DataSet timestep="50" file="pitzDaily_2.vtu"/>
<DataSet timestep="100" file="pitzDaily_3.vtu"/> <DataSet timestep="100" file="pitzDaily_3.vtu"/>

View File

@ -19,7 +19,8 @@ int USERD_get_maxsize_info
label nPyr05Max = 0; label nPyr05Max = 0;
label nTet04Max = 0; label nTet04Max = 0;
Info<< "Checking all time steps for EnSight memory allocation purpose. This can take some time." << endl; Info<< "Checking all time steps for EnSight memory allocation purpose. "
<< "This can take some time." << endl;
for (label timeI=1; timeI < timeDirs.size(); ++timeI) for (label timeI=1; timeI < timeDirs.size(); ++timeI)
{ {

View File

@ -1,4 +1,3 @@
int USERD_get_nsided_conn int USERD_get_nsided_conn
( (
int part_number, int part_number,
@ -13,7 +12,8 @@ int USERD_get_nsided_conn
#endif #endif
if (part_number == 1) if (part_number == 1)
{ {
Info<< "************* EEEEEEEEERRRRRRRRRRRRRRRRRR *************** " << endl << flush; Info<< "************* EEEEEEEEERRRRRRRRRRRRRRRRRR *************** "
<< endl << flush;
} }
else if (part_number < nPatches+2) else if (part_number < nPatches+2)

View File

@ -198,7 +198,8 @@ int USERD_set_filenames
runTime.setTime(timeDirs[Current_time_step], Current_time_step); runTime.setTime(timeDirs[Current_time_step], Current_time_step);
Num_variables = nVar + nSprayVariables; Num_variables = nVar + nSprayVariables;
Numparts_available = Num_unstructured_parts + Num_structured_parts + nPatches; Numparts_available =
Num_unstructured_parts + Num_structured_parts + nPatches;
#ifdef ENSIGHTDEBUG #ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_set_filenames" << endl << flush; Info<< "Leaving: USERD_set_filenames" << endl << flush;
@ -206,4 +207,3 @@ int USERD_set_filenames
return Z_OK; return Z_OK;
} }

View File

@ -280,4 +280,3 @@ void RenderModel() {
} }
PostString(buf,0,-2,5); PostString(buf,0,-2,5);
} }

View File

@ -6,4 +6,3 @@ void PostString(char *_s,int _x,int _y,float _life=5.0);
void RenderStrings(); void RenderStrings();
#endif #endif

View File

@ -24,7 +24,9 @@ template <class Type> class List {
Type * element; Type * element;
int num; int num;
int array_size; int array_size;
Type &operator[](int i){assert(i>=0 && i<num); return element[i];} Type &operator[](int i){
assert(i>=0 && i<num);
return element[i];}
}; };

View File

@ -178,7 +178,8 @@ float ComputeEdgeCollapseCost(Vertex *u,Vertex *v) {
for(i=0;i<u->face.num;i++) { for(i=0;i<u->face.num;i++) {
float mincurv=1; // curve for face i and closer side to it float mincurv=1; // curve for face i and closer side to it
for(int j=0;j<sides.num;j++) { for(int j=0;j<sides.num;j++) {
// use dot product of face normals. '^' defined in vector // use dot product of face normals. '^'
// defined in vector
float dotprod = u->face[i]->normal ^ sides[j]->normal; float dotprod = u->face[i]->normal ^ sides[j]->normal;
mincurv = min(mincurv,(1-dotprod)/2.0f); mincurv = min(mincurv,(1-dotprod)/2.0f);
} }
@ -208,8 +209,10 @@ void ComputeEdgeCostAtVertex(Vertex *v) {
float dist; float dist;
dist = ComputeEdgeCollapseCost(v,v->neighbor[i]); dist = ComputeEdgeCollapseCost(v,v->neighbor[i]);
if(dist<v->objdist) { if(dist<v->objdist) {
v->collapse=v->neighbor[i]; // candidate for edge collapse // candidate for edge collapse
v->objdist=dist; // cost of the collapse v->collapse=v->neighbor[i];
// cost of the collapse
v->objdist=dist;
} }
} }
} }
@ -310,4 +313,3 @@ void ProgressiveMesh(List<Vector> &vert, List<tridata> &tri,
// The caller of this function should reorder their vertices // The caller of this function should reorder their vertices
// according to the returned "permutation". // according to the returned "permutation".
} }

View File

@ -1,13 +1,14 @@
/* Copyright 1996, Viewpoint Datalabs Int'l, www.viewpoint.com, 1-800-DATASET */ /* Copyright 1996, Viewpoint Datalabs Int'l, www.viewpoint.com, 1-800-DATASET */
/* /*
# Usage Rights: You (the user) may use this model to help build cool personal # Usage Rights: You (the user) may use this model to help build
# vrml worlds, but please give us credit when you do ("3D model provided by # cool personal vrml worlds, but please give us credit when you do
# Viewpoint Datalabs, www,viewpoint.com"). Please don't sell it or use it to # ("3D model provided by Viewpoint Datalabs, www,viewpoint.com").
# make money indirectly. Don't redistribute it or put it on a web site except # Please don't sell it or use it to make money indirectly. Don't
# as a part of your personal, non-commerical vrml world. If you want to do a # redistribute it or put it on a web site except as a part of your
# commercial project, give us a call at 1-800-DATASET or visit www.viewpoint.com # personal, non-commerical vrml world. If you want to do a
# and we'll help you obtain the rights to do so. # commercial project, give us a call at 1-800-DATASET or visit
*/ # www.viewpoint.com and we'll help you obtain the rights to do so.
# */
/* /*
* Note that this data was put directly into the program * Note that this data was put directly into the program

View File

@ -1,13 +1,14 @@
/* Copyright 1996, Viewpoint Datalabs Int'l, www.viewpoint.com, 1-800-DATASET */ /* Copyright 1996, Viewpoint Datalabs Int'l, www.viewpoint.com, 1-800-DATASET */
/* /*
# Usage Rights: You (the user) may use this model to help build cool personal # Usage Rights: You (the user) may use this model to help build
# vrml worlds, but please give us credit when you do ("3D model provided by # cool personal vrml worlds, but please give us credit when you do
# Viewpoint Datalabs, www,viewpoint.com"). Please don't sell it or use it to # ("3D model provided by Viewpoint Datalabs, www,viewpoint.com").
# make money indirectly. Don't redistribute it or put it on a web site except # Please don't sell it or use it to make money indirectly. Don't
# as a part of your personal, non-commerical vrml world. If you want to do a # redistribute it or put it on a web site except as a part of your
# commercial project, give us a call at 1-800-DATASET or visit www.viewpoint.com # personal, non-commerical vrml world. If you want to do a
# and we'll help you obtain the rights to do so. # commercial project, give us a call at 1-800-DATASET or visit
*/ # www.viewpoint.com and we'll help you obtain the rights to do so.
# */
/* /*
* Note that this data was put directly into the program * Note that this data was put directly into the program

View File

@ -1,4 +1,3 @@
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
#include <assert.h> #include <assert.h>
@ -25,13 +24,22 @@ Vector normalize(Vector v) {
return v; return v;
} }
Vector operator+(Vector v1,Vector v2) {return Vector(v1.x+v2.x,v1.y+v2.y,v1.z+v2.z);} Vector operator+(Vector v1,Vector v2)
Vector operator-(Vector v1,Vector v2) {return Vector(v1.x-v2.x,v1.y-v2.y,v1.z-v2.z);} {
return Vector(v1.x+v2.x,v1.y+v2.y,v1.z+v2.z);
}
Vector operator-(Vector v1,Vector v2)
{
return Vector(v1.x-v2.x,v1.y-v2.y,v1.z-v2.z);
}
Vector operator-(Vector v) {return Vector(-v.x,-v.y,-v.z);} Vector operator-(Vector v) {return Vector(-v.x,-v.y,-v.z);}
Vector operator*(Vector v1,float s) {return Vector(v1.x*s,v1.y*s,v1.z*s);} Vector operator*(Vector v1,float s) {return Vector(v1.x*s,v1.y*s,v1.z*s);}
Vector operator*(float s, Vector v1) {return Vector(v1.x*s,v1.y*s,v1.z*s);} Vector operator*(float s, Vector v1) {return Vector(v1.x*s,v1.y*s,v1.z*s);}
Vector operator/(Vector v1,float s) {return v1*(1.0f/s);} Vector operator/(Vector v1,float s) {return v1*(1.0f/s);}
float operator^(Vector v1,Vector v2) {return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;} float operator^(Vector v1,Vector v2)
{
return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;
}
Vector operator*(Vector v1,Vector v2) { Vector operator*(Vector v1,Vector v2) {
return Vector( return Vector(
v1.y * v2.z - v1.z*v2.y, v1.y * v2.z - v1.z*v2.y,
@ -103,6 +111,7 @@ Quaternion slerp(Quaternion a,Quaternion b,float interp){
} }
float theta = float(acos(a^b)); float theta = float(acos(a^b));
if(theta==0.0f) { return(a);} if(theta==0.0f) { return(a);}
return a*float(sin(theta-interp*theta)/sin(theta)) + b*float(sin(interp*theta)/sin(theta)); return
a*float(sin(theta-interp*theta)/sin(theta))
+ b*float(sin(interp*theta)/sin(theta));
} }

View File

@ -47,13 +47,26 @@ class Quaternion{
public: public:
float r,x,y,z; float r,x,y,z;
Quaternion(){x=y=z=0.0f;r=1.0f;}; Quaternion(){x=y=z=0.0f;r=1.0f;};
Quaternion(Vector v,float t){v=normalize(v);r=float(cos(t/2.0));v=v*float(sin(t/2.0));x=v.x;y=v.y;z=v.z;}; Quaternion(Vector v,float t){
v=normalize(v);
r=float(cos(t/2.0));
v=v*float(sin(t/2.0));
x=v.x;
y=v.y;
z=v.z;
};
Quaternion(float _r,float _x,float _y,float _z){r=_r;x=_x;y=_y;z=_z;}; Quaternion(float _r,float _x,float _y,float _z){r=_r;x=_x;y=_y;z=_z;};
float angle(){return float(acos(r)*2.0);} float angle(){return float(acos(r)*2.0);}
Vector axis(){Vector a(x,y,z); return a*float(1/sin(angle()/2.0));} Vector axis(){Vector a(x,y,z); return a*float(1/sin(angle()/2.0));}
Vector xdir(){return Vector(1-2*(y*y+z*z), 2*(x*y+r*z), 2*(x*z-r*y));} Vector xdir(){
Vector ydir(){return Vector( 2*(x*y-r*z),1-2*(x*x+z*z), 2*(y*z+r*x));} return Vector(1-2*(y*y+z*z), 2*(x*y+r*z), 2*(x*z-r*y));
Vector zdir(){return Vector( 2*(x*z+r*y), 2*(y*z-r*x),1-2*(x*x+y*y));} }
Vector ydir(){
return Vector( 2*(x*y-r*z),1-2*(x*x+z*z), 2*(y*z+r*x));
}
Vector zdir(){
return Vector( 2*(x*z+r*y), 2*(y*z-r*x),1-2*(x*x+y*y));
}
matrix getmatrix(){return matrix(xdir(),ydir(),zdir());} matrix getmatrix(){return matrix(xdir(),ydir(),zdir());}
//operator matrix(){return getmatrix();} //operator matrix(){return getmatrix();}
}; };

View File

@ -1,4 +1,3 @@
/* /*
* Polygon Reduction Demo by Stan Melax (c) 1998 * Polygon Reduction Demo by Stan Melax (c) 1998
* Permission to use any of this code wherever you want is granted.. * Permission to use any of this code wherever you want is granted..
@ -108,7 +107,8 @@ Quaternion VirtualTrackBall(Vector cop,Vector cor,Vector dir1,Vector dir2) {
float m; float m;
// compute plane // compute plane
Vector nrml = cor - cop; Vector nrml = cor - cop;
float fudgefactor = 1.0f/(magnitude(nrml) * 0.25f); // since trackball proportional to distance from cop // since trackball proportional to distance from cop
float fudgefactor = 1.0f/(magnitude(nrml) * 0.25f);
nrml = normalize(nrml); nrml = normalize(nrml);
float dist = -(nrml^cor); float dist = -(nrml^cor);
Vector u= planelineintersection(nrml,dist,cop,cop+dir1); Vector u= planelineintersection(nrml,dist,cop,cop+dir1);
@ -285,7 +285,8 @@ HWND CreateOpenGLWindow(char* title)
if (!RegisterClass(&wc)) { if (!RegisterClass(&wc)) {
MessageBox(NULL, "RegisterClass() failed: " MessageBox(NULL, "RegisterClass() failed: "
"Cannot register window class.", "Error", MB_OK); "Cannot register window class.",
"Error", MB_OK);
return NULL; return NULL;
} }
} }
@ -295,7 +296,8 @@ HWND CreateOpenGLWindow(char* title)
0,0,Width,Height, NULL, NULL, hInstance, NULL); 0,0,Width,Height, NULL, NULL, hInstance, NULL);
if (hWnd == NULL) { if (hWnd == NULL) {
MessageBox(NULL, "CreateWindow() failed: Cannot create a window.", MessageBox(NULL,
"CreateWindow() failed: Cannot create a window.",
"Error", MB_OK); "Error", MB_OK);
return NULL; return NULL;
} }
@ -307,7 +309,9 @@ HWND CreateOpenGLWindow(char* title)
memset(&pfd, 0, sizeof(pfd)); memset(&pfd, 0, sizeof(pfd));
pfd.nSize = sizeof(pfd); pfd.nSize = sizeof(pfd);
pfd.nVersion = 1; pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; pfd.dwFlags = PFD_DRAW_TO_WINDOW
| PFD_SUPPORT_OPENGL
| PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA; pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cDepthBits = 32; pfd.cDepthBits = 32;
pfd.cColorBits = 32; pfd.cColorBits = 32;
@ -315,7 +319,8 @@ HWND CreateOpenGLWindow(char* title)
pf = ChoosePixelFormat(hDC, &pfd); pf = ChoosePixelFormat(hDC, &pfd);
if (pf == 0) { if (pf == 0) {
MessageBox(NULL, "ChoosePixelFormat() failed: " MessageBox(NULL, "ChoosePixelFormat() failed: "
"Cannot find a suitable pixel format.", "Error", MB_OK); "Cannot find a suitable pixel format.",
"Error", MB_OK);
return 0; return 0;
} }
@ -352,11 +357,14 @@ HWND CreateOpenGLWindow(char* title)
/* fill in the entries with an RGB color ramp. */ /* fill in the entries with an RGB color ramp. */
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
lpPal->palPalEntry[i].peRed = lpPal->palPalEntry[i].peRed =
(((i >> pfd.cRedShift) & redMask) * 255)/redMask; (((i >> pfd.cRedShift) & redMask) * 255)
/redMask;
lpPal->palPalEntry[i].peGreen = lpPal->palPalEntry[i].peGreen =
(((i >> pfd.cGreenShift) & greenMask) * 255)/greenMask; (((i >> pfd.cGreenShift) & greenMask) * 255)
/greenMask;
lpPal->palPalEntry[i].peBlue = lpPal->palPalEntry[i].peBlue =
(((i >> pfd.cBlueShift) & blueMask) * 255)/blueMask; (((i >> pfd.cBlueShift) & blueMask) * 255)
/blueMask;
lpPal->palPalEntry[i].peFlags = 0; lpPal->palPalEntry[i].peFlags = 0;
} }
} else { } else {
@ -427,7 +435,8 @@ int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst,
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} else { } else {
goto quit; // This 'goto' was in the sample code // This 'goto' was in the sample code
goto quit;
} }
} }
CalcFPSDeltaT(); CalcFPSDeltaT();

View File

@ -364,7 +364,8 @@ int main(int argc, char *argv[])
Info<< "writing surfMesh again well: " << surfOut.objectPath() << endl; Info<< "writing surfMesh again well: " << surfOut.objectPath()
<< endl;
surfOut.write(); surfOut.write();
// write directly // write directly

View File

@ -88,7 +88,8 @@ int main(int argc, char *argv[])
// - explicitly named patches only (-patches (at your option) // - explicitly named patches only (-patches (at your option)
// - all patches (default in sequential mode) // - all patches (default in sequential mode)
// - all non-processor patches (default in parallel mode) // - all non-processor patches (default in parallel mode)
// - all non-processor patches (sequential mode, -excludeProcPatches (at your option) // - all non-processor patches (sequential mode, -excludeProcPatches
// (at your option)
// Construct table of patches to include. // Construct table of patches to include.
const polyBoundaryMesh& bMesh = mesh.boundaryMesh(); const polyBoundaryMesh& bMesh = mesh.boundaryMesh();

View File

@ -481,8 +481,8 @@ label sharedFace
} }
// Calculate (inward pointing) normals on edges shared by faces in faceToEdge and // Calculate (inward pointing) normals on edges shared by faces in
// averages them to pointNormals. // faceToEdge and averages them to pointNormals.
void calcPointVecs void calcPointVecs
( (
const triSurface& surf, const triSurface& surf,
@ -696,8 +696,9 @@ int main(int argc, char *argv[])
boolList borderEdge(surf.nEdges(), false); boolList borderEdge(surf.nEdges(), false);
markBorderEdges(debug, surf, borderEdge); markBorderEdges(debug, surf, borderEdge);
// Points on two sides connected to borderEdges are called borderPoints and // Points on two sides connected to borderEdges are called
// will be duplicated. borderPoint contains label of newly introduced vertex. // borderPoints and will be duplicated. borderPoint contains label
// of newly introduced vertex.
labelList borderPoint(surf.nPoints(), -1); labelList borderPoint(surf.nPoints(), -1);
markBorderPoints(debug, surf, borderEdge, borderPoint); markBorderPoints(debug, surf, borderEdge, borderPoint);

View File

@ -39,9 +39,10 @@ Description
(baseType,thisType,memberFunction,argNames,lookup,functionPtr) \ (baseType,thisType,memberFunction,argNames,lookup,functionPtr) \
\ \
/* Add the thisType memberFunction to the table, find by lookup name */ \ /* Add the thisType memberFunction to the table, find by lookup name */ \
baseType::add##memberFunction##argNames##StaticMemberFunctionToTable<thisType> \ baseType::add##memberFunction##argNames## \
add_##lookup##_##thisType##memberFunction##argNames##StaticMemberFunctionTo##baseType##Table_\ StaticMemberFunctionToTable<thisType> \
(#lookup, functionPtr) add_##lookup##_##thisType##memberFunction##argNames## \
StaticMemberFunctionTo##baseType##Table_(#lookup, functionPtr)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -28,20 +28,23 @@ License
OpenFOAM is a free, open source CFD software package produced by OpenFOAM is a free, open source CFD software package produced by
a commercial company, a commercial company,
<a href="http://www.openfoam.com/about">OpenCFD Ltd</a>. <a href="http://www.openfoam.com/about">OpenCFD Ltd</a>.
It has a It has a large user base across most areas of engineering and
large user base across most areas of engineering and science, science, from both commercial and academic organisations.
from both commercial and academic organisations. OpenFOAM has an OpenFOAM has an extensive range of features to solve anything from
extensive range of features to solve anything from complex fluid complex fluid flows involving chemical reactions, turbulence and
flows involving chemical reactions, turbulence and heat transfer, heat transfer, to solid dynamics and electromagnetics.
to solid dynamics and electromagnetics.
<a href="http://www.openfoam.com/features">More ...</a> <a href="http://www.openfoam.com/features">More ...</a>
@section users Our commitment to the users @section users Our commitment to the users
OpenFOAM comes with full commercial support from OpenCFD, including OpenFOAM comes with full commercial support from OpenCFD, including
<a href="http://www.openfoam.com/support/software.php">software support</a>, <a href="http://www.openfoam.com/support/software.php">
<a href="http://www.openfoam.com/support/development.php">contracted developments</a> software support</a>,
and a programme of <a href="http://www.openfoam.com/training/">training courses</a>. <a href="http://www.openfoam.com/support/development.php">
contracted developments</a>
and a programme of
<a href="http://www.openfoam.com/training/">
training courses</a>.
These activities fund the development, maintenance and release of These activities fund the development, maintenance and release of
OpenFOAM to make it an extremely viable commercial open source product. OpenFOAM to make it an extremely viable commercial open source product.
@ -49,7 +52,8 @@ License
OpenCFD is committed to open source software, continually developing and OpenCFD is committed to open source software, continually developing and
maintaining OpenFOAM under the maintaining OpenFOAM under the
<a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public Licence</a>. <a href="http://www.gnu.org/copyleft/gpl.html">
GNU General Public Licence</a>.
OpenFOAM will <strong>always</strong> be free of charge and open source. OpenFOAM will <strong>always</strong> be free of charge and open source.
In addition, we endeavour to support other viable open source initiatives In addition, we endeavour to support other viable open source initiatives
that will benefit science and engineering. that will benefit science and engineering.

View File

@ -693,7 +693,8 @@ void Foam::meshReaders::STARCD::readBoundary(const fileName& inputName)
maxId = max(maxId, starRegion); maxId = max(maxId, starRegion);
if (patchType == "BAFF") // should actually be case-insensitive // should actually be case-insensitive
if (patchType == "BAFF")
{ {
nBafflePatches++; nBafflePatches++;
} }

View File

@ -140,7 +140,8 @@ public:
//- Return a Map of (id => names) selected by patterns //- Return a Map of (id => names) selected by patterns
Map<word> names(const UList<wordRe>& patterns) const; Map<word> names(const UList<wordRe>& patterns) const;
//- Return a Map of (id => name) for materialType (fluid | solid | shell) //- Return a Map of (id => name) for materialType
// (fluid | solid | shell)
Map<word> selectType(const word& materialType) const; Map<word> selectType(const word& materialType) const;
//- Return a Map of (id => name) for fluids //- Return a Map of (id => name) for fluids

View File

@ -60,7 +60,11 @@
*sqrt *sqrt
( (
4.0*Vk 4.0*Vk
/(circleFraction*thickness*constant::mathematical::pi) /(
circleFraction
*thickness
*constant::mathematical::pi
)
); );
} }
break; break;

View File

@ -247,7 +247,8 @@ Foam::MRFZone::MRFZone(const fvMesh& mesh, Istream& is)
WarningIn("MRFZone(const fvMesh&, Istream&)") WarningIn("MRFZone(const fvMesh&, Istream&)")
<< "Ignoring entry 'patches'\n" << "Ignoring entry 'patches'\n"
<< " By default all patches within the rotating region rotate.\n" << " By default all patches within the rotating region rotate.\n"
<< " Optionally supply excluded patches using 'nonRotatingPatches'." << " Optionally supply excluded patches "
<< "using 'nonRotatingPatches'."
<< endl; << endl;
} }

View File

@ -208,7 +208,10 @@ inline Foam::labelList& Foam::TimeActivatedExplicitSource<Type>::cells()
template<class Type> template<class Type>
inline Foam::List<typename Foam::TimeActivatedExplicitSource<Type>::fieldNameValuePair>& inline Foam::List
<
typename Foam::TimeActivatedExplicitSource<Type>::fieldNameValuePair
>&
Foam::TimeActivatedExplicitSource<Type>::fieldData() Foam::TimeActivatedExplicitSource<Type>::fieldData()
{ {
return fieldData_; return fieldData_;

View File

@ -381,7 +381,10 @@ Foam::scalar Foam::commonRailInjector::Cd
} }
Foam::scalar Foam::commonRailInjector::fractionOfInjection(const scalar time) const Foam::scalar Foam::commonRailInjector::fractionOfInjection
(
const scalar time
) const
{ {
return integrateTable(massFlowRateProfile_, time)/mass_; return integrateTable(massFlowRateProfile_, time)/mass_;
} }

View File

@ -103,13 +103,20 @@ private:
//- Return the fraction of the total injected liquid //- Return the fraction of the total injected liquid
scalar fractionOfInjection(const scalar time) const; scalar fractionOfInjection(const scalar time) const;
/*
//- Return the average injection velocity
scalar averageInjectionVelocityTime(const scalar liquidDensity) const;
//- Return the instantaneous injection velocity // //- Return the average injection velocity
scalar injectionVelocity(const scalar, const scalar liquidDensity) const; // scalar averageInjectionVelocityTime
*/ // (
// const scalar liquidDensity
// ) const;
// //- Return the instantaneous injection velocity
// scalar injectionVelocity
// (
// const scalar,
// const scalar liquidDensity
// ) const;
public: public:

View File

@ -465,7 +465,8 @@ void Foam::parcel::updateParcelProperties
while ((n < sDB.evaporation().nEvapIter()) && (m() > VSMALL)) while ((n < sDB.evaporation().nEvapIter()) && (m() > VSMALL))
{ {
n++; n++;
// new characteristic times does not need to be calculated the first time // new characteristic times does not need to be calculated the
// first time
if (n > 1) if (n > 1)
{ {
newDensity = fuels.rho(pg, Tnew, X()); newDensity = fuels.rho(pg, Tnew, X());

View File

@ -190,7 +190,8 @@ void Foam::parcel::setRelaxationTimes
{ {
if (!boiling) if (!boiling)
{ {
// for saturation evaporation, only use 99.99% for numerical robustness // for saturation evaporation, only use 99.99% for
// numerical robustness
scalar dm = max(SMALL, 0.9999*msat[i] - mfg[i]); scalar dm = max(SMALL, 0.9999*msat[i] - mfg[i]);
tauEvaporation[i] = sDB.evaporation().relaxationTime tauEvaporation[i] = sDB.evaporation().relaxationTime
@ -213,16 +214,23 @@ void Foam::parcel::setRelaxationTimes
scalar Nusselt = scalar Nusselt =
sDB.heatTransfer().Nu(Reynolds, Prandtl); sDB.heatTransfer().Nu(Reynolds, Prandtl);
// calculating the boiling temperature of the liquid at ambient pressure // calculating the boiling temperature of the liquid
// at ambient pressure
scalar tBoilingSurface = Td; scalar tBoilingSurface = Td;
label Niter = 0; label Niter = 0;
scalar deltaT = 10.0; scalar deltaT = 10.0;
scalar dp0 = fuels.properties()[i].pv(pressure, tBoilingSurface) - pressure; scalar dp0 =
fuels.properties()[i].pv(pressure, tBoilingSurface)
- pressure;
while ((Niter < 200) && (mag(deltaT) > 1.0e-3)) while ((Niter < 200) && (mag(deltaT) > 1.0e-3))
{ {
Niter++; Niter++;
scalar pBoil = fuels.properties()[i].pv(pressure, tBoilingSurface); scalar pBoil = fuels.properties()[i].pv
(
pressure,
tBoilingSurface
);
scalar dp = pBoil - pressure; scalar dp = pBoil - pressure;
if ( (dp > 0.0) && (dp0 > 0.0) ) if ( (dp > 0.0) && (dp0 > 0.0) )
{ {
@ -255,11 +263,19 @@ void Foam::parcel::setRelaxationTimes
forAll(sDB.gasProperties(), k) forAll(sDB.gasProperties(), k)
{ {
vapourSurfaceEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(tBoilingSurface); vapourSurfaceEnthalpy +=
vapourFarEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(temperature); sDB.composition().Y()[k][celli]
*sDB.gasProperties()[k].H(tBoilingSurface);
vapourFarEnthalpy +=
sDB.composition().Y()[k][celli]
*sDB.gasProperties()[k].H(temperature);
} }
scalar kLiquid = fuels.properties()[i].K(pressure, 0.5*(tBoilingSurface+T())); scalar kLiquid = fuels.properties()[i].K
(
pressure,
0.5*(tBoilingSurface+T())
);
tauBoiling[i] = sDB.evaporation().boilingTime tauBoiling[i] = sDB.evaporation().boilingTime
( (

View File

@ -48,7 +48,11 @@ if (( xx > collProb) && (mMin > VSMALL) && (mMax > VSMALL)) {
// use mass-averaged temperature to calculate We number // use mass-averaged temperature to calculate We number
scalar averageTemp = (pMax().T()*mMax + pMin().T()*mMin)/mTot; scalar averageTemp = (pMax().T()*mMax + pMin().T()*mMin)/mTot;
// and mass averaged mole fractions ... // and mass averaged mole fractions ...
scalarField Xav((pMax().m()*pMax().X()+pMin().m()*pMin().X())/(pMax().m() + pMin().m())); scalarField Xav
(
(pMax().m()*pMax().X()+pMin().m()*pMin().X())
/(pMax().m() + pMin().m())
);
scalar sigma = spray_.fuels().sigma(pc, averageTemp, Xav); scalar sigma = spray_.fuels().sigma(pc, averageTemp, Xav);
sigma = max(1.0e-6, sigma); sigma = max(1.0e-6, sigma);
scalar rho = spray_.fuels().rho(pc, averageTemp, Xav); scalar rho = spray_.fuels().rho(pc, averageTemp, Xav);

View File

@ -129,7 +129,9 @@ if (vAlign > 0)
pMax().d() = pMax().d() =
pow pow
( (
6.0*newMaxMass/(rhoMax*constant::mathematical::pi*nMax), 6.0
*newMaxMass
/(rhoMax*constant::mathematical::pi*nMax),
1.0/3.0 1.0/3.0
); );

View File

@ -253,7 +253,9 @@ Foam::scalar Foam::RutlandFlashBoil::boilingTime
} }
scalar Gf = scalar Gf =
4.0*alfaS*dTLB*constant::mathematical::pi*sqr(diameter/2.0)/heatOfVapour; 4.0*alfaS*dTLB
*constant::mathematical::pi*sqr(diameter/2.0)
/heatOfVapour;
// calculation of the heat transfer vapourization at superheated // calculation of the heat transfer vapourization at superheated
// conditions (temperature>tBoilingSurface) // conditions (temperature>tBoilingSurface)
@ -265,7 +267,8 @@ Foam::scalar Foam::RutlandFlashBoil::boilingTime
mag((vapourFarEnthalpy-vapourSurfaceEnthalpy)/heatOfVapour); mag((vapourFarEnthalpy-vapourSurfaceEnthalpy)/heatOfVapour);
// 2.0? or 1.0? try 1! // 2.0? or 1.0? try 1!
scalar B = 1.0*constant::mathematical::pi*kappa/cpGas*diameter*NusseltCorr; scalar B =
1.0*constant::mathematical::pi*kappa/cpGas*diameter*NusseltCorr;
scalar nPos = B*log(1.0 + A)/Gf + 1.0; scalar nPos = B*log(1.0 + A)/Gf + 1.0;
scalar nNeg = (1.0/A)*(exp(Gf/B) - 1.0 - A) + 1.0; scalar nNeg = (1.0/A)*(exp(Gf/B) - 1.0 - A) + 1.0;
@ -338,7 +341,10 @@ Foam::scalar Foam::RutlandFlashBoil::boilingTime
} }
} }
time = (constant::mathematical::pi*pow3(diameter)/6.0)*liquidDensity/(G + Gf); time =
(constant::mathematical::pi*pow3(diameter)/6.0)
*liquidDensity
/(G + Gf);
time = max(VSMALL, time); time = max(VSMALL, time);
} }

View File

@ -77,7 +77,11 @@ Foam::ChomiakInjector::ChomiakInjector
// correct velocityProfile // correct velocityProfile
forAll(sm.injectors(), i) forAll(sm.injectors(), i)
{ {
sm.injectors()[i].properties()->correctProfiles(sm.fuels(), referencePressure); sm.injectors()[i].properties()->correctProfiles
(
sm.fuels(),
referencePressure
);
} }
} }
@ -129,7 +133,8 @@ Foam::vector Foam::ChomiakInjector::direction
scalar reduce = 0.01; scalar reduce = 0.01;
// correct beta if this is a 2D run // correct beta if this is a 2D run
// map it onto the 'angleOfWedge' // map it onto the 'angleOfWedge'
beta *= (1.0-2.0*reduce)*0.5*sm_.angleOfWedge()/constant::mathematical::pi; beta *=
(1.0-2.0*reduce)*0.5*sm_.angleOfWedge()/constant::mathematical::pi;
beta += reduce*sm_.angleOfWedge(); beta += reduce*sm_.angleOfWedge();
normal = normal =

View File

@ -150,7 +150,10 @@ Foam::vector Foam::blobsSwirlInjector::direction
// correct beta if this is a 2D run // correct beta if this is a 2D run
// map it onto the 'angleOfWedge' // map it onto the 'angleOfWedge'
beta *= (1.0 - 2.0*reduce)*sm_.angleOfWedge()/(constant::mathematical::twoPi); beta *=
(1.0 - 2.0*reduce)
*sm_.angleOfWedge()
/(constant::mathematical::twoPi);
beta += reduce*sm_.angleOfWedge(); beta += reduce*sm_.angleOfWedge();
normal = normal =
alpha alpha

View File

@ -30,7 +30,8 @@ Description
Accurate description in: Accurate description in:
@verbatim @verbatim
Z. Han, S. Parrish, P.V. Farrell, R.D. Reitz Z. Han, S. Parrish, P.V. Farrell, R.D. Reitz
"Modeling Atomization Processes Of Pressure Swirl Hollow-Cone Fuel Sprays" "Modeling Atomization Processes Of Pressure
Swirl Hollow-Cone Fuel Sprays"
Atomization and Sprays, vol. 7, pp. 663-684, 1997 Atomization and Sprays, vol. 7, pp. 663-684, 1997
@endverbatim @endverbatim
and and

View File

@ -129,7 +129,8 @@ Foam::vector Foam::constInjector::direction
v (alpha) v (alpha)
*/ */
scalar angle = rndGen_.scalar01()*sprayAngle_[n]*constant::mathematical::pi/360.0; scalar angle =
rndGen_.scalar01()*sprayAngle_[n]*constant::mathematical::pi/360.0;
scalar alpha = sin(angle); scalar alpha = sin(angle);
scalar dcorr = cos(angle); scalar dcorr = cos(angle);
@ -143,7 +144,10 @@ Foam::vector Foam::constInjector::direction
scalar reduce = 0.01; scalar reduce = 0.01;
// correct beta if this is a 2D run // correct beta if this is a 2D run
// map it onto the 'angleOfWedge' // map it onto the 'angleOfWedge'
beta *= (1.0 - 2.0*reduce)*0.5*sm_.angleOfWedge()/constant::mathematical::pi; beta *=
(1.0 - 2.0*reduce)
*0.5*sm_.angleOfWedge()
/constant::mathematical::pi;
beta += reduce*sm_.angleOfWedge(); beta += reduce*sm_.angleOfWedge();
normal = normal =

View File

@ -172,7 +172,10 @@ Foam::vector Foam::definedHollowConeInjector::direction
// correct beta if this is a 2D run // correct beta if this is a 2D run
// map it onto the 'angleOfWedge' // map it onto the 'angleOfWedge'
beta *= (1.0 - 2.0*reduce)*sm_.angleOfWedge()/(constant::mathematical::twoPi); beta *=
(1.0 - 2.0*reduce)
*sm_.angleOfWedge()
/(constant::mathematical::twoPi);
beta += reduce*sm_.angleOfWedge(); beta += reduce*sm_.angleOfWedge();
normal = normal =
alpha alpha

View File

@ -223,7 +223,10 @@ Foam::vector Foam::definedPressureSwirlInjector::direction
// correct beta if this is a 2D run // correct beta if this is a 2D run
// map it onto the 'angleOfWedge' // map it onto the 'angleOfWedge'
beta *= (1.0 - 2.0*reduce)*sm_.angleOfWedge()/(constant::mathematical::twoPi); beta *=
(1.0 - 2.0*reduce)
*sm_.angleOfWedge()
/(constant::mathematical::twoPi);
beta += reduce*sm_.angleOfWedge(); beta += reduce*sm_.angleOfWedge();
normal = normal =
alpha alpha
@ -261,7 +264,10 @@ Foam::scalar Foam::definedPressureSwirlInjector::velocity
} }
Foam::scalar Foam::definedPressureSwirlInjector::averageVelocity(const label i) const Foam::scalar Foam::definedPressureSwirlInjector::averageVelocity
(
const label i
) const
{ {
const injectorType& it = sm_.injectors()[i].properties(); const injectorType& it = sm_.injectors()[i].properties();

View File

@ -139,7 +139,10 @@ Foam::vector Foam::hollowConeInjector::direction
// correct beta if this is a 2D run // correct beta if this is a 2D run
// map it onto the 'angleOfWedge' // map it onto the 'angleOfWedge'
beta *= (1.0 - 2.0*reduce)*sm_.angleOfWedge()/(constant::mathematical::twoPi); beta *=
(1.0 - 2.0*reduce)
*sm_.angleOfWedge()
/(constant::mathematical::twoPi);
beta += reduce*sm_.angleOfWedge(); beta += reduce*sm_.angleOfWedge();
normal = normal =
alpha alpha

View File

@ -145,7 +145,10 @@ Foam::vector Foam::pressureSwirlInjector::direction
// correct beta if this is a 2D run // correct beta if this is a 2D run
// map it onto the 'angleOfWedge' // map it onto the 'angleOfWedge'
beta *= (1.0 - 2.0*reduce)*sm_.angleOfWedge()/(constant::mathematical::twoPi); beta *=
(1.0 - 2.0*reduce)
*sm_.angleOfWedge()
/(constant::mathematical::twoPi);
beta += reduce*sm_.angleOfWedge(); beta += reduce*sm_.angleOfWedge();
normal = normal =
alpha alpha

View File

@ -76,7 +76,8 @@ const Foam::dictionary& Foam::DevolatilisationModel<CloudType>::dict() const
template<class CloudType> template<class CloudType>
const Foam::dictionary& Foam::DevolatilisationModel<CloudType>::coeffDict() const const Foam::dictionary&
Foam::DevolatilisationModel<CloudType>::coeffDict() const
{ {
return coeffDict_; return coeffDict_;
} }
@ -87,4 +88,3 @@ const Foam::dictionary& Foam::DevolatilisationModel<CloudType>::coeffDict() cons
#include "DevolatilisationModelNew.C" #include "DevolatilisationModelNew.C"
// ************************************************************************* // // ************************************************************************* //

View File

@ -29,7 +29,11 @@ License
namespace Foam namespace Foam
{ {
defineTemplateTypeNameAndDebug(IOList<reactingMultiphaseParcelInjectionData>, 0); defineTemplateTypeNameAndDebug
(
IOList<reactingMultiphaseParcelInjectionData>,
0
);
} }

View File

@ -132,7 +132,10 @@ public:
} }
//- Read energyScalingFunction dictionary //- Read energyScalingFunction dictionary
virtual bool read(const dictionary& energyScalingFunctionProperties) = 0; virtual bool read
(
const dictionary& energyScalingFunctionProperties
) = 0;
}; };

View File

@ -31,7 +31,8 @@ Description
@verbatim @verbatim
@ARTICLE{MA_Maitland_Smith, @ARTICLE{MA_Maitland_Smith,
author = {{Maitland}, G.~C. and {Smith}, E.~B.}, author = {{Maitland}, G.~C. and {Smith}, E.~B.},
title = {A simplified representation of intermolecular potential energy}, title = {A simplified representation of
intermolecular potential energy},
journal = {Chemical Physics Letters}, journal = {Chemical Physics Letters},
year = 1973, year = 1973,
month = oct, month = oct,
@ -45,7 +46,8 @@ Description
Parameters for other monoatomics from: Parameters for other monoatomics from:
@verbatim @verbatim
@BOOK{MD_Maitland_Rigby_Smith_Wakeham, @BOOK{MD_Maitland_Rigby_Smith_Wakeham,
AUTHOR = {Geoffrey C. Maitland and Maurice Rigby and E. Brian Smith and William A. Wakeham}, AUTHOR = {Geoffrey C. Maitland and Maurice Rigby and
E. Brian Smith and William A. Wakeham},
TITLE = {Intermolecular Forces: Their Origin and Determination}, TITLE = {Intermolecular Forces: Their Origin and Determination},
PUBLISHER = {Oxford University Press}, PUBLISHER = {Oxford University Press},
YEAR = {1981} YEAR = {1981}

View File

@ -50,7 +50,8 @@ void Foam::tetherPotentialList::readTetherPotentialDict
if (tetherId == -1) if (tetherId == -1)
{ {
FatalErrorIn("tetherPotentialList::readTetherPotentialDict") FatalErrorIn("tetherPotentialList::readTetherPotentialDict")
<< nl << "No matching entry found in siteIdList for tether name " << nl
<< "No matching entry found in siteIdList for tether name "
<< tetherPotentialName << tetherPotentialName
<< abort(FatalError); << abort(FatalError);
} }

View File

@ -590,7 +590,10 @@ Foam::booleanSurface::booleanSurface
// Copy points from subSurf1 and remember the labels of the ones in // Copy points from subSurf1 and remember the labels of the ones in
// the intersection // the intersection
labelList intersectionLabels(cutSurf1.nPoints() - cutSurf1.nSurfacePoints()); labelList intersectionLabels
(
cutSurf1.nPoints() - cutSurf1.nSurfacePoints()
);
label combinedPointI = 0; label combinedPointI = 0;

View File

@ -250,11 +250,11 @@ void d2vec_part_quick_a ( int n, double a[], int *l, int *r )
return; return;
} }
//******************************************************************************* //******************************************************************************
void d2vec_permute ( int n, double a[], int p[] ) void d2vec_permute ( int n, double a[], int p[] )
//******************************************************************************* //******************************************************************************
// //
// Purpose: // Purpose:
// //
@ -383,7 +383,8 @@ int *d2vec_sort_heap_index_a ( int n, double a[] )
// //
// Purpose: // Purpose:
// //
// D2VEC_SORT_HEAP_INDEX_A does an indexed heap ascending sort of an R2 vector. // D2VEC_SORT_HEAP_INDEX_A does an indexed heap ascending sort of
// an R2 vector.
// //
// Discussion: // Discussion:
// //
@ -864,7 +865,8 @@ void dmat_uniform ( int m, int n, double b, double c, int *seed, double r[] )
// //
// Purpose: // Purpose:
// //
// DMAT_UNIFORM fills a double precision array with scaled pseudorandom values. // DMAT_UNIFORM fills a double precision array with scaled
// pseudorandom values.
// //
// Discussion: // Discussion:
// //
@ -983,8 +985,9 @@ int dtris2 ( int point_num, double point_xy[], int *tri_num,
// //
// Input, int POINT_NUM, the number of vertices. // Input, int POINT_NUM, the number of vertices.
// //
// Input/output, double POINT_XY[POINT_NUM*2], the coordinates of the vertices. // Input/output, double POINT_XY[POINT_NUM*2], the coordinates of
// On output, the vertices have been sorted into dictionary order. // the vertices. On output, the vertices have been sorted into
// dictionary order.
// //
// Output, int *TRI_NUM, the number of triangles in the triangulation; // Output, int *TRI_NUM, the number of triangles in the triangulation;
// TRI_NUM is equal to 2*POINT_NUM - NB - 2, where NB is the number // TRI_NUM is equal to 2*POINT_NUM - NB - 2, where NB is the number
@ -1703,11 +1706,11 @@ int i_sign ( int i )
} }
} }
//******************************************************************************* //******************************************************************************
int i_wrap ( int ival, int ilo, int ihi ) int i_wrap ( int ival, int ilo, int ihi )
//******************************************************************************* //******************************************************************************
// //
// Purpose: // Purpose:
// //
@ -3008,7 +3011,8 @@ double *triangle_circumcenter_2d ( double t[] )
// //
// Input, double T[2*3], the triangle vertices. // Input, double T[2*3], the triangle vertices.
// //
// Output, double *X, *Y, the coordinates of the circumcenter of the triangle. // Output, double *X, *Y, the coordinates of the circumcenter of
// the triangle.
// //
{ {
# define DIM_NUM 2 # define DIM_NUM 2
@ -3043,8 +3047,8 @@ double *triangle_circumcenter_2d ( double t[] )
} }
//****************************************************************************** //******************************************************************************
bool triangulation_plot_eps ( const char *file_out_name, int g_num, double g_xy[], bool triangulation_plot_eps ( const char *file_out_name, int g_num,
int tri_num, int nod_tri[] ) double g_xy[], int tri_num, int nod_tri[] )
//****************************************************************************** //******************************************************************************
// //

View File

@ -30,8 +30,8 @@ void ivec_heap_d ( int n, int a[] );
int *ivec_indicator ( int n ); int *ivec_indicator ( int n );
void ivec_sort_heap_a ( int n, int a[] ); void ivec_sort_heap_a ( int n, int a[] );
void ivec_sorted_unique ( int n, int a[], int *nuniq ); void ivec_sorted_unique ( int n, int a[], int *nuniq );
int lrline ( double xu, double yu, double xv1, double yv1, double xv2, double yv2, int lrline ( double xu, double yu, double xv1, double yv1, double xv2,
double dv ); double yv2, double dv );
bool perm_check ( int n, int p[] ); bool perm_check ( int n, int p[] );
void perm_inv ( int n, int p[] ); void perm_inv ( int n, int p[] );
int *points_delaunay_naive_2d ( int n, double p[], int *ntri ); int *points_delaunay_naive_2d ( int n, double p[], int *ntri );
@ -42,10 +42,9 @@ int swapec ( int i, int *top, int *btri, int *bedg, int point_num,
void timestamp ( void ); void timestamp ( void );
char *timestring ( void ); char *timestring ( void );
double *triangle_circumcenter_2d ( double t[] ); double *triangle_circumcenter_2d ( double t[] );
bool triangulation_plot_eps ( const char *file_out_name, int g_num, double g_xy[], bool triangulation_plot_eps ( const char *file_out_name,
int tri_num, int nod_tri[] ); int g_num, double g_xy[], int tri_num, int nod_tri[] );
void triangulation_print ( int point_num, double xc[], int tri_num, void triangulation_print ( int point_num, double xc[], int tri_num,
int tri_vert[], int tri_nabe[] ); int tri_vert[], int tri_nabe[] );
void vbedg ( double x, double y, int point_num, double point_xy[], int tri_num, void vbedg ( double x, double y, int point_num, double point_xy[], int tri_num,
int tri_vert[], int tri_nabe[], int *ltri, int *ledg, int *rtri, int *redg ); int tri_vert[], int tri_nabe[], int *ltri, int *ledg, int *rtri, int *redg );

View File

@ -29,7 +29,11 @@ License
namespace Foam namespace Foam
{ {
defineNamedTemplateTypeNameAndDebug(surfaceInterpolateFieldsFunctionObject, 0); defineNamedTemplateTypeNameAndDebug
(
surfaceInterpolateFieldsFunctionObject,
0
);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (

View File

@ -25,8 +25,8 @@ Typedef
Foam::surfaceInterpolateFieldsFunctionObject Foam::surfaceInterpolateFieldsFunctionObject
Description Description
FunctionObject wrapper around surfaceInterpolateFields to allow them to be created via FunctionObject wrapper around surfaceInterpolateFields to allow
the functions entry within controlDict. them to be created via the functions entry within controlDict.
SourceFiles SourceFiles
surfaceInterpolateFieldsFunctionObject.C surfaceInterpolateFieldsFunctionObject.C

View File

@ -28,7 +28,9 @@ Description
Rosin-Rammler pdf Rosin-Rammler pdf
@f[ @f[
cumulative pdf = (1.0 - exp( -((x - d0)/d)^n ) / (1.0 - exp( -((d1 - d0)/d)^n ) cumulative pdf =
(1.0 - exp( -(( x - d0)/d)^n )
/ (1.0 - exp( -((d1 - d0)/d)^n )
@f] @f]

View File

@ -14,7 +14,8 @@
phi = phiU + phi = phiU +
( (
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() fvc::interpolate(interface.sigmaK())
*fvc::snGrad(alpha1)*mesh.magSf()
+ fvc::interpolate(rho)*(g & mesh.Sf()) + fvc::interpolate(rho)*(g & mesh.Sf())
)*rUAf; )*rUAf;
adjustPhi(phi, U, p); adjustPhi(phi, U, p);