Improved commenting on Peplinski soil model.

这个提交包含在:
Craig Warren
2018-05-18 14:10:00 +01:00
父节点 7b1a91ca76
当前提交 50df03656c
共有 4 个文件被更改,包括 18 次插入20 次删除

查看文件

@@ -301,7 +301,7 @@ The syntax of the command is:
#soil_peplinski:
----------------
Allows you to use a mixing model for soils proposed by Peplinski (http://dx.doi.org/10.1109/36.387598). The command is designed to be used in conjunction with the ``#fractal_box`` command for creating soils with realistic dielectric and geometric properties. The syntax of the command is:
Allows you to use a mixing model for soils proposed by Peplinski (http://dx.doi.org/10.1109/36.387598), valid for frequencies in the range 0.3GHz to 1.3GHz. The command is designed to be used in conjunction with the ``#fractal_box`` command for creating soils with realistic dielectric and geometric properties. The syntax of the command is:
.. code-block:: none

查看文件

@@ -126,8 +126,8 @@ def run_main(args):
hostinfo = get_host_info()
hyperthreading = ', {} cores with Hyper-Threading'.format(hostinfo['logicalcores']) if hostinfo['hyperthreading'] else ''
print('\nHost: {} | {} | {} x {} ({} cores{}) | {} RAM | {}'.format(hostinfo['hostname'],
hostinfo['machineID'], hostinfo['sockets'], hostinfo['cpuID'], hostinfo['physicalcores'],
hyperthreading, human_size(hostinfo['ram'], a_kilobyte_is_1024_bytes=True), hostinfo['osversion']))
hostinfo['machineID'], hostinfo['sockets'], hostinfo['cpuID'], hostinfo['physicalcores'],
hyperthreading, human_size(hostinfo['ram'], a_kilobyte_is_1024_bytes=True), hostinfo['osversion']))
# Get information/setup Nvidia GPU(s)
if args.gpu is not None:
@@ -374,14 +374,13 @@ def run_mpi_sim(args, inputfile, usernamespace, optparams=None):
# Master process #
##################
if workerflag not in sys.argv:
# N.B Spawned worker flag (--mpi-worker) applied to sys.argv when MPI.Spawn is called
# N.B Spawned worker flag (--mpi-worker) applied to sys.argv when MPI.Spawn is called
# Get MPI communicator object either through argument or just get comm_world
if hasattr(args, 'mpicomm'):
comm = args.mpicomm
else:
comm = MPI.COMM_WORLD
size = comm.Get_size() # total number of processes
rank = comm.Get_rank() # rank of this process
tsimstart = perf_counter()
print('MPI master ({}, rank {}) on {} using {} workers\n'.format(comm.name, rank, hostname, numworkers))
@@ -509,7 +508,7 @@ def run_mpi_alt_sim(args, inputfile, usernamespace, optparams=None):
modelstart = args.restart if args.restart else 1
modelend = modelstart + args.n
numbermodelruns = args.n
currentmodelrun = modelstart # can use -task argument to start numbering from something other than 1
currentmodelrun = modelstart # can use -task argument to start numbering from something other than 1
numworkers = size - 1
##################
@@ -521,7 +520,7 @@ def run_mpi_alt_sim(args, inputfile, usernamespace, optparams=None):
closedworkers = 0
while closedworkers < numworkers:
data = comm.recv(source=MPI.ANY_SOURCE, tag=MPI.ANY_TAG, status=status)
comm.recv(source=MPI.ANY_SOURCE, tag=MPI.ANY_TAG, status=status)
source = status.Get_source()
tag = status.Get_tag()

查看文件

@@ -269,7 +269,7 @@ class PeplinskiSoil(object):
def calculate_debye_properties(self, nbins, G):
"""
Calculates the real and imaginery part of a Debye model for the soil as
well as a conductivity. It uses a semi-empirical model (http://dx.doi.org/10.1109/36.387598).
well as a conductivity. It uses an approximation to a semi-empirical model (http://dx.doi.org/10.1109/36.387598).
Args:
nbins (int): Number of bins to use to create the different materials.
@@ -280,17 +280,16 @@ class PeplinskiSoil(object):
f = 1.3e9
w = 2 * np.pi * f
erealw = Material.watereri + ((Material.waterdeltaer) / (1 + (w * Material.watertau)**2))
# eimagw = w * Material.watertau * ((Material.waterdeltaer) / (1 + (w * Material.watertau)**2))
a = 0.65 # Experimentally derived constant
es = (1.01 + 0.44 * self.rs)**2 - 0.062
es = (1.01 + 0.44 * self.rs)**2 - 0.062 # Relative permittivity of sand particles
b1 = 1.2748 - 0.519 * self.S - 0.152 * self.C
b2 = 1.33797 - 0.603 * self.S - 0.166 * self.C
# For frequencies in the range 0.3GHz to 1.3GHz
sigf1 = 0.0467 + 0.2204 * self.rb - 0.411 * self.S + 0.6614 * self.C
sigf = 0.0467 + 0.2204 * self.rb - 0.411 * self.S + 0.6614 * self.C
# For frequencies in the range 1.4GHz to 18GHz
# sigf2 = -1.645 + 1.939 * self.rb - 2.25622 * self.S + 1.594 * self.C
# sigf = -1.645 + 1.939 * self.rb - 2.25622 * self.S + 1.594 * self.C
# Generate a set of bins based on the given volumetric water fraction values
mubins = np.linspace(self.mu[0], self.mu[1], nbins)
@@ -301,15 +300,15 @@ class PeplinskiSoil(object):
muiter = np.nditer(mumaterials, flags=['c_index'])
while not muiter.finished:
# Real part for frequencies in the range 1.4GHz to 18GHz
er1 = (1 + (self.rb / self.rs) * ((es**a) - 1) + (muiter[0]**b1 * erealw**a) - muiter[0]) ** (1 / a)
# Real part for frequencies in the range 0.3GHz to 1.3GHz
er2 = 1.15 * er1 - 0.68
er = (1 + (self.rb / self.rs) * ((es**a) - 1) + (muiter[0]**b1 * erealw**a) - muiter[0]) ** (1 / a)
# Real part for frequencies in the range 0.3GHz to 1.3GHz (linear correction to 1.4-18GHz value)
er = 1.15 * er - 0.68
# Imaginary part for frequencies in the range 0.3GHz to 1.3GHz
eri = er2 - (muiter[0]**(b2 / a) * Material.waterdeltaer)
# Permittivity at infinite frequency
eri = er - (muiter[0]**(b2 / a) * Material.waterdeltaer)
# Effective conductivity
sig = muiter[0]**(b2 / a) * ((sigf1 * (self.rs - self.rb)) / (self.rs * muiter[0]))
sig = muiter[0]**(b2 / a) * ((sigf * (self.rs - self.rb)) / (self.rs * muiter[0]))
# Check to see if the material already exists before creating a new one
requiredID = '|{:.4f}|'.format(float(muiter[0]))
@@ -328,7 +327,7 @@ class PeplinskiSoil(object):
Material.maxpoles = m.poles
m.er = eri
m.se = sig
m.deltaer.append(er2 - m.er)
m.deltaer.append(er - eri)
m.tau.append(Material.watertau)
G.materials.append(m)

查看文件

@@ -72,7 +72,7 @@ def gpu_get_rx_array(rxs_gpu, rxcoords_gpu, G):
"""Copy output from receivers array used on GPU back to receiver objects.
Args:
rxs_gpu (int): numpy array of receiver data from GPU - rows are field components; columns are iterations; pages are receivers.
rxs_gpu (float): numpy array of receiver data from GPU - rows are field components; columns are iterations; pages are receivers.
rxcoords_gpu (float): numpy array of receiver coordinates from GPU.
G (class): Grid class instance - holds essential parameters describing the model.
"""